OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Michael van Elst
Root: /e/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 15-Jan-2003 15:54:17
Branch: HEAD Handle: 2003011514541700
Modified files:
openpkg-src/openpkg-tool
openpkg-build.pl
Log:
better enforce zero-semantics, simple text parser now reads option
defaults
Summary:
Revision Changes Path
1.37 +18 -9 openpkg-src/openpkg-tool/openpkg-build.pl
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/openpkg-tool/openpkg-build.pl
============================================================================
$ cvs diff -u -r1.36 -r1.37 openpkg-build.pl
--- openpkg-src/openpkg-tool/openpkg-build.pl 15 Jan 2003 13:45:43 -0000 1.36
+++ openpkg-src/openpkg-tool/openpkg-build.pl 15 Jan 2003 14:54:17 -0000 1.37
@@ -539,19 +539,23 @@
#
# pull in OPTIONS for a package or an RPM file
#
-sub get_with ($;$) {
- my($t,$fn) = @_;
+sub get_with ($$;$) {
+ my($env,$t,$fn) = @_;
my(@l,%with);
+ my($opt);
- unless ($t->{OPTIONS}) {
+ if (($env && $env->{zero}) || $t->{OPTIONS}) {
+ $opt = $t->{OPTIONS};
+ } else {
if (defined $fn) {
@l = `$RPM_NPRIV -qi -p $fn`;
} else {
@l = `$RPM_NPRIV -qi $t->{name}`;
}
- $t->{OPTIONS} = parse_options(\@l);
+ $opt = parse_options(\@l);
+ $t->{OPTIONS} = $opt if $env;
}
- return $t->{OPTIONS};
+ return $opt;
}
#
@@ -729,6 +733,12 @@
} elsif ($tag eq 'Prefixes') {
$prefix = $body;
} elsif ($tag eq 'rdf:li' || $tag eq 'resource') {
+ if (defined $attrname) {
+ $body = {
+ $attrname => $attrval,
+ content => $body
+ };
+ }
if ($section eq 'prereq') {
push(@prereq, $body);
} elsif ($section eq 'bprereq') {
@@ -1225,7 +1235,7 @@
if ($i && (@vers = get_versions($i, $cond))) {
foreach (@vers) {
$t = $i->{$_}->[0];
- get_with($t);
+ get_with($env,$t);
if (target_suitable($t, $env->{with})) {
$tdef = $t;
unless ($env->{upgrade}) {
@@ -1289,7 +1299,6 @@
return;
}
# pull in options
- get_with($t);
if ($target->{REBUILD}) {
target_setstatus($target,'DEPEND',1);
print "# rebuilding $target->{name} (dependency)\n";
@@ -1307,7 +1316,7 @@
return;
}
# use options from installed base
- override_options(get_with($target), get_with($t),
+ override_options(get_with($env,$target), get_with($env,$t),
$env->{config}->{optreg});
# remember this is a rebuild for a proxy package
$target->{PROXY} = $t->{PROXY};
@@ -1609,7 +1618,7 @@
my(%target) = %$t;
# pull in options from binary RPM file
- get_with(\%target, $fn);
+ get_with(undef,\%target, $fn);
return \%target;
}
@@ .
______________________________________________________________________
The OpenPKG Project www.openpkg.org
CVS Repository Commit List [EMAIL PROTECTED]