]> hackdaworld.org Git - hdw-linux/hdw-linux.git/commitdiff
fixes to hdw-get
authorhackbard <hackbard>
Wed, 24 Aug 2005 20:06:47 +0000 (20:06 +0000)
committerhackbard <hackbard>
Wed, 24 Aug 2005 20:06:47 +0000 (20:06 +0000)
doc/CHANGELOG
misc/hdw-tools/hdw-get

index 1a29c0a9e5f43d34afdabe563a4c5a9d27349e70..f673817bc7a4aa69f8e692405d543d4ba5b3ad25 100644 (file)
@@ -1,5 +1,6 @@
 *) 2005-08-24
 
+- hdw-get fixes
 - fixed lirc modules install path
 - added libosip and linphone package
 
index 0ee4ba78cf521dc3dec5c4d552d55487b616ee82..594325299ddddbf5c564672f8d1e6bddc9d6ebad 100644 (file)
@@ -29,6 +29,7 @@ verbose="" ; no_dep=""
 auto_resolve_deps=""
 simulate=""
 base=""
+answer="y"
 
 FL_DIR="var/adm/flists"
 DEPS_DIR="var/adm/deps/run"
@@ -129,10 +130,10 @@ if [ "$remove" = "1" ] ; then
        if [ "$simulate" != "1" ] ; then
 
        # remove the files/dirs
-       ((supposed = 0))
-       ((counter = 0))
+       #((supposed = 0))
+       #((counter = 0))
        cat $fl_file | while read pkg file; do
-               ((supposed += 1))
+               #((supposed += 1))
                if [ -e $inst_root/$file ] ; then
                        if [ "$file" != "tmp" ] ; then
                        if [ -d $inst_root/$file ] ; then
@@ -141,10 +142,10 @@ if [ "$remove" = "1" ] ; then
                                rm -f $inst_root/$file > /dev/null 2>&1
                                rmdir -p `dirname $file` > /dev/null 2>&1
                        fi
-                       ((counter += 1))
+                       #((counter += 1))
                        fi
                fi
-               echo -en "\rremoved $counter from $supposed supposed files"
+               #echo -en "\rremoved $counter from $supposed supposed files"
        done
        echo -en "\ndone.\n"
 
@@ -193,8 +194,9 @@ elif [ "$install" = "1" ] ; then
                udeps=""
                tudeps=""
                for dep in $deps; do
-                       [ ! -f $inst_root/$FL_DIR/$dep-* ] && \
-                               udeps="$dep $udeps"
+                       [ "$dep" != "$pkg" ] &&
+                               [ ! -f $inst_root/$FL_DIR/$dep-[0-9]* ] && \
+                                       udeps="$dep $udeps"
                done
                while [ "$udeps" != "$tudeps" ] ; do
                        tudeps="$udeps"
@@ -202,6 +204,7 @@ elif [ "$install" = "1" ] ; then
                                deps="`grep "^$tdep\ -" $DBF | sed 's/.* -//'`"
                                for dep in $deps; do
                                        exists=0
+                                       [ "$dep" = "$pkg" ] && break
                                        [ -f $inst_root/$FL_DIR/$dep-* ] && \
                                                break
                                        for i in $udeps; do
@@ -212,22 +215,25 @@ elif [ "$install" = "1" ] ; then
                                done
                        done
                done
-               echo "$pkg depends on the following uninstalled packages:"
-               echo "$udeps"
-               echo
-               echo "continue? [y,n] (default 'n')"
-               if [ -z $auto_resolve_deps ] ; then
-                       read answer
-                       if [ "$answer" = "y" ] ; then
-                               for i in $udeps; do
-                                       [ "$simulate" != "1" ] && \
-                                       $0 -no-dep install $inst_root $i
-                               done
+               if [ ".$udeps" != "." ] ; then
+                       echo "$pkg uninstalled depends:"
+                       echo "$udeps"
+                       echo
+                       echo "continue? [y,n] (default 'n')"
+                       answer="n"
+                       if [ "$auto_resolve_deps" != "1" ] ; then
+                               read answer
+                               if [ "$answer" = "y" ] ; then
+                                       for i in $udeps; do
+                                               [ "$simulate" != "1" ] && \
+                                               $0 -no-dep install $inst_root $i
+                                       done
+                               fi
                        fi
                fi
        fi
        
-       if [ "$simulate" != "1" ] ; then
+       if [ "$simulate" != "1" -a "$answer" = "y" ] ; then
        
        # check/install package
        if [ -f $package ] ; then