OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 30-Dec-2002 22:33:49
Branch: HEAD Handle: 2002123021334900
Modified files:
openpkg-src/openpkg-tool
openpkg-index.pl
Log:
fix also indexing in new %options world
Summary:
Revision Changes Path
1.3 +9 -11 openpkg-src/openpkg-tool/openpkg-index.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg-tool/openpkg-index.pl
============================================================================
$ cvs diff -u -r1.2 -r1.3 openpkg-index.pl
--- openpkg-src/openpkg-tool/openpkg-index.pl 27 Nov 2002 07:45:36 -0000 1.2
+++ openpkg-src/openpkg-tool/openpkg-index.pl 30 Dec 2002 21:33:49 -0000 1.3
@@ -126,15 +126,12 @@
#
# deduce external variables from description
#
-sub find_options ($) {
- my($descr) = @_;
- my(%evar);
-
- %evar = map {
- $1 => '%{'.$1.'}'
- } $descr =~ /--define\s*'(\S+)\s*\%\{\1\}'/;
-
- return \%evar;
+sub find_options ($$) {
+ my($spec, $descr) = @_;
+ my $evar = {};
+ $descr =~ s/--define\s*'(\S+)\s*\%\{\1\}'/$evar->{$1} = '%{'.$1.'}', ''/sge; #
before openpkg-20021230
+ $spec =~ s/^%option\s*(\S+)\s+\S+/$evar->{$1} = '%{'.$1.'}', ''/mge; #
after openpkg-20021230
+ return $evar;
}
#
@@ -292,12 +289,13 @@
my($s) = @_;
my(%map);
my($a,$o);
+ my $spec = $s;
# remove comments
$s =~ s/^\s*#.*?\n//mg;
# map commands
- $s =~ s/^%(ifdef|ifndef|if|define|else|endif|\{)/#$1/mg;
+ $s =~ s/^%(ifdef|ifndef|if|option|define|else|endif|\{)/#$1/mg;
# split sections
foreach (split(/^(?=%\w+\s*\n)/m, $s)) {
@@ -308,7 +306,7 @@
}
}
- $o = find_options($map{'description'});
+ $o = find_options($spec, $map{'description'});
$a = package2data($map{'*'}, $o);
if (exists $map{'description'}) {
$a->{'Description'} = { '' => [ $map{'description'} ] };
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]