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: 24-Jun-2003 16:52:39 Branch: HEAD Handle: 2003062415523701 Modified files: openpkg-src/openpkg-tool openpkg-build.pl openpkg-tool.spec openpkg-web news.txt Log: parse options from binary RPMs using --provides Summary: Revision Changes Path 1.80 +29 -12 openpkg-src/openpkg-tool/openpkg-build.pl 1.59 +2 -2 openpkg-src/openpkg-tool/openpkg-tool.spec 1.5003 +1 -0 openpkg-web/news.txt ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/openpkg-tool/openpkg-build.pl ============================================================================ $ cvs diff -u -r1.79 -r1.80 openpkg-build.pl --- openpkg-src/openpkg-tool/openpkg-build.pl 20 Jun 2003 11:06:13 -0000 1.79 +++ openpkg-src/openpkg-tool/openpkg-build.pl 24 Jun 2003 14:52:38 -0000 1.80 @@ -537,6 +537,24 @@ } # +# parse option from rpm provides list +# +sub parse_provideslist ($$) { + my($l,$name) = @_; + my($p); + my($nam,$val,%opts); + + foreach (@$l) { + $p = parse_provides($_); + next unless defined $p->{with}; + next if defined $p->{prefix} && $p->{prefix} ne $name; + $opts{$p->{with}} = $p->{version} + } + + return \%opts; +} + +# # copy options from new to old # where option already exists in old or option key # matches regular expression @@ -557,22 +575,18 @@ sub get_with ($;$) { my($t,$fn) = @_; my(@l,%with); - my($opt); + my($optmap,$opt); if ($t->{OPTIONS}) { $opt = $t->{OPTIONS}; } else { if (defined $fn) { - @l = run("$RPM -qi -p $fn"); - $opt = parse_options([EMAIL PROTECTED]); - # don't write back result, this is just - # for testing compatibility of a binary - # package + @l = run("$RPM -q --provides -p $fn"); } else { - @l = run("$RPM -qi $t->{name}"); - $opt = parse_options([EMAIL PROTECTED]); - $t->{OPTIONS} = $opt; - } + @l = run("$RPM -q --provides $t->{name}"); + } + $opt = parse_provideslist([EMAIL PROTECTED],$t->{name}); + $t->{OPTIONS} = $opt; } return $opt; } @@ -1914,6 +1928,7 @@ my(%target) = %$t; # pull in options from binary RPM file + delete $target{'OPTIONS'}; get_with(\%target, $fn); return \%target; @@ -1996,6 +2011,8 @@ $spkg = $_->{href}; $bpkg = target2rpm($_, $c); + $mywith = + # # rebuild binary package IF # @@ -2007,9 +2024,9 @@ # $cmd1 = undef; if ($uncond || $_->{REBUILD} || !-f $bpkg || - !target_suitable(binary_target($_, $bpkg), $mywith)) { + !target_suitable(binary_target($_, $bpkg), $with)) { - $opt = make_defines($_->{OPTIONS}, $mywith, + $opt = make_defines($_->{OPTIONS}, $with, $_->{DEFOPTS}, $c); # @@ . patch -p0 <<'@@ .' Index: openpkg-src/openpkg-tool/openpkg-tool.spec ============================================================================ $ cvs diff -u -r1.58 -r1.59 openpkg-tool.spec --- openpkg-src/openpkg-tool/openpkg-tool.spec 20 Jun 2003 10:35:19 -0000 1.58 +++ openpkg-src/openpkg-tool/openpkg-tool.spec 24 Jun 2003 14:52:38 -0000 1.59 @@ -32,8 +32,8 @@ Distribution: OpenPKG [PLUS] Group: Bootstrapping License: GPL -Version: 20030620 -Release: 20030620 +Version: 20030624 +Release: 20030624 # list of sources Source0: openpkg.sh @@ . patch -p0 <<'@@ .' Index: openpkg-web/news.txt ============================================================================ $ cvs diff -u -r1.5002 -r1.5003 news.txt --- openpkg-web/news.txt 24 Jun 2003 13:54:50 -0000 1.5002 +++ openpkg-web/news.txt 24 Jun 2003 14:52:37 -0000 1.5003 @@ -1,3 +1,4 @@ +24-Jun-2003: Upgraded package: P<openpkg-tool-20030624-20030624> 24-Jun-2003: Upgraded package: P<ifile-1.3.2-20030624> 24-Jun-2003: Upgraded package: P<whoson-2.02a-20030624> 24-Jun-2003: Upgraded package: P<vrrpd-0.8.7-20030624> @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List [EMAIL PROTECTED]