fetch_depends extended to make sure that internal dependencies are not

accidentally picked from an already installed revision of the same software.

Only list a dependency once in the relnotes.

Irix 6.2 ldd is too stupid to be used to extract dependencies since it will
just abort if one of the libraries are missing. We use Ariel Faigons perl
version of ldd originally written for Irix 5.3 (which lacks ldd) instead.

Also we need to use GNU xargs which supports -r (--no-run-if-empty) to
avoid running showfiles on empty input since otherwise it will list all
installed packages.

Exclude patchSG* packages from depends
This commit is contained in:
Tom G. Christensen 2005-10-08 15:36:20 +00:00
parent 831306c523
commit b0b4a02a67

View File

@ -399,21 +399,38 @@ fetch_subsysdesc()
# #
fetch_depends() fetch_depends()
{ {
local reqidx=0
local havedep=0
[ -r ${depends} ] && $CAT ${depends} > ${depends}_all [ -r ${depends} ] && $CAT ${depends} > ${depends}_all
[ -r ${depends}_auto ] && $CAT ${depends}_auto >> ${depends}_all [ -r ${depends}_auto ] && $CAT ${depends}_auto >> ${depends}_all
if [ -r ${depends}_all ]; then if [ -r ${depends}_all ]; then
reqidx=0
while read ss reqpkg reqvers while read ss reqpkg reqvers
do do
reqs[$reqidx]=$ss havedep=0
if [ "$reqvers" == "auto" ]; then # auto create depend on $reqpkg (assumed internal) if [ "$reqvers" == "auto" ]; then # auto create depend on $reqpkg (assumed internal)
nver=$(fix_ver "$version-$pkgver") nver=$(fix_ver "$version-$pkgver")
req="$pkgname.$reqpkg $nver $nver" req="$pkgname.$reqpkg $nver $nver"
havedep=1
else else
req="$reqpkg $reqvers" # When rebuilding a package we want to avoid the autodeps
# from adding deps on the already installed parts.
# Internal deps must be handled in depends with the auto keyword
# or chaos will ensue.
# We will try to check if the package name in the autodep matches the
# package we're building
if [ ! "${reqpkg%%.*}" == "$pkgname" ]; then
req="$reqpkg $reqvers"
havedep=1
else
echo "skipping depend: $ss $reqpkg $reqvers"
fi
fi
# Only increment and update arrays if we actually add the dep
if [ $havedep -gt 0 ]; then
reqs[$reqidx]=$ss
reqp[$reqidx]=$req
let "reqidx = $reqidx + 1"
fi fi
reqp[$reqidx]=$req
let "reqidx = $reqidx + 1"
done < ${depends}_all done < ${depends}_all
fi fi
} }
@ -880,7 +897,7 @@ auto_rel()
local extracted_env="${temp_extracted_env%\\*}" local extracted_env="${temp_extracted_env%\\*}"
# FIXME: expensive use of perl # FIXME: expensive use of perl
if [ -r ${depends}_all ]; then if [ -r ${depends}_all ]; then
local temp_deps="$($CAT ${depends}_all | $GREP $pkgprefix | $SED -e "s/.*${pkgprefix}//" | $CUT -d. -f1 | $PERL -i -pe 's/\n/\\\n/')" local temp_deps="$($CAT ${depends}_all | $GREP $pkgprefix | $SED -e "s/.*${pkgprefix}//" | $CUT -d. -f1 | $PERL -i -pe 's/\n/\\\n/' | $SORT -u)"
else else
local temp_deps="" local temp_deps=""
fi fi
@ -933,27 +950,33 @@ extract_deps()
if [ -n "$exelist" ]; then if [ -n "$exelist" ]; then
for f in $exelist; do for f in $exelist; do
[ -r $f -a -x $f ] || continue [ -r $f -a -x $f ] || continue
$LDD $f | $GREP \= | $AWK -F' ' '{ print $3 }' | $CUT -d\ -f2 # Generic Irix ldd
done | $SORT -u | $XARGS $SHOWFILES -- | $AWK '{ print $4 }' | $SORT -u # $LDD $f | $GREP \= | $AWK -F' ' '{ print $3 }' | $CUT -d\ -f2
# Ariel Faigons perl5 ldd
$LDD $f | $GREP \= | $GREP -v 'not found' | $SED -e 's/.*=> //g'
done | $SORT -u | $XARGS -r $SHOWFILES -- | $AWK '{ print $4 }' | $SORT -u
fi fi
# Compute dependencies for dynamic libraries # Compute dependencies for dynamic libraries
if [ -n "$liblist" ]; then if [ -n "$liblist" ]; then
for f in $liblist; do for f in $liblist; do
[ -r $f -a -x $f ] || continue [ -r $f ] || continue
$LDD $f | $GREP \= | $AWK -F' ' '{ print $3 }' | $CUT -d\ -f2 # Generic Irix ldd
done | $SORT -u | $XARGS $SHOWFILES -- | $AWK '{ print $4 }' | $SORT -u #$LDD $f | $GREP \= | $AWK -F' ' '{ print $3 }' | $CUT -d\ -f2
# Ariel Faigon's perl5 ldd
$LDD $f | $GREP \= | $GREP -v 'not found' | $SED -e 's/.*=> //g'
done | $SORT -u | $XARGS -r $SHOWFILES -- | $AWK '{ print $4 }' | $SORT -u
fi fi
# Compute dependencies for scripts # Compute dependencies for scripts
if [ -n "$scriptlist" ]; then if [ -n "$scriptlist" ]; then
for f in $scriptlist; do for f in $scriptlist; do
[ -r $f -a -x $f ] || continue [ -r $f -a -x $f ] || continue
interp=$HEAD -n 1 $f | $CUT -d\! -f2- interp="$($HEAD -n 1 $f | $CUT -d\! -f2-)"
if [ -L $interp ]; then if [ -L "$interp" ]; then
echo $($FILE -h $interp | $SED -e 's/.* to //') echo $($FILE -h "$interp" | $SED -e 's/.* to //')
else else
echo $interp echo $interp
fi fi
done | $SORT -u | $XARGS $SHOWFILES -- | $AWK '{ print $4 }' | $SORT -u done | $SORT -u | $XARGS -r $SHOWFILES -- | $AWK '{ print $4 }' | $SORT -u
fi fi
} }
@ -972,7 +995,7 @@ auto_deps()
subsystems="$($AWK '{ print $7 }' < $idbfile | $SORT -u | $GREP sw)" subsystems="$($AWK '{ print $7 }' < $idbfile | $SORT -u | $GREP sw)"
for i in $subsystems for i in $subsystems
do do
deps="$(extract_deps $i)" deps="$(extract_deps $i | $GREP -v patchSG)"
for j in $deps for j in $deps
do do
echo "${i#*.} $j $($SHOWPRODS -n $j | $GREP $j | $AWK '{ print $3 }') maxint" echo "${i#*.} $j $($SHOWPRODS -n $j | $GREP $j | $AWK '{ print $3 }') maxint"