diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2018-04-28 10:10:03 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2018-04-28 10:10:03 +0000 |
commit | ed5beaccd288a33c8eb718e1b0bb02d0222da455 (patch) | |
tree | a0161095e2cf9bcc6585be5d0fb140e6b11badc7 /usr.sbin/pkg_add | |
parent | 1f154140241545326c8633c393dbdb056034cc86 (diff) |
update-plist wants to ask the ports tree as well, so refactor so that
it can reused that code
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index 8e835fc722d..d8feb775d59 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.134 2018/04/28 09:49:20 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.135 2018/04/28 10:10:02 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # @@ -880,7 +880,7 @@ sub to_cache sub ask_tree { - my ($self, $state, $dep, $portsdir, @action) = @_; + my ($self, $state, $pkgpath, $portsdir, $data, @action) = @_; my $make = OpenBSD::Paths->make; my $pid = open(my $fh, "-|"); @@ -893,15 +893,14 @@ sub ask_tree $ENV{FULLPATH} = 'Yes'; delete $ENV{FLAVOR}; delete $ENV{SUBPACKAGE}; - $ENV{SUBDIR} = $dep->{pkgpath}; + $ENV{SUBDIR} = $pkgpath; $ENV{ECHO_MSG} = ':'; # XXX we're already running as ${BUILD_USER} # so we can't do this again push(@action, 'PORTS_PRIVSEP=No'); exec $make ('make', @action); } - my $plist = OpenBSD::PackingList->read($fh, - \&OpenBSD::PackingList::PrelinkStuffOnly); + my $plist = OpenBSD::PackingList->read($fh, $data); close($fh); return $plist; } @@ -916,7 +915,8 @@ sub really_solve_from_ports if (defined $diskcache && -f $diskcache) { $plist = OpenBSD::PackingList->fromfile($diskcache); } else { - $plist = $self->ask_tree($state, $dep, $portsdir, + $plist = $self->ask_tree($state, $dep->{pkgpath}, $portsdir, + \&OpenBSD::PackingList::PrelinkStuffOnly, 'print-plist-libs-with-depends', 'wantlib_args=no-wantlib-args'); if ($? != 0 || !defined $plist->pkgname) { |