summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2014-07-10 21:12:33 +0000
committerespie <espie@openbsd.org>2014-07-10 21:12:33 +0000
commit30ab2e43f141c7a18a9e9556aa15c8b8ea83c4f4 (patch)
treeaafd0da4a5d9c2692ffb7a3b726ea09944933f57
parentDo not set the bus dying flag during DVACT_DEACTIVATE otherwise the (diff)
downloadwireguard-openbsd-30ab2e43f141c7a18a9e9556aa15c8b8ea83c4f4.tar.xz
wireguard-openbsd-30ab2e43f141c7a18a9e9556aa15c8b8ea83c4f4.zip
make quirks slightly more special, grab the whole packing-list always,
and display the timestamp from the signature if we were signed.
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackageLocation.pm5
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgAdd.pm22
2 files changed, 25 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
index 51ea7bc1e3f..593615cf15f 100644
--- a/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PackageLocation.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: PackageLocation.pm,v 1.43 2014/07/08 17:02:56 espie Exp $
+# $OpenBSD: PackageLocation.pm,v 1.44 2014/07/10 21:12:33 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -56,6 +56,9 @@ OpenBSD::Auto::cache(pkgname,
OpenBSD::Auto::cache(update_info,
sub {
my $self = shift;
+ if ($self->name =~ /^quirks\-/) {
+ return $self->plist;
+ }
return $self->plist(\&OpenBSD::PackingList::UpdateInfoOnly,
sub {
return 0 if $_[0] =~ m/^\@option\s+always-update\b/m;
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm
index 61a889b1a48..8c022f8b964 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.67 2014/06/16 08:56:48 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.68 2014/07/10 21:12:33 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -277,6 +277,23 @@ sub setup_header
}
}
+sub display_timestamp
+{
+ my ($pkgname, $plist, $state) = @_;
+
+ return unless $plist->is_signed;
+ if ($state->defines('nosig')) {
+ $state->errsay("NOT CHECKING DIGITAL SIGNATURE FOR #1",
+ $pkgname);
+ return;
+ }
+ if (!$plist->check_signature($state)) {
+ $state->fatal("#1 is corrupted", $pkgname);
+ }
+ $state->say("#1 signed on #2", $pkgname,
+ $plist->get('digital-signature')->iso8601);
+}
+
sub find_kept_handle
{
my ($set, $n, $state) = @_;
@@ -286,6 +303,9 @@ sub find_kept_handle
my $plist = $n->dependency_info;
return if !defined $plist;
my $pkgname = $plist->pkgname;
+ if ($set->{quirks}) {
+ display_timestamp($pkgname, $plist, $state);
+ }
# condition for no update
unless (is_installed($pkgname) &&
(!$state->{allow_replacing} ||