From f11f0549503ec30bc4e725b3ef85b0cea5e83953 Mon Sep 17 00:00:00 2001 From: Steve McIntyre Date: Wed, 6 Jun 2018 15:42:15 +0100 Subject: 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 --- touch_translations.pl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'touch_translations.pl') 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 - -# 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; -- cgit v1.2.3