From 38c9a5ef1de25c31ea1f43cb15e0d6307cf9d7c0 Mon Sep 17 00:00:00 2001 From: John McQuah Date: Mon, 7 Aug 2023 09:38:41 -0400 Subject: [PATCH] pkg-get.pl: infer the package ordering from PKGREPO (do not rely on lexographic sorting to compare version strings) --- scripts/pkg-get.pl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/pkg-get.pl b/scripts/pkg-get.pl index 6e854dc..5636507 100755 --- a/scripts/pkg-get.pl +++ b/scripts/pkg-get.pl @@ -339,14 +339,12 @@ sub getpackage { $pkg{'version'}, $pkg{'release'}, $pkg{'description'}, $pkg{'md5sum'}, $pkg{'size'}, $pkg{'pre_install'}, $pkg{'post_install'}, $pkg{'readme'}); - ( ($repver{$pkgname}) and - ($repver{$pkgname} gt "$pkg{'version'}-$pkg{'release'}") ) - or $repver{$pkgname} = "$pkg{'version'}-$pkg{'release'}"; + $repver{$pkgname} = "$pkg{'version'}-$pkg{'release'}"; } close (REPO); while (my $match = shift @maybe) { my ($p,$u,$v,$r,$d,$m,$s,$E,$O,$R) = split /\^/, $match; - next if ("$v-$r" lt $repver{$pkgname}); + next if ("$v-$r" ne $repver{$pkgname}); %res = ('name' => $pkgname, 'path' => $p, 'url' => $u, 'version' => $v, 'release' => $r, 'description' => $d, 'md5sum' => $m, 'size' => $s, @@ -361,7 +359,7 @@ sub getpackage { sub getshortstatus { my %pkg = @_; ($installed{$pkg{'name'}}) or return "[ ]"; - ($installed{$pkg{'name'}} =~ /^$pkg{'version'}-$pkg{'release'}/) or return "[u]"; + ($installed{$pkg{'name'}} eq "$pkg{'version'}-$pkg{'release'}") or return "[u]"; return "[i]"; }