summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg/pkg.pl
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2001-07-14 14:20:12 +0000
committerMarc Espie <espie@cvs.openbsd.org>2001-07-14 14:20:12 +0000
commitcbb8e431b34711f518a1b94c214b44cb457c51d3 (patch)
tree7095b8667b653015a3d07121000472f1d99fc576 /usr.sbin/pkg/pkg.pl
parent54ad155bb93ea2a329d7c49ab85ede1b9fca6ae0 (diff)
Silly bug in version detection: not having any dewey check does NOT
mean check went okay. In fact, if we only have exact versions to match against, we don't want to match... Ouch.
Diffstat (limited to 'usr.sbin/pkg/pkg.pl')
-rw-r--r--usr.sbin/pkg/pkg.pl11
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/pkg/pkg.pl b/usr.sbin/pkg/pkg.pl
index 8b705b496c2..8afaed25576 100644
--- a/usr.sbin/pkg/pkg.pl
+++ b/usr.sbin/pkg/pkg.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg.pl,v 1.3 2001/04/24 22:14:10 espie Exp $
+# $OpenBSD: pkg.pl,v 1.4 2001/07/14 14:20:11 espie Exp $
#
# Copyright (c) 2001 Marc Espie.
#
@@ -113,7 +113,10 @@ sub check_version
return 1 if $v =~ /^$_$/;
return 1 if $v =~ /^${_}p\d+$/; # allows for recent patches
}
- for (grep !/^\d/, @specs) { # dewey match, all of them
+
+ # Last chance: dewey specs ?
+ my @deweys = grep !/^\d/, @specs;
+ for (@deweys) {
if (m/^\<\=|\>\=|\<|\>/) {
my ($op, $dewey) = ($&, $');
my $compare = dewey_compare($v, $dewey);
@@ -121,9 +124,11 @@ sub check_version
return 0 if $op eq '<=' && $compare > 0;
return 0 if $op eq '>' && $compare <= 0;
return 0 if $op eq '>=' && $compare < 0;
+ } else {
+ return 0; # unknown spec type
}
}
- return 1;
+ return @deweys == 0 ? 0 : 1;
}
sub check_1flavor