Просмотр исходного кода

dpkg-genchanges: add a new warning

* scripts/dpkg-genchanges.pl: Warn if the current version is
smaller than the previous one.
Raphael Hertzog лет назад: 18
Родитель
Сommit
dd02ee54cd
3 измененных файлов с 16 добавлено и 1 удалено
  1. 5 0
      ChangeLog
  2. 4 0
      debian/changelog
  3. 7 1
      scripts/dpkg-genchanges.pl

+ 5 - 0
ChangeLog

@@ -1,3 +1,8 @@
+2008-01-24  Raphael Hertzog  <hertzog@debian.org>
+
+	* scripts/dpkg-genchanges.pl: Warn if the current version is
+	smaller than the previous one.
+
 2008-01-22  Guillem Jover  <guillem@debian.org>
 
 	* dpkg-deb/extract.c (extracthalf): Refactor fflush and its buggy

+ 4 - 0
debian/changelog

@@ -7,6 +7,10 @@ dpkg (1.14.17) UNRELEASED; urgency=low
     whatever's currently installed. Closes: #151540
     Thanks to Colin Watson.
 
+  [ Raphael Hertzog ]
+  * Add a warning displayed by dpkg-genchanges if the current version is
+    smaller than the previous one. Closes: #4655
+
   [ Updated manpages translations ]
   * German (Helge Kreutzmann).
 

+ 7 - 1
scripts/dpkg-genchanges.pl

@@ -18,7 +18,7 @@ use Dpkg::Cdata;
 use Dpkg::Substvars;
 use Dpkg::Vars;
 use Dpkg::Changelog qw(parse_changelog);
-use Dpkg::Version qw(parseversion);
+use Dpkg::Version qw(parseversion compare_versions);
 
 textdomain("dpkg-dev");
 
@@ -202,6 +202,12 @@ my $fields = Dpkg::Fields::Object->new();
 $substvars->set_version_substvars($changelog->{"Version"});
 $substvars->parse($varlistfile) if -e $varlistfile;
 
+if (defined($prev_changelog) and
+    compare_versions($changelog->{"Version"}, '<', $prev_changelog->{"Version"})) {
+    warning(_g("the current version (%s) is smaller than the previous one (%s)"),
+	$changelog->{"Version"}, $prev_changelog->{"Version"});
+}
+
 if (not is_sourceonly) {
     open(FL,"<",$fileslistfile) || &syserr(_g("cannot read files list file"));
     while(<FL>) {