]> err.no Git - dpkg/commitdiff
dpkg-genchanges: add a new warning
authorRaphael Hertzog <hertzog@debian.org>
Thu, 24 Jan 2008 22:06:37 +0000 (23:06 +0100)
committerRaphael Hertzog <hertzog@debian.org>
Thu, 24 Jan 2008 22:06:37 +0000 (23:06 +0100)
* scripts/dpkg-genchanges.pl: Warn if the current version is
smaller than the previous one.

ChangeLog
debian/changelog
scripts/dpkg-genchanges.pl

index 73e4f2e2d805cbea4e83b324ec1a213a813d44f4..3f8ace66e83051101512bbe2fc1e161d4753c44c 100644 (file)
--- a/ChangeLog
+++ b/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
index 1f7e0d0f8345e15ac8959e1b59df0955c3c7c344..b6359faa3b66985e9f50f39e8b62d84f9f87f18b 100644 (file)
@@ -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).
 
index a908fb5df26f758035b97226241d856976092957..3071d242cb39859d63827281de84f5a0b7e7c583 100755 (executable)
@@ -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>) {