GRUP -- GRand Unified Parch ... of lvu :)

wookietreiber kizkizzbangbang at googlemail.com
Tue Jan 18 07:07:30 CET 2011


enjoy :)
-------------- next part --------------
--- old_lvu	2011-01-16 10:30:55.602000001 +0100
+++ /bin/lvu	2011-01-17 21:21:53.762000000 +0100
@@ -403,7 +403,7 @@
 
 
 show_leafs()  {
-  for  MODULE  in  $(cat  $MODULE_STATUS  |  cut  -d :  -f1) ;  do
+  for  MODULE  in  $(grep -E ":installed:|:held:"  $MODULE_STATUS  |  cut  -d :  -f1) ;  do
     if    !  cut  -d :  -f2-  $DEPENDS_STATUS  |
              grep             "^$MODULE:"       |
              grep  -q         ":on:"
@@ -414,7 +414,7 @@
 
 
 show_orphans()  {
-  for MODULE in $(grep :installed: $MODULE_STATUS | cut -d: -f1 | sort | uniq) ; do
+  for MODULE in $(grep -E ":installed:|:held:" $MODULE_STATUS | cut -d: -f1 | sort | uniq) ; do
     debug_msg "checking \"$MODULE\""
     for LINE in $(grep "^${MODULE}:" $DEPENDS_STATUS) ; do
       DEPENDS=$(echo $LINE | cut -d: -f2)
@@ -602,6 +602,9 @@
   INDENT="$INDENT|    "
   # and recurse:
   for DEP in $DEPS ; do
+    # recurse only if module is not root to avoid going on 
+    # indefinetely with circular dependencies
+    if [ ${DEP:1} != $ROOT ]; then
     grep -q "^$DEP$" $TMP_SEEN
     TEST=$?
     if [ "$TEST" == "1" -o -z "$SHORTTREE" ] ; then
@@ -610,6 +613,7 @@
       # note the FLAG= thingy here
       FLAG= show_tree ${DEP:1} 2> /dev/null
     fi
+    fi
   done
   # don't try this at home:
   INDENT=${INDENT:0:((${#INDENT}-5))}
@@ -1135,7 +1139,7 @@
 
     installed)
       if [ -z "$2" ] ; then
-        view_file $MODULE_STATUS
+        grep -E ":installed:|:held:" $MODULE_STATUS | view_file
       elif [ -n "$(installed_version $2)" ] ; then
         echo "$(installed_version $2)"
       else
@@ -1322,7 +1326,7 @@
 
     size)
       if [ -z "$2" ] ; then
-        MODULES=$(cat $MODULE_STATUS | cut -d: -f1 | sort)
+        MODULES=$(grep -E ":installed:|:held:" $MODULE_STATUS | cut -d: -f1 | sort)
         for MODULE in $MODULES ; do
           echo $MODULE $(find_module_size $MODULE)
         done
@@ -1336,20 +1340,24 @@
       ;;
 
     tree)
+      ROOT="$2"
       show_tree "$2"
       ;;
 
     stree)
+      ROOT="$2"
       SHORTTREE=1
       show_tree "$2"
       ;;
 
     eert)
+      ROOT="$2"
       SHORTTREE=1
       show_eert "$2"
       ;;
 
     leert)
+      ROOT="$2"
       show_eert "$2"
       ;;
 


More information about the Lunar-dev mailing list