From: hackbard Date: Sun, 25 Jul 2004 17:32:48 +0000 (+0000) Subject: first runtime dep check implementation X-Git-Url: https://hackdaworld.org/gitweb/?a=commitdiff_plain;h=f28c6fbadbb1f980d29df5db0875c188f34db102;p=hdw-linux%2Fhdw-linux.git first runtime dep check implementation --- diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 4e76ee9..ef6da60 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,5 +1,6 @@ *) 2004-07-25 +- implemented runtime dependency checks for each build, still dev! - fixed sendmail package - added setup script for openssh - some target modifications diff --git a/scripts/Build b/scripts/Build index 1500a9c..4d1bb3c 100755 --- a/scripts/Build +++ b/scripts/Build @@ -315,35 +315,6 @@ echo "found $package config file ..." done fi - # build dependencies (just libs >= stage 3, default target hardcoded) - # still in development !! - if [ "$hdw_status" -ge "2" ] ; then - rm -f $root/var/adm/deps/build/$package - echo -n "calculating dependencies ... " - alldeps="" - for lib in `grep '\ -l[A-Za-z]' \ - $root/var/adm/logs/${hdw_status}-${priority}-$package.out`; do - if [ -n "`echo $lib | grep '^-l'`" ] ; then - lib=${lib//-l/lib} - for dep in `grep "/$lib\." \ - -r $root/var/adm/flists | \ - awk -F: '{ print $2 }'`; do - add=1 - for cmp in $alldeps; do - [ "$cmp" = "$dep" ] && add=0 - done - [ "$add" = "1" ] && \ - alldeps="$dep $alldeps" - done - fi - done - for dep in $alldeps; do - echo "$dep" >> $root/var/adm/deps/build/$package - done - echo "done" - touch $root/var/adm/deps/build/$package - fi - } # end of trap block @@ -369,10 +340,78 @@ echo "found $package config file ..." package ; \ print package ": " "var/adm/flists/" package append }' \ $root/flist.$package > $root/var/adm/flists/${package}${append} - [ "$hdw_status" -ge "3" ] && \ + # manually add dependency files, calculated after flist + if [ "$hdw_status" -ge "3" ] ; then echo "${package}: var/adm/deps/build/$package" >> \ $root/var/adm/flists/${package}${append} + echo "${package}: var/adm/deps/run/$package" >> \ + $root/var/adm/flists/${package}${append} + fi + # build/runtime dependencies (just libs >= stage 3, + # default is 'hardcoded') + # still in development !! + if [ "$hdw_status" -ge "2" ] ; then + # build deps + rm -f $root/var/adm/deps/build/$package + echo -n "calculating build dependencies ... " + alldeps="" + for lib in `grep '\ -l[A-Za-z]' \ + $root/var/adm/logs/${hdw_status}-${priority}-$package.out`; do + if [ -n "`echo $lib | grep '^-l'`" ] ; then + lib=${lib//-l/lib} + for dep in `grep "/$lib\." \ + -r $root/var/adm/flists | \ + awk -F: '{ print $2 }'`; do + add=1 + for cmp in $alldeps; do + [ "$cmp" = "$dep" ] && add=0 + done + [ "$add" = "1" ] && \ + alldeps="$dep $alldeps" + done + fi + done + for dep in $alldeps; do + echo "$dep" >> $root/var/adm/deps/build/$package + done + echo "done" + # runtime deps + rm -f $root/var/adm/deps/run/$package + echo -n "calculating runtime dependencies ... " + alldeps="" + for binary in `grep 'bin\/' \ + $root/var/adm/flists/${package}${append} | \ + awk '{ print $2 }'`; do + for rdep in `ldd $root/$binary | awk '{ print $3 }' | \ + sed 's$/$$'i | grep -v stage | \ + awk -F: '{ print $2 }'`; do + add=1 + for cmp in $alldeps; do + [ "$cmp" = "rdep" ] && add=0 + done + [ "$add" = "1" ] && alldeps="$rdep $alldeps" + done + done + for library in `grep 'lib\/.*.so.*' \ + $root/var/adm/flists/${package}${append} | \ + awk '{ print $2 }'`; do + for rdep in `ldd $root/$binary | awk '{ print $3 }' | \ + sed 's$/$$'i | grep -v stage | \ + awk -F: '{ print $2 }'`; do + add=1 + for cmp in $alldeps; do + [ "$cmp" = "rdep" ] && add=0 + done + [ "$add" = "1" ] && alldeps="$rdep $alldeps" + done + done + for dep in $alldeps; do + echo "$dep" >> $root/var/adm/deps/run/$package + done + echo "done" + fi + # remove flist stuff rm .time_${package} rm flist.$package