summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-12-21 18:12:07 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-12-21 18:12:07 +0000
commit3ca015202bed6579b65d3f315fd9cb2a2437da45 (patch)
tree6d89bd41df956c3f7f8c01ecb84e9cfefc956998
parent66c70c926b78caa8bed761baac88c10e22b66536 (diff)
fix nasty cache-out-of-sync bug.
Now, update with the same package name works again.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm5
-rw-r--r--usr.sbin/pkg_add/OpenBSD/RequiredBy.pm12
2 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 9a42a1c4736..8ba03dfb0e7 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.18 2004/12/20 12:16:51 espie Exp $
+# $OpenBSD: Delete.pm,v 1.19 2004/12/21 18:12:05 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -21,6 +21,7 @@ package OpenBSD::Delete;
use OpenBSD::Error;
use OpenBSD::Vstat;
use OpenBSD::PackageInfo;
+use OpenBSD::RequiredBy;
sub manpages_unindex
{
@@ -72,6 +73,8 @@ sub remove_packing_info
for my $fname (info_names()) {
unlink($dir.$fname);
}
+ OpenBSD::RequiredBy->erase($dir);
+ OpenBSD::Requiring->erase($dir);
rmdir($dir) or Fatal "Can't finish removing directory $dir: $!";
}
diff --git a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
index 3894bf2fcac..3c4c3b72d2c 100644
--- a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
+++ b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: RequiredBy.pm,v 1.8 2004/12/21 02:12:51 espie Exp $
+# $OpenBSD: RequiredBy.pm,v 1.9 2004/12/21 18:12:06 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -120,6 +120,16 @@ sub new
return $cache->{$f};
}
+sub erase
+{
+ my ($class, $dir) = @_;
+ my $f = $dir.$class->filename();
+ if (exists $cache->{$f}) {
+ $cache->{$f}->{entries} = {};
+ $cache->{$f}->{nonempty} = 0;
+ }
+}
+
package OpenBSD::RequiredBy;
our @ISA=qw(OpenBSD::RequirementList);
use OpenBSD::PackageInfo;