diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2014-01-30 13:17:43 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2014-01-30 13:17:43 +0000 |
commit | 083889ef6be124807fa8c157461064dc15f40a17 (patch) | |
tree | 42e62714694061e4b963cd38b2958d4fff0fe54a | |
parent | a729395cb625bb09b6fb30c546dde2227d42552f (diff) |
most PkgSpec are default conflicts, so not storing empty constraints...
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgSpec.pm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm index 2ebb4c29197..123cab41c44 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgSpec.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PkgSpec.pm,v 1.39 2011/08/31 22:50:21 espie Exp $ +# $OpenBSD: PkgSpec.pm,v 1.40 2014/01/30 13:17:42 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -308,8 +308,10 @@ sub new exactstem => qr{^$stemspec$}, fuzzystem => qr{^$stemspec\-\d.*$}, libstem => qr{^\.libs\d*\-$stemspec\-\d.*$}, - constraints => $constraints, }, $class; + if (@$constraints != 0) { + $o->{constraints} = $constraints; + } if (defined $r->{e}) { $o->{e} = 1; } @@ -328,8 +330,10 @@ LOOP1: for my $s (grep(/$o->{fuzzystem}/, @$list)) { my $name = OpenBSD::PackageName->from_string($s); next unless $name->{stem} =~ m/^$o->{exactstem}$/; - for my $c (@{$o->{constraints}}) { - next LOOP1 unless $c->match($name); + if (defined $o->{constraints}) { + for my $c (@{$o->{constraints}}) { + next LOOP1 unless $c->match($name); + } } if (wantarray) { push(@result, $s); @@ -357,8 +361,10 @@ LOOP2: for my $s (grep { $_->name =~ m/$o->{fuzzystem}/} @$list) { my $name = $s->pkgname; next unless $name->{stem} =~ m/^$o->{exactstem}$/; - for my $c (@{$o->{constraints}}) { - next LOOP2 unless $c->match($name); + if (defined $o->{constraints}) { + for my $c (@{$o->{constraints}}) { + next LOOP2 unless $c->match($name); + } } push(@$result, $s); } |