]> hackdaworld.org Git - hdw-linux/hdw-linux.git/commitdiff
small changes in hdw-get
authorhackbard <hackbard>
Wed, 28 Jul 2004 10:00:49 +0000 (10:00 +0000)
committerhackbard <hackbard>
Wed, 28 Jul 2004 10:00:49 +0000 (10:00 +0000)
doc/CHANGELOG
misc/hdw-tools/hdw-get

index d455d0688f515d0a27e638ed3704c8f77a25fcb3..094eeda0cdb02bb724561dc1f67ff8428cc24016 100644 (file)
@@ -1,5 +1,6 @@
 *) 2004-07-28
 
+- small fixes to hdw-get (still no dep checking)
 - not building qt plugin for licq
 - modified xdirectfb
 
index 0f785fb353be6e225946b2bab2098ff524130ebd..b6526a7789d4f19956a0fabf01b25b615a5b76b4 100644 (file)
@@ -12,10 +12,17 @@ usage()     {
        echo "$0 [install/remove] [root] [package]"
        echo "$0 [dist-install] [root] [dist file]"
        echo
+       echo "options:"
+       echo "-v        tell me whats going on"
+       echo "-a        auto resolve deps, do not prompt user"
+       echo "-no-dep   do not care for dependencies (used by hdw-get itself)"
+       echo
 }
+
 package="" ; inst_root=""
 d_install="" ; install=""
-verbose=""
+verbose="" ; no_dep=""
+auto_resolve_deps=""
 
 while [ "$1" ] ; do
        case "$1" in
@@ -26,6 +33,8 @@ while [ "$1" ] ; do
                dist-install)   d_install="1"
                                inst_root="$2" ; dist_file="$3" ; shift 3 ;;
                -v)             verbose=1 ; shift 1 ;;
+               -a)             auto_resolve_deps="1" ; shift 1 ;;
+               -no-dep)        no_dep="1" ; shift 1 ;;
                *)              usage ; exit 1 ;;
        esac
 done
@@ -128,6 +137,16 @@ elif [ "$install" = "1" ] ; then
                exit 1
        fi
 
+       # does package exist?
+       pkg=`basename $package | sed 's/.tar.bz2//'`
+       if [ -f $inst_root/var/adm/flists/${pkg}-[0-9]* ] ; then
+               echo "$pkg seems to be installed, candidates:"
+               for i in $inst_root/var/adm/flists/${pkg}-[0-9]*; do
+                       echo "-> $i"
+               done
+               exit 1
+       fi
+
        # store info/dir file
        rm -f /tmp/.hdw-get/dir*
        if [ -f $inst_root/usr/share/info/dir ] ; then
@@ -159,10 +178,10 @@ elif [ "$install" = "1" ] ; then
                fi
        else
                echo "sorry, package $package not found"
+               exit 1
        fi
 
        # merging info/dir file
-       pkg=`basename $package | sed 's/.tar.bz2//'`
        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
@@ -183,6 +202,27 @@ elif [ "$install" = "1" ] ; then
        cp /tmp/.hdw-get/dir $inst_root/usr/share/info/dir
        rm -f /tmp/.hdw-get/dir
 
+       # check for runtime deps
+       #if [ -z $no_deps ] ; then
+       #       alldeps=`get_all_deps $pkg`
+       #       echo "$pkg depends on the following packages:"
+       #       for i in $alldeps; do
+       #               echo "-> $i"
+       #       done
+       #       echo "continue? [y,n]"
+       #       if [ -z $auto_resolve_deps ] ; then
+       #               read answer
+       #               if [ "$answer" = "y" ] ; then
+       #                       for i in $alldeps; do
+       #                               $0 -no-dep install $inst_root $pkg
+       #                       done
+       #               else
+       #                       echo -n "install dependencies on your own,"
+       #                       echo " things will not work without."
+       #               fi
+       #       fi
+       #fi
+               
 # dist-install
 elif [ "$dist_install" = "1" ] ; then
        # check dist file