diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2012-04-30 10:43:52 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2012-04-30 10:43:52 +0000 |
commit | f085aadfefeab21bb0ee5aa1c39f391a7729f21f (patch) | |
tree | 24d0c7dc8b5bf261fdb66322a2333416b6f4e42d /usr.sbin | |
parent | 133e4b55cfc6010b01fc5167edf77a93f02f54b7 (diff) |
more refactor
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index 17d7329e198..122bdeb3a47 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.58 2012/04/30 10:32:12 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.59 2012/04/30 10:43:51 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -103,6 +103,16 @@ sub handle_options '[-L localbase] [-M displayfile] [-P pkg-dependency]', '[-s x509 -s cert -s priv] [-U undisplayfile] [-W wantedlib]', '-d desc -D COMMENT=value -f packinglist -p prefix pkg-name'); + + my $base = '/'; + if (defined $state->opt('B')) { + $base = $state->opt('B'); + } elsif (defined $ENV{'PKG_PREFIX'}) { + $base = $ENV{'PKG_PREFIX'}; + } + + $state->{base} = $base; + } package OpenBSD::PkgCreate; @@ -1229,15 +1239,6 @@ sub parse_and_run } - my $base = '/'; - if (defined $state->opt('B')) { - $base = $state->opt('B'); - } elsif (defined $ENV{'PKG_PREFIX'}) { - $base = $ENV{'PKG_PREFIX'}; - } - - $state->{base} = $base; - $plist->discover_directories($state); unless (defined $state->opt('q') && defined $state->opt('n')) { $state->set_status("checking dependencies"); |