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 openpkg-web Date: 28-May-2003 13:22:09 Branch: HEAD Handle: 2003052812220701 Modified files: openpkg-src/openpkg-tool openpkg-build.pl openpkg-tool.spec openpkg-web news.txt Log: check option conflicts, propagate committed options to dependency check Summary: Revision Changes Path 1.74 +38 -13 openpkg-src/openpkg-tool/openpkg-build.pl 1.54 +2 -2 openpkg-src/openpkg-tool/openpkg-tool.spec 1.4605 +1 -0 openpkg-web/news.txt ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/openpkg-tool/openpkg-build.pl ============================================================================ $ cvs diff -u -r1.73 -r1.74 openpkg-build.pl --- openpkg-src/openpkg-tool/openpkg-build.pl 14 May 2003 10:27:51 -0000 1.73 +++ openpkg-src/openpkg-tool/openpkg-build.pl 28 May 2003 11:22:08 -0000 1.74 @@ -1360,7 +1360,11 @@ my($iwith); my($k,$v); - $with = name_with($target->{name}, $with); + if ($target->{GOAL}) { + $with = name_with($target->{name}, $with); + } else { + $with = name_only_with($target->{name}, $with); + } $iwith = $target->{OPTIONS}; while (($k,$v) = each %$with) { @@ -1405,16 +1409,38 @@ # add dependency as build option # sub depend_option ($$$) { - my($target,$dep,$with) = @_; + my($target,$dep,$env) = @_; + my($with,$opt,$relmap,@t,$t); my($pro) = depends2provides($dep); + my($conflict) = 0; return 1 unless defined $pro->{with}; - my($opt) = $pro->{prefix}.'::'.$pro->{with}; my($val) = defined $pro->{version} ? $pro->{version} : 'yes'; + + $with = $env->{with}; + $opt = $pro->{prefix}.'::'.$pro->{with}; if (defined $with->{$opt} && $with->{$opt} ne $val) { - return 0; + print "# ",vsn($target), + " has conflicting requirement $opt = $with->{$opt} != $val\n"; + $conflict = 1; + } + + $relmap = $env->{built}->{$pro->{prefix}} || + $env->{installed}->{$pro->{prefix}}; + @t = get_targets($relmap, sub { 1; }); + foreach $t (@t) { + $with = $t->{OPTIONS}; + $opt = $pro->{with}; + if (defined $with->{$opt} && $with->{$opt} ne $val) { + print "# ",vsn($t), + " has conflicting requirement $opt = $with->{$opt} != $val\n"; + $conflict = 1; + } } + + return 0 if $conflict; + print "# ",vsn($target)," adds option $opt = $val\n"; $with->{$opt} = $val; return 1; @@ -1559,7 +1585,7 @@ } elsif ($why = target_better($env, $target, $env->{installed})) { target_setstatus($target,'UPDATE',3); print "# rebuilding $target->{name} ($why)\n"; - } elsif ($target->{GOAL} && !target_suitable($t, $env->{with})) { + } elsif (!target_suitable($t, $env->{with})) { target_setstatus($target,'MISMATCH',2); print "# rebuilding $target->{name} (parameter mismatch)\n"; } else { @@ -1621,7 +1647,7 @@ print "# $target->{name} requires ".vsn($t)." for $_\n"; } - unless (depend_option($t, $d{$_}, $env->{with})) { + unless (depend_option($t, $d{$_}, $env)) { print "# $target->{name} has conflicting requirement\n"; push(@{$env->{fatal}},vsn($target)); target_setstatus($target,'UNDEF',4); @@ -1652,6 +1678,11 @@ $target->{WHY} = $target->{STATUS}; push(@$list, $target); $target->{LIMBO} = 0; + + # remember new options + override_options($target->{OPTIONS}, + name_with($target->{name}, $env->{with}), + ''); foreach (@{target_nosource($target,$env)}) { my($p) = target_source($target,$env)->[$_]; @@ -1965,12 +1996,6 @@ $spkg = $_->{href}; $bpkg = target2rpm($_, $c); - if ($_->{GOAL}) { - $mywith = name_with($_->{name},$with); - } else { - $mywith = name_only_with($_->{name},$with); - } - # # rebuild binary package IF # @@ -1982,7 +2007,7 @@ # $cmd1 = undef; if ($uncond || $_->{REBUILD} || !-f $bpkg || - !target_suitable(binary_target($_, $bpkg),$mywith)) { + !target_suitable(binary_target($_, $bpkg), $mywith)) { $opt = make_defines($_->{OPTIONS}, $mywith, $_->{DEFOPTS}, $c); @@ . patch -p0 <<'@@ .' Index: openpkg-src/openpkg-tool/openpkg-tool.spec ============================================================================ $ cvs diff -u -r1.53 -r1.54 openpkg-tool.spec --- openpkg-src/openpkg-tool/openpkg-tool.spec 14 May 2003 10:27:51 -0000 1.53 +++ openpkg-src/openpkg-tool/openpkg-tool.spec 28 May 2003 11:22:08 -0000 1.54 @@ -32,8 +32,8 @@ Distribution: OpenPKG [PLUS] Group: Bootstrapping License: GPL -Version: 20030514 -Release: 20030514 +Version: 20030528 +Release: 20030528 # list of sources Source0: openpkg.sh @@ . patch -p0 <<'@@ .' Index: openpkg-web/news.txt ============================================================================ $ cvs diff -u -r1.4604 -r1.4605 news.txt --- openpkg-web/news.txt 28 May 2003 09:43:06 -0000 1.4604 +++ openpkg-web/news.txt 28 May 2003 11:22:07 -0000 1.4605 @@ -1,3 +1,4 @@ +28-May-2003: Upgraded package: P<openpkg-tool-20030528-20030528> 28-May-2003: Upgraded package: P<gdk-pixbuf-0.22.0-20030528> 28-May-2003: Upgraded package: P<gettext-0.12.1-20030528> 28-May-2003: Upgraded package: P<perl-text-20030528-20030528> @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]