From d44c14ad44b6e6c306c66148cc42e7132b8ad945 Mon Sep 17 00:00:00 2001 From: espie Date: Fri, 17 Jan 2014 15:54:06 +0000 Subject: [PATCH] do check_digest per plist. show UNSIGNED packages unconditionally. --- usr.sbin/pkg_add/OpenBSD/Add.pm | 3 ++- usr.sbin/pkg_add/OpenBSD/PkgAdd.pm | 17 +++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index b4c6d7bfde8..e73feff8bea 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.142 2014/01/11 11:54:43 espie Exp $ +# $OpenBSD: Add.pm,v 1.143 2014/01/17 15:54:06 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -113,6 +113,7 @@ sub perform_extraction $handle->{partial} = {}; $state->{partial} = $handle->{partial}; $state->{archive} = $handle->{location}; + $state->{check_digest} = $handle->{plist}{check_digest}; $state->progress->visit_with_size($handle->{plist}, 'extract', $state); } diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm index 662fc69ac11..c44737bd983 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.45 2014/01/11 11:54:43 espie Exp $ +# $OpenBSD: PkgAdd.pm,v 1.46 2014/01/17 15:54:06 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -647,7 +647,6 @@ sub iterate sub check_digital_signature { my ($set, $state) = @_; - $state->{check_digest} //= 0; for my $handle ($set->newer) { $state->set_name_from_handle($handle, '+'); my $plist = $handle->plist; @@ -660,7 +659,7 @@ sub check_digital_signature $state->fatal("#1 is corrupted", $plist->pkgname); } - $state->{check_digest} = 1; + $plist->{check_digest} = 1; $state->{packages_with_sig}++; } } else { @@ -1071,16 +1070,10 @@ sub finish_display my ($self, $state) = @_; OpenBSD::Add::manpages_index($state); - # and display delayed thingies. - if ($state->{packages_with_sig}) { - $state->print("Packages with signatures: #1", - $state->{packages_with_sig}); - if ($state->{packages_without_sig}) { - print ". UNSIGNED PACKAGES: ", - join(', ', keys %{$state->{packages_without_sig}}); - } - print "\n"; + if ($state->{packages_without_sig}) { + print "UNSIGNED PACKAGES: ", + join(', ', keys %{$state->{packages_without_sig}}), "\n"; } if (defined $state->{updatedepends} && %{$state->{updatedepends}}) { print "Forced updates, bogus dependencies for ", -- 2.20.1