[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 2/2] dpkg-scansources: Sort output by package name and version.



This patch modifies dpkg-scansources.pl so that the output is sorted by
package name and package version. This is useful if multiple versions of the
same package are kept together in the same repository.
---
 scripts/dpkg-scansources.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/dpkg-scansources.pl b/scripts/dpkg-scansources.pl
index 0ae6170..c97cc80 100755
--- a/scripts/dpkg-scansources.pl
+++ b/scripts/dpkg-scansources.pl
@@ -321,7 +321,7 @@ 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);
-- 
1.9.1

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Reply to: