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
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