summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-06-25 10:21:42 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-06-25 10:21:42 +0000
commited90b1e67a44bfbd6783fa08f3031f6efd93affa (patch)
treef64471ec2301efc75516f121adf5137d5dba4909 /usr.sbin/pkg_add
parent1bb75ca7999afca095e77980e67e57a069475a04 (diff)
use locator object.
rework options into state
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCreate.pm15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
index 5369b81c7a2..e8384f2f2d8 100644
--- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
+++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgCreate.pm,v 1.15 2010/06/20 08:32:26 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.16 2010/06/25 10:21:41 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -626,11 +626,10 @@ sub create_archive
sub sign_existing_package
{
- my ($self, $pkgname, $cert, $privkey) = @_;
+ my ($self, $repo, $pkgname, $cert, $privkey) = @_;
- require OpenBSD::PackageLocator;
- my $true_package = OpenBSD::PackageLocator->find($pkgname);
+ my $true_package = $repo->find($pkgname);
die "No such package $pkgname" unless $true_package;
my $dir = $true_package->info;
my $plist = OpenBSD::PackingList->fromfile($dir.CONTENTS);
@@ -825,7 +824,8 @@ sub parse_and_run
push(@signature_params, shift);
}
};
- $self->handle_options('p:f:d:M:U:s:A:L:B:P:W:qQ', $state,
+ $state->{no_exports} = 1;
+ $state->handle_options('p:f:d:M:U:s:A:L:B:P:W:qQ',
'[-nQqvx] [-A arches] [-B pkg-destdir] [-D name[=value]]',
'[-L localbase] [-M displayfile] [-P pkg-dependency]',
'[-s x509 -s cert -s priv] [-U undisplayfile] [-W wantedlib]',
@@ -871,8 +871,11 @@ sub parse_and_run
if ($state->not) {
$state->fatal("can't pretend to sign existing packages");
}
+ require OpenBSD::PackageLocator;
+
+ my $repo = OpenBSD::PackageLocator->new($state);
for my $pkgname (@ARGV) {
- $self->sign_existing($pkgname, $cert, $privkey);
+ $self->sign_existing($repo, $pkgname, $cert, $privkey);
}
exit(0);
} else {