diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2014-11-20 15:08:22 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2014-11-20 15:08:22 +0000 |
commit | 691ac0f8b1a5751379d37941a078b0d67b6babc0 (patch) | |
tree | b22ac3ee001b1887a7be5aac8fb4c1e90b3276b2 /usr.sbin/pkg_add/OpenBSD | |
parent | fe86f637859a12603040aaf13a9fdefe8f45dda5 (diff) |
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.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Delete.pm | 7 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgAdd.pm | 15 |
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}; |