[Lunar-commits] CVS: theedge/var/lib/lunar/functions depends.lunar, 1.22, 1.23

Auke Kok sofar at lunar-linux.org
Fri Jan 9 14:05:18 GMT 2004


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory dbguin.lunar-linux.org:/tmp/cvs-serv17469/var/lib/lunar/functions

Modified Files:
	depends.lunar 
Log Message:
Fixing the dependency tree sorter bug that caused 'lunar update' to keep showing already updated modules and rebuild queue's to miss modules ( I hope ;^) ). If needed someone has to tag -F STABLE this to propagate this to lunar.


Index: depends.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/depends.lunar,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- depends.lunar	29 Dec 2003 18:09:42 -0000	1.22
+++ depends.lunar	9 Jan 2004 14:05:15 -0000	1.23
@@ -68,13 +68,24 @@
 # usage    : LIST=$(sort_by_dependency $LIST)
 # purpose  : return a LIST sorted by dependency
 sort_by_dependency() {
- (
   debug_msg "sort_by_dependency ($@)"
-  MODULES=$@
-  for MODULE in $MODULES ; do
-    grep ^$MODULE: $DEPENDS_STATUS | grep ":on:" | awk -F: '{print $1,$2}'
-  done | tsort | tac
- )
+
+  recurse() {
+    for MOD in $* ; do
+      LIST=$(grep ^$MOD: $DEPENDS_STATUS | grep ":on:" | cut -d: -f2)
+      for DEP in $LIST ; do
+        echo $MOD $DEP
+      done
+      recurse $LIST
+    done
+  }
+
+  ALL=$(recurse $* | tsort | tac)
+  for DEP in $ALL ; do
+    if echo " $* " | grep -q " $DEP " ; then
+      echo $DEP
+    fi
+  done
 }
 
 



More information about the Lunar-commits mailing list