On Thursday 2012-05-31 01:30, Cristian Morales Vega wrote:
On 30 May 2012 20:48, Cristian Rodríguez <crrodriguez@opensuse.org> wrote:
Hi:
The script that generates -devel package "pkgconfig" dependencies does not quite do the right thing.
It honors *.private fields even when packages do not contain static libraries, hence adding a lot of unneeded stuff into the dependency chain.
I you have ever wondered why every time you build a package it downloads and inject half of the distribution into your buildroot, this is a likely candidate to look in ;-)
Will be cool if someone can take a look at it.
http://rpm.org/wiki/PackagerDocs/DependencyGenerator says "the new generators get called once per each file of a type". So I don't see a way to fix it.
All you nay sayers! :) --- r/usr/lib/rpm/pkgconfigdeps.sh 2011-10-29 05:21:34.000000000 +0200 +++ pkgconfigdeps.sh 2012-05-31 08:13:35.259115193 +0200 @@ -16,6 +16,20 @@ $pkgconfig --atleast-pkgconfig-version=" exit 0 } +# +# (The desired side effect of `head` should be that `find` terminates early on, +# after one line, due to SIGPIPE.) +# +static_archives=""; +result=$(find "$RPM_BUILD_ROOT" -type f -name "*.a" | head -n1); +if [ -n "$result" ]; then + # It looks like at least one RPM subpackage will have .a files + static_archives="--print-requires-private"; + echo "$0: Will include Requires.private as Provides: due to $result" >&2; +else + echo "$0: No static archives found. Requires.private will not contribute to Provides:." >&2; +fi + case $1 in -P|--provides) while read filename ; do @@ -44,7 +58,7 @@ case $1 in [ $i -eq 1 ] && echo "$pkgconfig" DIR="`dirname ${filename}`" export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig" - $pkgconfig --print-requires --print-requires-private "$filename" 2> /dev/null | while read n r v ; do + $pkgconfig --print-requires $static_archives "$filename" 2> /dev/null | while read n r v ; do [ -n "$n" ] || continue echo -n "pkgconfig($n) " [ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v" -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org