diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2012-04-30 11:22:13 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2012-04-30 11:22:13 +0000 |
commit | 3ddae7a5382ca3c38b605afad9991af78d4f9233 (patch) | |
tree | f1a87c435b463cec125faecafaa74b8048d0f3cd /usr.sbin/pkg_add/OpenBSD | |
parent | 43cf84c2dfd7aeacad530db210312e8f50d14950 (diff) |
make the reading of packing-lists amenable to further annotations, such as
those that will be required for update-plist
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index 64abf70f3a2..0dcb8d63dfd 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.60 2012/04/30 11:12:16 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.61 2012/04/30 11:22:12 espie Exp $ # # Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org> # @@ -864,7 +864,7 @@ sub handle_fragment sub read_fragments { - my ($state, $plist, $filename) = @_; + my ($self, $state, $plist, $filename) = @_; my $stack = []; my $subst = $state->{subst}; @@ -888,17 +888,21 @@ sub read_fragments $file = handle_fragment($state, $stack, $file, $not, $frag); } else { - $_ = $subst->do($_); + my $s = $subst->do($_); if ($fast) { - next unless m/^\@(?:cwd|lib|depend|wantlib)\b/o || m/lib.*\.a$/o; + next unless $s =~ m/^\@(?:cwd|lib|depend|wantlib)\b/o || $s =~ m/lib.*\.a$/o; } - &$cont($_); + $self->annotate(&$cont($s), $_, $file); } } } }); } +sub annotate +{ +} + sub add_special_file { my ($subst, $plist, $name, $opt) = @_; @@ -1050,7 +1054,7 @@ sub read_all_fragments $state->usage("Prefix required"); } for my $contentsfile (@{$state->{contents}}) { - read_fragments($state, $plist, $contentsfile) or + $self->read_fragments($state, $plist, $contentsfile) or $state->fatal("can't read packing-list #1", $contentsfile); } } |