summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Add.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-16 14:42:19 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-16 14:42:19 +0000
commite1af5a0f736b329a05da47f95370d0f2d7421f03 (patch)
tree37d956d49c2d7bd4de7f4cec54a528f84a163407 /usr.sbin/pkg_add/OpenBSD/Add.pm
parentd9c6826637e56e7598b639022b391767a841c767 (diff)
create a pseudo vstat object inside state, so that we can modify Vstat
interface very locally... model hints objects like Locations, to uniformize further treatment.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Add.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index a2edd2951a9..bab630d2ada 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.96 2009/11/11 13:00:40 espie Exp $
+# $OpenBSD: Add.pm,v 1.97 2009/11/16 14:42:18 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -359,12 +359,12 @@ sub prepare_for_addition
my ($self, $state, $pkgname) = @_;
my $fname = $state->{destdir}.$self->fullname;
# check for collisions with existing stuff
- if (OpenBSD::Vstat::vexists($fname)) {
+ if ($state->vstat->exists($fname)) {
push(@{$state->{colliding}}, $self);
$state->{problems}++;
return;
}
- my $s = OpenBSD::Vstat::add($fname, $self->{size}, \$pkgname);
+ my $s = $state->vstat->add($fname, $self->{size}, \$pkgname);
return unless defined $s;
if ($s->{ro}) {
$s->report_ro($state, $fname);
@@ -479,11 +479,11 @@ sub prepare_for_addition
}
my $fname = $state->{destdir}.$self->fullname;
# If file already exists, we won't change it
- if (OpenBSD::Vstat::vexists($fname)) {
+ if ($state->vstat->exists($fname)) {
return;
}
my $size = $self->{copyfrom}->{size};
- my $s = OpenBSD::Vstat::add($fname, $size, \$pkgname);
+ my $s = $state->vstat->add($fname, $size, \$pkgname);
return unless defined $s;
if ($s->{ro}) {
$s->report_ro($state, $fname);
@@ -662,12 +662,12 @@ sub prepare_for_addition
$size = (stat $cname)[7];
}
if ($self->exec_on_add) {
- my $s2 = OpenBSD::Vstat::filestat($cname);
+ my $s2 = $state->vstat->stat($cname);
if (defined $s2 && $s2->{noexec}) {
$s2->report_noexec($state, $cname);
}
}
- my $s = OpenBSD::Vstat::add($fname, $self->{size}, \$pkgname);
+ my $s = $state->vstat->add($fname, $self->{size}, \$pkgname);
return unless defined $s;
if ($s->{ro}) {
$s->report_ro($state, $fname);