summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-11-01 19:21:59 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-11-01 19:21:59 +0000
commit45b5e4bf3cdac141756ac174cab5d47fc8a1c694 (patch)
tree336a46b77977ad134b5fd604134d8ecef353b04d
parent8982f8319f8d27310994d7f1bc36431134bc1033 (diff)
pkg_add may need to clean up shared items now that it can delete old stuff.
let very verbose mode show moving files around.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm3
-rw-r--r--usr.sbin/pkg_add/pkg_add9
2 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 8ebbf2759eb..005526587f2 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.4 2004/11/01 15:45:02 espie Exp $
+# $OpenBSD: Add.pm,v 1.5 2004/11/01 19:21:58 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -170,6 +170,7 @@ sub install
symlink($self->{symlink}, $destdir.$fullname);
} else {
rename($self->{tempname}, $destdir.$fullname);
+ print "moving ", $self->{tempname}, " -> $destdir$fullname\n" if $state->{very_verbose};
}
} else {
my $file = $self->prepare_to_extract($state);
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index f5d00e15acc..a202e8543a6 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.90 2004/11/01 19:14:26 espie Exp $
+# $OpenBSD: pkg_add,v 1.91 2004/11/01 19:21:58 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -673,6 +673,13 @@ my $dielater = $@;
OpenBSD::PackingElement::Fontdir::finish_fontdirs();
manpages_index($state);
OpenBSD::PackingElement::Lib::ensure_ldconfig($state);
+# delayed directory/user/group removal
+if (defined $state->{dirs_to_rm} or defined $state->{users_to_rm} or
+ defined $state->{groups_to_rm}) {
+ require OpenBSD::SharedItems;
+
+ OpenBSD::SharedItems::cleanup($state);
+}
if ($state->{beverbose}) {
OpenBSD::Vstat::tally();