From c21c9b1630bed1060e8e5dfec2b870355125e652 Mon Sep 17 00:00:00 2001 From: Denis Barbier Date: Fri, 21 Feb 2003 13:37:12 +0000 Subject: New -n and -p flags CVS version numbers smart_change.pl: 1.2 -> 1.3 --- smart_change.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'smart_change.pl') diff --git a/smart_change.pl b/smart_change.pl index eb8cb2cd3a7..8b8d6cd9857 100755 --- a/smart_change.pl +++ b/smart_change.pl @@ -12,7 +12,7 @@ use Local::Cvsinfo; use Webwml::TransCheck; use Webwml::Langs; -our ($opt_h, $opt_v, @opt_l, @opt_s); +our ($opt_h, $opt_v, $opt_n, $opt_p, @opt_l, @opt_s); sub usage { print <<'EOT'; @@ -20,6 +20,8 @@ Usage: smart_change.pl [options] origfile Options: -h, --help display this message -v, --verbose run verbosely + -n, --no-bump do not bump translation-check headers + -p, --previous get previous CVS revision -l, --lang=STRING process this language (may be used more than once) -s, --substitute=REGEXP Perl regexp applied to source files @@ -31,6 +33,8 @@ EOT if (not Getopt::Long::GetOptions(qw( h|help v|verbose + n|no-bump + p|previous l|lang=s@ s|substitute=s@ ))) { @@ -67,6 +71,9 @@ my $cvs = Local::Cvsinfo->new(); $cvs->options(matchfile => [ $file ]); $cvs->readinfo($path); my $origrev = $cvs->revision($argfile) || "1.0"; +if ($opt_p) { + $origrev =~ s/(\d+)$/($1 - 1)/e; +} verbose("Original revision: $origrev"); my $nextrev = $origrev; @@ -89,7 +96,7 @@ foreach my $lang (@opt_l) { open (TRANS, "< $transfile"); while () { $origtext .= $_; - if (m/^#use wml::debian::translation-check/ && + if (m/^#use wml::debian::translation-check/ && !$opt_n && ($langrev eq $origrev || $langrev eq $nextrev)) { # Also check for $nextrev in case this script # is run several times -- cgit v1.2.3