summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2014-11-20 15:08:21 +0000
committerespie <espie@openbsd.org>2014-11-20 15:08:21 +0000
commit6e2de058874767f55fb292fd4951a0840bfac4ea (patch)
tree1264e0591c00fbab3c4f97d35fc9434b32bb4725
parentswitch to using crypt_newhash interface. ok deraadt (diff)
downloadwireguard-openbsd-6e2de058874767f55fb292fd4951a0840bfac4ea.tar.xz
wireguard-openbsd-6e2de058874767f55fb292fd4951a0840bfac4ea.zip
big trim-down of MESSAGE/UNMESSAGE: just match checksums between new packages
and old packages. Rationale being you don't need to display UNMESSAGE if the new package has the exact same one. And likewise, you don't need to display MESSAGE if the old package had the exact same one.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm7
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm15
2 files changed, 18 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index ff2bb144867..ef4db3602c0 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.137 2014/05/20 05:55:43 espie Exp $
+# $OpenBSD: Delete.pm,v 1.138 2014/11/20 15:08:21 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -142,7 +142,10 @@ sub delete_plist
manpages_unindex($state);
$state->progress->visit_with_size($plist, 'delete', $state);
if ($plist->has(UNDISPLAY)) {
- $plist->get(UNDISPLAY)->prepare($state);
+ my $d = $plist->get(UNDISPLAY)->{d};
+ if (!$state->{known_displays}{$$d}) {
+ $plist->get(UNDISPLAY)->prepare($state);
+ }
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index 2100c911c20..d6ffc984b71 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
@@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.74 2014/07/30 12:44:26 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.75 2014/11/20 15:08:21 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -736,6 +736,10 @@ sub delete_old_packages
require OpenBSD::Delete;
try {
OpenBSD::Delete::delete_plist($o->plist, $state);
+ if ($o->plist->has(DISPLAY)) {
+ my $d = $o->plist->get(DISPLAY)->{d};
+ $state->{known_displays}{$$d} = 1;
+ }
} catchall {
$state->errsay($_);
$state->fatal(partial_install(
@@ -812,6 +816,10 @@ sub really_add
try {
OpenBSD::Add::perform_extraction($handle,
$state);
+ if ($handle->plist->has(UNDISPLAY)) {
+ my $d = $handle->plist->get(UNDISPLAY)->{d};
+ $state->{known_displays}{$$d} = 1;
+ }
} catchall {
unless ($state->{interrupted}) {
$state->errsay($_);
@@ -864,7 +872,10 @@ sub really_add
delete $handle->{partial};
OpenBSD::PkgCfl::register($handle, $state);
if ($plist->has(DISPLAY)) {
- $plist->get(DISPLAY)->prepare($state);
+ my $d = $plist->get(DISPLAY)->{d};
+ if (!$state->{known_displays}{$$d}) {
+ $plist->get(DISPLAY)->prepare($state);
+ }
}
}
delete $state->{partial};