CHANGELOG 2004-12-06
[hdw-linux/hdw-linux.git] / misc / hdw-tools / hdw-get
index b6526a7..10be612 100644 (file)
@@ -30,7 +30,7 @@ while [ "$1" ] ; do
                                inst_root="$2" ; package="$3" ; shift 3 ;;
                remove)         remove="1" 
                                inst_root="$2" ; package="$3" ; shift 3 ;;
-               dist-install)   d_install="1"
+               dist-install)   d_install="1"  ; package="fake"
                                inst_root="$2" ; dist_file="$3" ; shift 3 ;;
                -v)             verbose=1 ; shift 1 ;;
                -a)             auto_resolve_deps="1" ; shift 1 ;;
@@ -66,7 +66,7 @@ mkdir -p /tmp/.hdw-get
 if [ "$remove" = "1" ] ; then
        # looking for flist file
        fl_pris=""
-       for fl_file in $inst_root/var/adm/flists/$package-[0-9]*; do
+       for fl_file in $inst_root/var/adm/flists/$package-[x,0-9]*; do
                fl_pris="`echo $fl_file | awk -F- '{ print $NF }'` $fl_pris"
        done
        fl_max="0"
@@ -165,12 +165,14 @@ elif [ "$install" = "1" ] ; then
                tar --use-compress-program=bzip2 \
                -xf $bin_dir/$package/$package.tar.bz2 -C $inst_root
        elif [ ! -z "$net_addr" ] ; then
-               #echo "trying to get package $package via net ..."
+               echo "getting package $package via net ..."
                wget $net_addr/hdw-linux/hdw-linux-$hdw_version/binaries/${hdw_arch}-${hdw_arch_opt}/$package/${package}.tar.bz2 > /dev/null 2>&1
-               if [ "$?" ] ; then
+               retval=$?
+               if [ "$retval" != "0" ] ; then
                        echo "package not found at $net_addr, aborting ..."
+                       exit
                else
-               
+                       echo "extracting $package to $inst_root ..."    
                        tar --use-compress-program=bzip2 \
                                -xf ${package}.tar.bz2 -C $inst_root
                        rm ${package}.tar.bz2
@@ -182,6 +184,7 @@ elif [ "$install" = "1" ] ; then
        fi
 
        # merging info/dir file
+       if [ "$pkg" != "00-dirtree" ] ; then
        fl_file=`ls -A $inst_root/var/adm/flists/$pkg-[0-9]* | tail -1`
        if [ -n "`grep usr/share/info/dir $fl_file`" ] ; then
                echo "" >> /tmp/.hdw-get/dir
@@ -199,7 +202,9 @@ elif [ "$install" = "1" ] ; then
                        fi
                done
        fi
-       cp /tmp/.hdw-get/dir $inst_root/usr/share/info/dir
+       fi
+       [ -f /tmp/.hdw-get/dir ] && \
+               cp /tmp/.hdw-get/dir $inst_root/usr/share/info/dir
        rm -f /tmp/.hdw-get/dir
 
        # check for runtime deps
@@ -224,7 +229,7 @@ elif [ "$install" = "1" ] ; then
        #fi
                
 # dist-install
-elif [ "$dist_install" = "1" ] ; then
+elif [ "$d_install" = "1" ] ; then
        # check dist file
        if [ ! -f $dist_file ] ; then
                echo "$dist_file not found, aborting"