summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Ustar.pm19
1 files changed, 13 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Ustar.pm b/usr.sbin/pkg_add/OpenBSD/Ustar.pm
index 989a05f3a93..6f3d1bc8c38 100644
--- a/usr.sbin/pkg_add/OpenBSD/Ustar.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Ustar.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Ustar.pm,v 1.28 2005/06/21 17:52:49 espie Exp $
+# $OpenBSD: Ustar.pm,v 1.29 2005/06/26 15:39:19 espie Exp $
#
# Copyright (c) 2002-2004 Marc Espie <espie@openbsd.org>
#
@@ -325,6 +325,16 @@ sub write
}
}
+sub alias
+{
+ my ($self, $arc, $alias) = @_;
+
+ my $k = $self->{archive}.":".$self->{archive}->{cachename};
+ if (!defined $arc->{key}->{$k}) {
+ $arc->{key}->{$k} = $alias;
+ }
+}
+
sub write_contents
{
# only files have anything to write
@@ -395,7 +405,7 @@ sub resolve_links
if (defined $arc->{key}->{$k}) {
$self->{linkname} = $arc->{key}->{$k};
} else {
- die "Can't copy link over: original NOT available\n";
+ die "Can't copy link over: original for $k NOT available\n";
}
}
@@ -565,10 +575,7 @@ sub copy_contents
if ($size % 512) {
print $out "\0" x (512 - $size % 512);
}
- my $k = $self->{archive}.":".$self->{archive}->{cachename};
- if (!defined $arc->{key}->{$k}) {
- $arc->{key}->{$k} = $self->{name};
- }
+ $self->alias($arc, $self->{name});
}
sub isFile() { 1 }