diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2009-11-11 13:00:41 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2009-11-11 13:00:41 +0000 |
commit | 422268542ca88652293dd2ac18b11f2cf469142d (patch) | |
tree | 1d32de192b76e8393747adcaf755821207416eb0 /usr.sbin | |
parent | 88f15ea5bcc548441e3b1f24c3b74e85c821d54d (diff) |
vsystem, system, unlink can mostly go through state, and do the ->clear part
as well.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Add.pm | 11 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/CollisionReport.pm | 7 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Delete.pm | 5 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedItems.pm | 6 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/SharedLibs.pm | 5 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/UpdateSet.pm | 23 |
7 files changed, 38 insertions, 23 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index 6ee8ac27a45..a2edd2951a9 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.95 2009/11/11 12:32:03 espie Exp $ +# $OpenBSD: Add.pm,v 1.96 2009/11/11 13:00:40 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -285,7 +285,7 @@ sub install my $l=[]; push(@$l, "-v") if $state->{very_verbose}; $self->build_args($l); - VSystem($state->{very_verbose}, $self->command,, @$l, $auth); + $state->vsystem($self->command,, @$l, $auth); } package OpenBSD::PackingElement::NewUser; @@ -338,9 +338,7 @@ sub install $state->say("sysctl -w $name != ". $self->{value}); return; } - VSystem($state->{very_verbose}, - OpenBSD::Paths->sysctl, - $name.'='.$self->{value}); + $state->vsystem(OpenBSD::Paths->sysctl, $name.'='.$self->{value}); } package OpenBSD::PackingElement::DirBase; @@ -569,8 +567,7 @@ sub install $self->SUPER::install($state); return if $state->{not}; my $fullname = $state->{destdir}.$self->fullname; - VSystem($state->{very_verbose}, - OpenBSD::Paths->install_info, + $state->vsystem(OpenBSD::Paths->install_info, "--info-dir=".dirname($fullname), $fullname); } diff --git a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm index 45d80da0086..7d8db5b02c1 100644 --- a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm +++ b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: CollisionReport.pm,v 1.21 2009/11/11 12:04:19 espie Exp $ +# $OpenBSD: CollisionReport.pm,v 1.22 2009/11/11 13:00:40 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -65,7 +65,7 @@ sub collision_report($$) if ($state->{defines}->{removecollisions}) { require OpenBSD::Error; for my $f (@$list) { - OpenBSD::Error::Unlink(1, $f->fullname); + $state->unlink(1, $f->fullname); } return; } @@ -132,10 +132,9 @@ sub collision_report($$) } } if ($dorepair == 1) { - require OpenBSD::Error; for my $f (@$list) { - if (OpenBSD::Error::Unlink($state->{verbose}, + if ($state->unlink($state->{verbose}, $f->fullname)) { $state->{problems}--; } else { diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index bd3fe82e65a..64ac8838d55 100644 --- a/usr.sbin/pkg_add/OpenBSD/Delete.pm +++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Delete.pm,v 1.86 2009/11/11 12:21:20 espie Exp $ +# $OpenBSD: Delete.pm,v 1.87 2009/11/11 13:00:40 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -559,8 +559,7 @@ sub delete my ($self, $state) = @_; unless ($state->{not}) { my $fullname = $state->{destdir}.$self->fullname; - VSystem($state->{very_verbose}, - OpenBSD::Paths->install_info, + $state->vsystem(OpenBSD::Paths->install_info, "--delete", "--info-dir=".dirname($fullname), $fullname); } $self->SUPER::delete($state); diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 75831c827cf..da1141c1862 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.162 2009/11/11 12:47:13 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.163 2009/11/11 13:00:40 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org> # @@ -1363,7 +1363,7 @@ sub run_if_exists require OpenBSD::Error; if (-x $cmd) { - OpenBSD::Error::VSystem($state->{very_verbose}, $cmd, @l); + $state->vsystem($cmd, @l); } else { $state->errsay("$cmd not found"); } diff --git a/usr.sbin/pkg_add/OpenBSD/SharedItems.pm b/usr.sbin/pkg_add/OpenBSD/SharedItems.pm index 51e9234b0a3..b1ec0be7eab 100644 --- a/usr.sbin/pkg_add/OpenBSD/SharedItems.pm +++ b/usr.sbin/pkg_add/OpenBSD/SharedItems.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: SharedItems.pm,v 1.15 2009/11/11 11:13:16 espie Exp $ +# $OpenBSD: SharedItems.pm,v 1.16 2009/11/11 13:00:40 espie Exp $ # # Copyright (c) 2004-2006 Marc Espie <espie@openbsd.org> # @@ -88,7 +88,7 @@ sub cleanup $state->progress->show($done, $total); next if $remaining->{users}->{$user}; if ($state->{extra}) { - System(OpenBSD::Paths->userdel, $user); + $state->system(OpenBSD::Paths->userdel, $user); } else { $state->log->set_context($pkgname); $state->log("You should also run /usr/sbin/userdel $user\n"); @@ -101,7 +101,7 @@ sub cleanup $state->progress->show($done, $total); next if $remaining->{groups}->{$group}; if ($state->{extra}) { - System(OpenBSD::Paths->groupdel, $group); + $state->system(OpenBSD::Paths->groupdel, $group); } else { $state->log->set_context($pkgname); $state->log("You should also run /usr/sbin/groupdel $group\n"); diff --git a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm index bd7e73098f1..1072d1230ee 100644 --- a/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm +++ b/usr.sbin/pkg_add/OpenBSD/SharedLibs.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: SharedLibs.pm,v 1.33 2009/11/10 11:36:56 espie Exp $ +# $OpenBSD: SharedLibs.pm,v 1.34 2009/11/11 13:00:40 espie Exp $ # # Copyright (c) 2003-2005 Marc Espie <espie@openbsd.org> # @@ -80,8 +80,7 @@ sub mark_ldconfig_directory sub ensure_ldconfig { my $state = shift; - VSystem($state->{very_verbose}, - @ldconfig, "-R") unless $state->{not}; + $state->vsystem(@ldconfig, "-R") unless $state->{not}; $OpenBSD::PackingElement::Lib::todo = 0; } diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm index 4711f3ee9a4..52a40a3b57a 100644 --- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm +++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: UpdateSet.pm,v 1.22 2009/11/11 12:47:13 espie Exp $ +# $OpenBSD: UpdateSet.pm,v 1.23 2009/11/11 13:00:40 espie Exp $ # # Copyright (c) 2007 Marc Espie <espie@openbsd.org> # @@ -118,6 +118,27 @@ sub progress return $self->{progressmeter}; } +sub vsystem +{ + my $self = shift; + $self->progress->clear; + OpenBSD::Error::VSystem($self->{very_verbose}, @_); +} + +sub system +{ + my $self = shift; + $self->progress->clear; + OpenBSD::Error::System(@_); +} + +sub unlink +{ + my $self = shift; + $self->progress->clear; + OpenBSD::Error::Unlink(@_); +} + # we always have a progressmeter we can print to... sub setup_progressmeter { |