diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-10-11 14:35:09 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-10-11 14:35:09 +0000 |
commit | 96490bc36bb2e66eef261222453ebe91297212c6 (patch) | |
tree | 10636a8866e5105b2818300162128dd49921b9b6 /usr.sbin | |
parent | 2f220531709bfcce324be894c4a6688b2f09c9de (diff) |
simplify ldconfig now that we run in an uniform way.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 12 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_delete | 14 |
3 files changed, 17 insertions, 13 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index b9e01330f94..8a5711f1588 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.51 2004/10/11 13:46:17 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.52 2004/10/11 14:35:08 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -1084,7 +1084,7 @@ sub run return if $state->{dont_run_scripts}; - main::ensure_ldconfig($verbose) unless $not; + main::ensure_ldconfig($state); print $self->beautify(), " script: $dir$name $pkgname ", join(' ', @args), "\n" if $state->{beverbose}; return if $not; chmod 0755, $dir.$name; diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 4ff72525ecb..fc5895a048d 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.72 2004/10/11 13:46:17 espie Exp $ +# $OpenBSD: pkg_add,v 1.73 2004/10/11 14:35:07 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -36,9 +36,11 @@ our ($ftp_only, $cdrom_only); sub ensure_ldconfig { - my $verbose = shift; + my $state = shift; + return if $state->{not}; return unless defined $OpenBSD::PackingElement::Lib::todo; - VSystem($verbose, @OpenBSD::PackingElement::Lib::ldconfig, "-m", + VSystem($state->{verbose}, + @OpenBSD::PackingElement::Lib::ldconfig, "-m", keys %$OpenBSD::PackingElement::Lib::todo); undef $OpenBSD::PackingElement::Lib::todo; } @@ -291,7 +293,7 @@ sub install { my ($self, $state) = @_; - main::ensure_ldconfig($state->{verbose}) unless $state->{not}; + main::ensure_ldconfig($state); print "exec ", $self->{expanded}, "\n" if $state->{beverbose}; System('/bin/sh', '-c', $self->{expanded}) unless $state->{not}; } @@ -848,7 +850,7 @@ my $dielater = @_; OpenBSD::PackingElement::Fontdir::finish_fontdirs(); manpages_index($state); -ensure_ldconfig($opt_v) unless $opt_n; +ensure_ldconfig($state); if ($state->{beverbose}) { OpenBSD::Vstat::tally(); diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete index e3359386258..e47528e8205 100644 --- a/usr.sbin/pkg_add/pkg_delete +++ b/usr.sbin/pkg_add/pkg_delete @@ -1,6 +1,6 @@ #!/usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_delete,v 1.54 2004/10/11 13:46:17 espie Exp $ +# $OpenBSD: pkg_delete,v 1.55 2004/10/11 14:35:08 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -33,9 +33,11 @@ our %forced = (); sub ensure_ldconfig { - my $verbose = shift; + my $state = shift; + return if $state->{not}; return unless defined $OpenBSD::PackingElement::Lib::todo; - VSystem($verbose, @OpenBSD::PackingElement::Lib::ldconfig, "-R"); + VSystem($state->{verbose}, + @OpenBSD::PackingElement::Lib::ldconfig, "-R"); undef $OpenBSD::PackingElement::Lib::todo; } @@ -212,7 +214,7 @@ sub delete { my ($self, $state) = @_; my $cmd = $self->{expanded}; - main::ensure_ldconfig($state->{verbose}) unless $state->{not}; + main::ensure_ldconfig($state); if ($state->{beverbose}) { print "unexec: $cmd\n"; } @@ -427,7 +429,7 @@ sub delete return unless $state->{extra}; my $cmd = $self->{expanded}; - main::ensure_ldconfig($state->{verbose}) unless $state->{not}; + main::ensure_ldconfig($state); if ($state->{beverbose}) { print "unexec: $cmd\n"; } @@ -724,7 +726,7 @@ eval { my $dielater = $@; -ensure_ldconfig($opt_v) unless $opt_n; +ensure_ldconfig($state); # delayed directory/user/group removal cleanup_shared_items($state); OpenBSD::PackingElement::Fontdir::finish_fontdirs(); |