summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2011-06-25 11:10:12 +0000
committerMarc Espie <espie@cvs.openbsd.org>2011-06-25 11:10:12 +0000
commitcba015a1797ab38d943bddf22b540c3a3f769d32 (patch)
tree4be09b31d6ef23601b31b218f108bd86e246dcdc /usr.sbin/pkg_add/OpenBSD
parent58edb393d22b65a7dbf37013f0b307ed81aa8b96 (diff)
even with tied files, still arrange to apply set_modes.
issue noted by halex@
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Replace.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Replace.pm b/usr.sbin/pkg_add/OpenBSD/Replace.pm
index 3b8d27a2a87..55aa46e76b0 100644
--- a/usr.sbin/pkg_add/OpenBSD/Replace.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Replace.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Replace.pm,v 1.81 2011/06/20 09:46:23 espie Exp $
+# $OpenBSD: Replace.pm,v 1.82 2011/06/25 11:10:11 espie Exp $
#
# Copyright (c) 2004-2010 Marc Espie <espie@openbsd.org>
#
@@ -75,6 +75,11 @@ sub extract
}
my ($fh, $tempname) = OpenBSD::Temp::permanent_file($d, "pkg");
$self->{tempname} = $tempname;
+
+ # XXX don't apply destdir twice
+ $file->{destdir} = '';
+ $file->set_name($tempname);
+
if ($self->{tieto}) {
my $src = $self->{tieto}->realname($state);
unlink($tempname);
@@ -82,6 +87,8 @@ sub extract
if $state->verbose >= 3;
if (link($src, $tempname) ||
$state->copy_file($src, $tempname)) {
+ # we still need to adjust properties
+ $file->set_modes;
$state->{archive}->skip;
return;
}
@@ -91,9 +98,6 @@ sub extract
$state->say("extracting #1", $tempname) if $state->verbose >= 3;
- # XXX don't apply destdir twice
- $file->{destdir} = '';
- $file->set_name($tempname);
$file->create;
$self->may_check_digest($file, $state);
}