reorganized Config file
[hdw-linux/hdw-linux.git] / scripts / Helper
index 048ed14..fb15677 100755 (executable)
@@ -16,6 +16,8 @@ ccl=0
 cdf=0
 rtd=0
 bd=0
+chr=0
+root=""
 
 while [ "$1" ] ; do
        case "$1" in
@@ -23,6 +25,7 @@ while [ "$1" ] ; do
                -create_dist_files)     cdf=1;  shift 1 ;;
                -create_runtimedeps)    rtd=1;  shift 1 ;;
                -create_build_deps)     bd=1;   shift 1 ;;
+               -chroot)                chr=1;  shift 1 ;;
                *)
                        echo
                        echo "usage:"
@@ -36,18 +39,27 @@ while [ "$1" ] ; do
        esac
 done
 
+[ "$chr" = "1" ] && root=$hdw_build_dir
+
 if [ "$rtd" = "1" ] ; then
        echo "# hdw packages + run time dependencies"
        echo "#"
        echo "# created `date`"
        echo
-       for i in /var/adm/deps/run/*; do
-               echo -en $i | sed 's$/var/adm/deps/run/$$'
-               echo -en " - "
-               for j in `cat $i`; do
-                       echo -en "$j "
-               done
-               echo -en "\n"
+       echo "00-dirtree -"
+       for i in $root/var/adm/flists/*; do
+               package=`basename $i | sed 's/-[0-9].*//'`
+               if [ -n "`echo $package | grep -v stage[0-1]`" ] ; then
+                       file="$root/var/adm/deps/run/$package"
+                       echo -en $package
+                       echo -en " - "
+                       if [ -f $file ] ; then
+                               for j in `cat $file`; do
+                                       echo -en "$j "
+                               done
+                       fi
+                       echo -en "\n"
+               fi
        done
 fi
 
@@ -68,7 +80,7 @@ if [ "$cdf" = "1" ] ; then
        echo -en "creating dist file ./distro/$hdw_target ..."
        . ./scripts/subroutines
        echo "00-dirtree" > ./distro/$hdw_target
-       create_buildorder '2 3 4' $max > ./distro/$hdw_target.~
+       create_buildorder '2 3' $max > ./distro/$hdw_target.~
        grep -v '^#' ./distro/$hdw_target.~ | awk '{ print $4 }' >> \
                ./distro/$hdw_target
        rm ./distro/$hdw_target.~