summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-11-13 11:39:41 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-11-13 11:39:41 +0000
commitc653ebfbb06a735a5a647944357f87313acff6ef (patch)
tree10533d4319261b6e8078da03a4469d7b704f1081 /usr.sbin/pkg_add/OpenBSD
parent36ac7b5cf3b1bd6d33b89256c4af57daddbf5d6c (diff)
cwd() function so that further changes to internal storage won't matter
that much.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm6
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm11
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingList.pm6
3 files changed, 14 insertions, 9 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 393b1a371c8..9392dbd8f2f 100644
--- a/usr.sbin/pkg_add/OpenBSD/Add.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Add.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.16 2004/11/13 10:47:21 espie Exp $
+# $OpenBSD: Add.pm,v 1.17 2004/11/13 11:39:40 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -329,7 +329,7 @@ sub prepare_to_extract
}
my $linkname = $file->{linkname};
if (defined $self->{cwd}) {
- $linkname = $self->{cwd}.'/'.$linkname;
+ $linkname = $self->cwd().'/'.$linkname;
}
if ($self->{link} ne $linkname) {
Fatal "Error: archive hl does not match ", $linkname, "!=",
@@ -338,7 +338,7 @@ sub prepare_to_extract
}
$file->{name} = $fullname;
- $file->{cwd} = $self->{cwd};
+ $file->{cwd} = $self->cwd();
$file->{destdir} = $destdir;
# faked installation are VERY weird
if (defined $self->{symlink} && $state->{do_faked}) {
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 4c580d232ba..4a23f816f6e 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackingElement.pm,v 1.68 2004/11/12 23:26:41 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.69 2004/11/13 11:39:40 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -150,6 +150,11 @@ sub new { die "Can't create annotation objects" }
package OpenBSD::PackingElement::Object;
our @ISA=qw(OpenBSD::PackingElement);
+sub cwd
+{
+ return ${$_[0]->{cwd}};
+}
+
sub compute_fullname
{
my ($self, $state, $absolute_okay) = @_;
@@ -167,8 +172,8 @@ sub fullname($)
{
my $self = $_[0];
my $fullname = $self->{name};
- if ($fullname !~ m|^/| && ${$self->{cwd}} ne '.') {
- $fullname = ${$self->{cwd}}."/".$fullname;
+ if ($fullname !~ m|^/| && $self->cwd() ne '.') {
+ $fullname = $self->cwd()."/".$fullname;
}
return $fullname;
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingList.pm b/usr.sbin/pkg_add/OpenBSD/PackingList.pm
index b144a3c9e9c..a8d004e47dc 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.35 2004/11/12 23:26:41 espie Exp $
+# $OpenBSD: PackingList.pm,v 1.36 2004/11/13 11:39:40 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -22,15 +22,15 @@ package OpenBSD::PackingList;
use OpenBSD::PackingElement;
use OpenBSD::PackageInfo;
+my $dot = '.';
sub new
{
my $class = shift;
- my $o = '.';
bless {state =>
{default_owner=>'root',
default_group=>'bin',
default_mode=> 0444,
- cwd=>\$o} }, $class;
+ cwd=>\$dot} }, $class;
}
sub read