diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2016-10-03 14:15:56 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2016-10-03 14:15:56 +0000 |
commit | 9f7fa16188105c48a7e3354cf599bb2566c69f8c (patch) | |
tree | 6c7732b119ed334b82b3bb144e955ab9a3863af7 /usr.sbin/pkg_add/OpenBSD | |
parent | 4b247cb731dfeaf26455fdd9e588508c70aa18af (diff) |
add TRUSTED_PKG_PATH after discussing with aja@
use case is testing binary packages among developers, -Dunsigned means
everything is unsigned, which is bad for dependencies
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageLocator.pm | 17 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackageRepository.pm | 5 |
2 files changed, 19 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm index 81b4d416113..2e3fd53b62b 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageLocator.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageLocator.pm,v 1.105 2016/01/30 11:29:29 espie Exp $ +# $OpenBSD: PackageLocator.pm,v 1.106 2016/10/03 14:15:55 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -30,6 +30,18 @@ sub build_default_path my ($self, $state) = @_; $default_path = OpenBSD::PackageRepositoryList->new($state); + my $path_set = 0; + + if (defined $ENV{TRUSTED_PKG_PATH}) { + my $v = $ENV{TRUSTED_PKG_PATH}; + $v =~ s/^\:+//o; + $v =~ s/\:+$//o; + while (my $o = OpenBSD::PackageRepository->parse(\$v, $state)) { + $o->{trusted} = 1; + $default_path->add($o); + } + $path_set = 1; + } if (defined $ENV{PKG_PATH}) { my $v = $ENV{PKG_PATH}; $v =~ s/^\:+//o; @@ -37,8 +49,9 @@ sub build_default_path while (my $o = OpenBSD::PackageRepository->parse(\$v, $state)) { $default_path->add($o); } - return; + $path_set = 1; } + return if $path_set; $default_path->add(OpenBSD::PackageRepository->new("./", $state)->can_be_empty); return if $state->defines('NOINSTALLPATH'); diff --git a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm index 39d06f6de4c..4e85fdadc35 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackageRepository.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackageRepository.pm,v 1.135 2016/09/15 12:53:08 espie Exp $ +# $OpenBSD: PackageRepository.pm,v 1.136 2016/10/03 14:15:55 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -398,6 +398,9 @@ sub signify_pipe sub check_signed { my ($self, $object) = @_; + if ($object->{repository}{trusted}) { + return 0; + } if ($self->{state}{signature_style} eq 'new') { $object->{is_signed} = 1; return 1; |