aboutsummaryrefslogtreecommitdiffstats
path: root/find-requires.in
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2008-11-24 02:32:26 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2008-11-24 02:32:26 +0000
commit75f87740c1bb9416116bf1d424d534fadd0de9d9 (patch)
tree8e770e1d9514d1e3150b215177f818a8bbde94ef /find-requires.in
parentbc0c4baa12b43b1a0250460664b3024e71fdb95e (diff)
downloadrpm-setup-75f87740c1bb9416116bf1d424d534fadd0de9d9.tar
rpm-setup-75f87740c1bb9416116bf1d424d534fadd0de9d9.tar.gz
rpm-setup-75f87740c1bb9416116bf1d424d534fadd0de9d9.tar.bz2
rpm-setup-75f87740c1bb9416116bf1d424d534fadd0de9d9.tar.xz
rpm-setup-75f87740c1bb9416116bf1d424d534fadd0de9d9.zip
fix so that redundant unversioned python-base/perl-base is added as dependencies
if a versioned is already added (maybe worth doing similar way with other depencies as well? for consistency at least, if for nothing else)
Diffstat (limited to 'find-requires.in')
-rwxr-xr-xfind-requires.in33
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
#