diff options
Diffstat (limited to 'find-requires.in')
-rwxr-xr-x | find-requires.in | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/find-requires.in b/find-requires.in index b521784..d8901d9 100755 --- a/find-requires.in +++ b/find-requires.in @@ -53,6 +53,8 @@ perllist= pythonlist= tcllist= +uniqdeplist= + # # --- Alpha does not mark 64bit dependencies case `uname -m` in @@ -92,13 +94,20 @@ fi # # --- Perl or python deps -PERL_EPOCH=`rpm -q --queryformat '%|EPOCH?{[%{EPOCH}]:}|' perl-base` +perlepoch=`rpm -q --qf '%|EPOCH?{[%{EPOCH}]:}|' perl-base` if [ $? != 0 ]; then - unset PERL_EPOCH + unset perlepoch fi + +tmpdeplist= for f in $filelist; do - echo $f | sed -n -e "s@.*/usr/lib/perl5/\(site_perl/\)\([0-9]\{1,\}\.[0-9]\{1,\}\)\.\([0-9]\{1,\}\).*\$@perl-base >= \2.\3@p" -e "s@.*/usr/lib/perl5/\(vendor_perl\/\)\([.0-9]\{1,\}\).*\$@perl-base >= $PERL_EPOCH\2@p" -e "s@.*/usr/\(lib\|lib64\)/python\([.0-9]\{1,\}\).*\$@python-base >= \2@p" -done | sort -u + dep="`echo $f | sed -n -e "s@.*/usr/lib/perl5/\(site_perl/\)\([0-9]\{1,\}\.[0-9]\{1,\}\)\.\([0-9]\{1,\}\).*\\$@perl-base >= \2.\3@p" -e "s@.*/usr/lib/perl5/\(vendor_perl\/\)\([.0-9]\{1,\}\).*\\$@perl-base >= $perlepoch\2@p" -e "s@.*/usr/\(lib\|lib64\)/python\([.0-9]\{1,\}\).*\\$@python-base >= \2@p"`" + if [[ -n $dep && -z `echo $uniqdeplist $tmpdeplist|grep "$dep"` ]]; then + tmpdeplist+="$dep\n" + fi +done +echo -n -e $tmpdeplist | sort -u +uniqdeplist+="$tmpdeplist" # @@ -112,13 +121,15 @@ for f in $scriptlist; do esac done if [ -n "$interplist" ]; then - for i in `echo "$interplist" | tr '[:blank:]' \\\n | sort -u`; do - if rpm -qf $i >/dev/null 2>&1; then - rpm -qf $i --qf '%{name}\n' - else - echo $i + tmpdeplist= + for i in `echo "$interplist" | tr '[:blank:]' \\\n `; do + dep=`rpm -qf $i --qf '%{name}\n'` && i=$dep + if [[ -z `echo $uniqdeplist $tmpdeplist|grep "$i"` ]]; then + tmpdeplist+="$i\n" fi - done | sort -u | grep -v 'libsafe|libfakeroot' + done + echo -n -e $tmpdeplist | sort -u | grep -v 'libsafe|libfakeroot' + uniqdeplist="$tmpdeplist" fi # @@ -198,7 +209,7 @@ fi # # --- Php modules. -[ -x @RPMVENDORDIR@/php.req -a n "$phplist" ] && \ +[ -x @RPMVENDORDIR@/php.req -a -n "$phplist" ] && \ echo $phplist | tr '[:blank:]' \\n | @RPMVENDORDIR@/php.req | sort -u # |