summaryrefslogtreecommitdiff
path: root/sort-deb
diff options
context:
space:
mode:
Diffstat (limited to 'sort-deb')
-rwxr-xr-xsort-deb8
1 files changed, 6 insertions, 2 deletions
diff --git a/sort-deb b/sort-deb
index fc760f1..184bf0a 100755
--- a/sort-deb
+++ b/sort-deb
@@ -26,8 +26,12 @@
# change the argument to system calls to a list. -- Peter Palfrader
-sub dpkgcmp{my ($i,$j)=@_;chomp $i;chomp $j;
+sub dpkgcmp{
+ my ($i,$j)=@_;
+ chomp $i;
+ chomp $j;
return system('dpkg', '--compare-versions', $i, 'lt', $j) * 1
+ system('dpkg', '--compare-versions', $i, 'gt', $j) *-1;
- ;}
+};
+
print (sort {dpkgcmp($a,$b)} <>);