summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2005-08-17 10:00:20 +0000
committerMarc Espie <espie@cvs.openbsd.org>2005-08-17 10:00:20 +0000
commit055ec27f2efae872490576b782978a7daa62417a (patch)
tree94f6e678e2b9644a23fef9a82e03721dae588461 /usr.sbin
parent332365d1a1d61df26bde57970a98c74c7a00bee9 (diff)
save architecture as well for ExtraInfo, so that pkg_add -u won't try
to add packages for the wrong architecture. Noticed by Tim Kornau.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm3
-rw-r--r--usr.sbin/pkg_add/pkg_add7
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 76518a0d17c..af9360785a7 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingList.pm,v 1.46 2005/06/26 11:23:35 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.47 2005/08/17 10:00:19 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -151,6 +151,7 @@ sub ExtraInfoOnly
while (<$fh>) {
# XXX optimization
if (m/^\@arch\b/o) {
+ &$cont($_);
return;
}
next unless m/^\@(?:name\b|comment\s+subdir\=)/o;
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 76b77547acb..b5b0a0060db 100644
--- a/usr.sbin/pkg_add/pkg_add
+++ b/usr.sbin/pkg_add/pkg_add
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_add,v 1.188 2005/08/17 09:24:53 espie Exp $
+# $OpenBSD: pkg_add,v 1.189 2005/08/17 10:00:18 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -624,6 +624,11 @@ sub find_updates
my $dir = $handle->info();
my $p2 = OpenBSD::PackingList->fromfile($dir.CONTENTS,
\&OpenBSD::PackingList::ExtraInfoOnly);
+ if ($p2->has('arch')) {
+ unless ($p2->{arch}->check($state->{arch})) {
+ next;
+ }
+ }
if ($p2->{extrainfo}->{subdir} eq $plist->{extrainfo}->{subdir}) {
push(@l2, $candidate);
}