summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2010-12-17 23:08:27 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2010-12-17 23:08:27 +0000
commit81956f6221b8b82072ddadbce51285cabe6d9680 (patch)
treeb86ee8ecd20e5dc344143dfd3c565ff6931819b6
parent30444ef1a687a00dc415da7822a7cadb8e6c13b0 (diff)
Strip all whitespace, even ws in front of the version number
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@469 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xsort-deb4
1 files changed, 2 insertions, 2 deletions
diff --git a/sort-deb b/sort-deb
index 184bf0a..54d1013 100755
--- a/sort-deb
+++ b/sort-deb
@@ -28,8 +28,8 @@
sub dpkgcmp{
my ($i,$j)=@_;
- chomp $i;
- chomp $j;
+ ($i) = $i =~ /(\S+)/;
+ ($j) = $j =~ /(\S+)/;
return system('dpkg', '--compare-versions', $i, 'lt', $j) * 1
+ system('dpkg', '--compare-versions', $i, 'gt', $j) *-1;
};