summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2011-10-21 18:19:35 +0000
committerMarc Espie <espie@cvs.openbsd.org>2011-10-21 18:19:35 +0000
commitfc4d430f441aa9226209cfa2ee23e719b827e29e (patch)
tree6ce2fc17a27cdcb5914f5b001ec06122b3bf64fd /usr.sbin/pkg_add
parenta869f06457eb2f5eb2dffa0e294d6b41ce048acd (diff)
small optimization: tell pkg_create to skip !libs if LIBS_ONLY (to be
used in make print-plist-libs)
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCreate.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
index 288a23fa634..4a855f297c4 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.49 2011/09/25 08:26:28 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.50 2011/10/21 18:19:34 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -784,6 +784,7 @@ sub read_fragments
my $stack = [];
my $subst = $state->{subst};
push(@$stack, MyFile->new($filename));
+ my $fast = $subst->value("LIBS_ONLY");
return $plist->read($stack,
sub {
@@ -802,12 +803,15 @@ sub read_fragments
$file = handle_fragment($state, $stack,
$file, $not, $frag);
} else {
- &$cont($subst->do($_));
+ $_ = $subst->do($_);
+ if ($fast) {
+ next unless m/^\@(?:cwd|lib)\b/o || m/lib.*\.a$/o;
+ }
+ &$cont($_);
}
}
}
- }
- );
+ });
}
sub add_special_file