aboutsummaryrefslogtreecommitdiffstats
path: root/touch_translations.pl
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2018-06-06 15:42:15 +0100
committerSteve McIntyre <steve@einval.com>2018-06-06 15:46:09 +0100
commitf11f0549503ec30bc4e725b3ef85b0cea5e83953 (patch)
treee481c16b8ceea5788faa127d8c567e9afc8cd848 /touch_translations.pl
parentaaf5e6eaca4dd60eae83cdf0ade84365b1bfbe2e (diff)
Several updates for touch_translations.pl
If count_changes() returns undef due to error, abort and print the error Update boilerplate Pass on the debug level to the underlying VCS module
Diffstat (limited to 'touch_translations.pl')
-rwxr-xr-xtouch_translations.pl23
1 files changed, 11 insertions, 12 deletions
diff --git a/touch_translations.pl b/touch_translations.pl
index c72592c04a4..9409bb2b0f0 100755
--- a/touch_translations.pl
+++ b/touch_translations.pl
@@ -13,28 +13,24 @@
# "N", it is touched and a marker file is created
# This allows the file to be rebuilt _exactly_ the number of times it should
# (i.e. $#stages times)
-
+#
# (C) 2000 by Marcin Owsiany <porridge@pandora.info.bielsko.pl>
-
-# TODOs:
-# - compare both major and minor revision number
-# - think of a better way to check when the file has been rebuilt last
-
-# These modules reside under webwml/Perl
+# Original script
+#
+# (C) 2018 Steve McIntyre <93sam@debian.org>
+# Converted to use Local::VCS to allow for usage with git instead of CVS
#
-# FIXME 93sam 2018-05-17: Converted to use Local::VCS to allow for
-# usage with git, but not tested much. It's not clear at all if this
-# script is still used or not.
+# These modules reside under webwml/Perl
use lib ($0 =~ m|(.*)/|, $1 or ".") ."/Perl";
use Local::VCS;
use Webwml::Langs;
use Webwml::TransCheck;
-# Set this to 1 for debugging
+# Set this to non-zero for debugging
$debug = 0;
-my $VCS = Local::VCS->new();
+my $VCS = Local::VCS->new("DEBUG" => $debug);
sub rebuild {
my $file = shift;
@@ -115,6 +111,9 @@ foreach $lang (@langs) {
next unless not defined $original or $original eq $arglang;
$difference = $VCS->count_changes($argfile, $langrev, $origrev);
+ if (!defined $difference) {
+ die "count_changes failed when looking at $argfile\n";
+ }
if ($difference < $mindelta) {
next unless was_forced($transfile);
print "unlinking $transfile.forced\n" if $debug;

© 2014-2024 Faster IT GmbH | imprint | privacy policy