From: Raphael Hertzog Date: Thu, 24 Jan 2008 22:06:37 +0000 (+0100) Subject: dpkg-genchanges: add a new warning X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd02ee54cd9fbc1ac7f01697c62d3f1a5f3a41cc;p=dpkg dpkg-genchanges: add a new warning * scripts/dpkg-genchanges.pl: Warn if the current version is smaller than the previous one. --- diff --git a/ChangeLog b/ChangeLog index 73e4f2e2..3f8ace66 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-01-24 Raphael Hertzog + + * scripts/dpkg-genchanges.pl: Warn if the current version is + smaller than the previous one. + 2008-01-22 Guillem Jover * dpkg-deb/extract.c (extracthalf): Refactor fflush and its buggy diff --git a/debian/changelog b/debian/changelog index 1f7e0d0f..b6359faa 100644 --- a/debian/changelog +++ b/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). diff --git a/scripts/dpkg-genchanges.pl b/scripts/dpkg-genchanges.pl index a908fb5d..3071d242 100755 --- a/scripts/dpkg-genchanges.pl +++ b/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() {