summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/PackingList.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-11-10 09:55:44 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-11-10 09:55:44 +0000
commitad6b1c4aa825c9a66c12deeee920594892ee8c84 (patch)
tree1ee226f6aee1ef71c05ebb9cf85b81b90e5f0235 /usr.sbin/pkg_add/OpenBSD/PackingList.pm
parentfb05cc66bb3029e0b7a338b7c9d490a76c5b223f (diff)
use ExtraInfo, finally: allows pkg_info to report packages according to
PKGPATH, e.g., pkg_info -e x11/kde/base3 will tell you which version (if any) of kdebase is installed. Necessary for achieving updates.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/PackingList.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 9532dbd0de7..53e62485447 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.31 2004/11/09 10:30:26 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.32 2004/11/10 09:55:43 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -118,6 +118,20 @@ sub DependOnly
}
}
+sub ExtraInfoOnly
+{
+ my ($fh, $cont) = @_;
+ local $_;
+ while (<$fh>) {
+ # XXX optimization
+ if (m/^\@arch\b/) {
+ return;
+ }
+ next unless m/^\@(?:name\b|comment\s+subdir\=)/;
+ &$cont($_);
+ }
+}
+
sub ConflictOnly
{
my ($fh, $cont) = @_;