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

dpkg-scanpackages: Sort output by package name and version

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

Signed-off-by: Guillem Jover <guillem@debian.org>
Maximilian Schwerin лет назад: 11
Родитель
Сommit
dbdb71563e
2 измененных файлов с 3 добавлено и 1 удалено
  1. 2 0
      debian/changelog
  2. 1 1
      scripts/dpkg-scanpackages.pl

+ 2 - 0
debian/changelog

@@ -13,6 +13,8 @@ dpkg (1.18.1) UNRELEASED; urgency=low
   * Honor Pre-Depends, Conflicts and Breaks for packages in unpacked and
     half states. Thanks to Ian Jackson <iwj@ubuntu.com>. Closes: #377860
   * 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>.
   * Perl modules:
     - Add missing strict and warnings pragmas for submodules.
     - Use non-destructive substitutions inside map.

+ 1 - 1
scripts/dpkg-scanpackages.pl

@@ -268,7 +268,7 @@ for my $p (sort keys %packages) {
     if (defined($override) and not defined($overridden{$p})) {
         push @missingover, $p;
     }
-    for my $package (@{$packages{$p}}) {
+    for my $package (sort { $a->{Version} cmp $b->{Version} } @{$packages{$p}}) {
          print("$package\n") or syserr(g_('failed when writing stdout'));
          $records_written++;
     }