From f9b8e121b8244a3ea0ede26b0cbc4829ec3283f2 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 4 Nov 2014 12:39:30 +0000 Subject: [PATCH 1/1] Use Dpkg::Version::version_compare everywhere, not Dpkg::Version::version_compare_string. The latter is entirely wrong, meaning that dgit would get many version comparisons wrong. Closes:#768038. --- debian/changelog | 9 +++++++++ dgit | 12 ++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 49c3458f..c8128f61 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +dgit (0.22.1) unstable; urgency=high + + * Use Dpkg::Version::version_compare everywhere, not + Dpkg::Version::version_compare_string. The latter is entirely wrong, + meaning that dgit would get many version comparisons wrong. + Closes:#768038. + + -- + dgit (0.22) unstable; urgency=medium Bugfixes: diff --git a/dgit b/dgit index 930a5944..f571933a 100755 --- a/dgit +++ b/dgit @@ -766,7 +766,7 @@ sub madison_parse ($) { $5 eq 'source' or die "$rmad ?"; push @out, [$vsn,pool_dsc_subpath($vsn,$component),$newsuite]; } - return sort { -version_compare_string($a->[0],$b->[0]); } @out; + return sort { -version_compare($a->[0],$b->[0]); } @out; } sub canonicalise_suite_madison ($$) { @@ -824,7 +824,7 @@ sub archive_query_sshpsql ($$) { AND source.source='$package' AND files.filename LIKE '%.dsc'; END - @rows = sort { -version_compare_string($a->[0],$b->[0]) } @rows; + @rows = sort { -version_compare($a->[0],$b->[0]) } @rows; my $digester = Digest::SHA->new(256); @rows = map { my ($vsn,$component,$filename,$sha256sum) = @$_; @@ -882,7 +882,7 @@ sub archive_query_dummycat ($$) { } C->error and die "$dpath: $!"; close C; - return sort { -version_compare_string($a->[0],$b->[0]); } @rows; + return sort { -version_compare($a->[0],$b->[0]); } @rows; } sub canonicalise_suite () { @@ -1096,7 +1096,7 @@ END my $oldclogp = parsecontrol('../changelogold.tmp','previous changelog'); my $oversion = getfield $oldclogp, 'Version'; my $vcmp = - version_compare_string($oversion, $cversion); + version_compare($oversion, $cversion); if ($vcmp < 0) { # git upload/ is earlier vsn than archive, use archive open C, ">../commit2.tmp" or die $!; @@ -1278,7 +1278,7 @@ END my $gotclogp = parsechangelog("-l$clogf"); my $got_vsn = getfield $gotclogp, 'Version'; printdebug "SKEW CHECK GOT $got_vsn\n"; - if (version_compare_string($got_vsn, $skew_warning_vsn) < 0) { + if (version_compare($got_vsn, $skew_warning_vsn) < 0) { print STDERR <[0] } @vsns; - @vsns = sort { -version_compare_string($a, $b) } @vsns; + @vsns = sort { -version_compare($a, $b) } @vsns; $changes_since_version = $vsns[0]; progress "changelog will contain changes since $vsns[0]"; } else { -- 2.30.2