summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2003-11-06 17:46:36 +0000
committerMarc Espie <espie@cvs.openbsd.org>2003-11-06 17:46:36 +0000
commitf30147c92ec7b071ccdc1606f9e0036335d8b58f (patch)
tree92803d37b5eb4b7abf09a1eb4c1d481a59727c21 /usr.sbin
parent8ab7cc48ea627dcec343cc56e56d74d247ef466e (diff)
Implement discovery of a `packing-list' prefix, e.g., the first @cwd
present in the packing-list (necessary for libdepends checking).
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm5
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm8
2 files changed, 11 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 154d0f2cd8e..f45af6b2ab1 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: PackingElement.pm,v 1.2 2003/10/31 17:43:20 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.3 2003/11/06 17:46:35 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -408,6 +408,9 @@ sub destate
{
my ($self, $state) = @_;
$state->{cwd} = $self->{name};
+ if (!defined $state->{prefix}) {
+ $state->{prefix} = $state->{cwd};
+ }
}
package OpenBSD::PackingElement::Owner;
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index 28b4e10851c..c05e5936ac5 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingList.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: PackingList.pm,v 1.2 2003/10/19 18:42:55 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.3 2003/11/06 17:46:35 espie Exp $
#
# Copyright (c) 2003 Marc Espie.
#
@@ -146,6 +146,12 @@ sub pkgname($)
return $self->{name}->{name};
}
+sub prefix($)
+{
+ my $self = shift;
+ return $self->{state}->{prefix};
+}
+
# allows the autoloader to work correctly
sub DESTROY
{