Browse Source

dpkg-scansources: Sort output by package name and version

This is useful if multiple versions of the same package are kept
together in the same repository.

[guillem@debian.org:
 - Minor code formatting fix. ]

Signed-off-by: Guillem Jover <guillem@debian.org>
Maximilian Schwerin 11 years ago
parent
commit
d4ffe3118c
2 changed files with 5 additions and 1 deletions
  1. 2 0
      debian/changelog
  2. 3 1
      scripts/dpkg-scansources.pl

+ 2 - 0
debian/changelog

@@ -15,6 +15,8 @@ dpkg (1.18.1) UNRELEASED; urgency=low
   * Fix build failure on FreeBSD by actually using libmd if available.
   * Sort dpkg-scanpackages output by package name and version.
     Thanks to Maximilian Schwerin <maximilian.schwerin@tigris.de>.
+  * Sort dpkg-scansources output by package name and version.
+    Thanks to Maximilian Schwerin <maximilian.schwerin@tigris.de>.
   * Perl modules:
     - Add missing strict and warnings pragmas for submodules.
     - Use non-destructive substitutions inside map.

+ 3 - 1
scripts/dpkg-scansources.pl

@@ -321,7 +321,9 @@ while (<$find_fh>) {
 close $find_fh or syserr(g_('error closing %s (%s)'), 'find', $!);
 
 if (not $no_sort) {
-    @sources = sort { $a->{Package} cmp $b->{Package} } @sources;
+    @sources = sort {
+        $a->{Package} . $a->{Version} cmp $b->{Package} . $b->{Version}
+    } @sources;
 }
 foreach my $dsc (@sources) {
     $dsc->output(\*STDOUT);