]> www.hackdaworld.org Git - hdw-linux/hdw-linux.git/commitdiff
first runtime dep check implementation
authorhackbard <hackbard>
Sun, 25 Jul 2004 17:32:48 +0000 (17:32 +0000)
committerhackbard <hackbard>
Sun, 25 Jul 2004 17:32:48 +0000 (17:32 +0000)
doc/CHANGELOG
scripts/Build

index 4e76ee9f6c0222d284c7240826e74e2512344f0f..ef6da608b7676425d1a3f3a00b07f3100490cb06 100644 (file)
@@ -1,5 +1,6 @@
 *) 2004-07-25
 
 *) 2004-07-25
 
+- implemented runtime dependency checks for each build, still dev!
 - fixed sendmail package
 - added setup script for openssh
 - some target modifications
 - fixed sendmail package
 - added setup script for openssh
 - some target modifications
index 1500a9cfca05c061f90a7fa1600b68034f7f3f99..4d1bb3cda45478032c91409e8569eafd39cde53b 100755 (executable)
@@ -315,35 +315,6 @@ echo "found $package config file ..."
                done
        fi
 
                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
 
        }
        # 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}
                  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/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
        # remove flist stuff 
        rm .time_${package}
        rm flist.$package