[Lunar-commits] CVS: theedge/sbin lin,1.75,1.76 lunar,1.28,1.29

Auke Kok sofar at lunar-linux.org
Sun Mar 21 20:51:46 GMT 2004


Update of /var/cvs/lunar/theedge/sbin
In directory dbguin.lunar-linux.org:/tmp/cvs-serv21983/sbin

Modified Files:
	lin lunar 
Log Message:
Major bug(!) fixes:
- remove write_config alltogether from lunar
- rewrite core algorithm, now truly adheres to the proper order: depends, download (with smart download queue filler), install. Should fix the multi-lget spawns and fix the install order (tho that didn't really break, it was not just how I intended it to be).


Index: lin
===================================================================
RCS file: /var/cvs/lunar/theedge/sbin/lin,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- lin	9 Mar 2004 16:13:12 -0000	1.75
+++ lin	21 Mar 2004 20:51:44 -0000	1.76
@@ -63,7 +63,6 @@
   verbose_msg "mod_v=\"$MOD_VERSION\" mod=\"$MODULES\""
 
   if echo $MODULES | grep -qw moonbase ; then
-    
     # just update moonbase, no other modules
     if ! get_moonbase ; then
       exit 1
@@ -89,17 +88,14 @@
       exit 1
     fi
 
-    if [ ! -n "$TEMP_DOWNLOADLOG" ] ; then
+    if [ -z "$TEMP_DOWNLOADLOG" ] ; then
       export TEMP_DOWNLOADLOG=$(temp_create "download-log")
-    fi
-
-    if [ ! -n "$TEMP_PREPAREDDEPS" ] ; then
       export TEMP_PREPAREDDEPS=$(temp_create "prepared-depends")
     fi
 
     # pass 1 : run full dependency checking
     # This pass does configuration and dependency identification.
-    if ! build_depends $MODULES ; then
+    if ! DEPS_ONLY=--deps build_depends $MODULES ; then
       temp_destroy $TEMP_DOWNLOADLOG
       temp_destroy $TEMP_PREPAREDDEPS
       verbose_msg "Unexpected errors, bailing out!"
@@ -108,33 +104,47 @@
 
     # pass 2 : hit the download manager button and grab a beer
     # this runs as a background process, so we are off to step #3 right away
-    verbose_msg "Spawning download manager"
-    lget $MODULES >> $TEMP_DOWNLOADLOG 2>&1 &
+    if [ -z "$DEPS_ONLY" ] ; then
+      verbose_msg "Spawning download manager"
+      need_source() {(
+        for DEP in $(grep ^$1: $DEPENDS_STATUS | grep :on: | cut -d: -f2) ; do
+	need_source $DEP
+	  if ! module_installed $DEP ; then 
+	    echo $DEP
+	  fi
+	done
+      )}
+      for MODULE in $MODULES ; do
+        LIST="$(need_source $MODULE | uniq) $LIST"
+      done
+      verbose_msg "download queue: $LIST $MODULES"
+      lget $LIST $MODULES >> $TEMP_DOWNLOADLOG 2>&1 &
 
-    # pass 3 : compile/install
-    # no strange stuff should happen here anymore
-    for MODULE in $MODULES ; do
-      if ! module_installed $MODULE || [ ! -n "$PROBE" ] ; then
-        if ! module_held $MODULE ; then
-          linING="/var/lock/installing.$MODULE"
-          if [ -n "$COMPILE" ] || [ -n "$RECONFIGURE" ] || module_installed $MODULE || ! resurrect $MODULE ; then
-	    verbose_msg "starting lin \"$MODULE\""
-            if ! SINGLE_MODULE=1 lin $COMPILE $PROBE $SILENT $MODULE ; then
-              if [ -e "$TMP_LIN_FAIL" ] ; then
-                echo "$MODULE" >> $TMP_LIN_FAIL
-              fi
-              lin_EXIT_STATUS=1;  
-            else
-              if [ -e "$TMP_LIN_SUCCESS" ] ; then
-                echo "$MODULE" >> $TMP_LIN_SUCCESS
+      # pass 3 : compile/install
+      # no strange stuff should happen here anymore
+      for MODULE in $MODULES ; do
+        if ! module_installed $MODULE || [ ! -n "$PROBE" ] ; then
+          if ! module_held $MODULE ; then
+            linING="/var/lock/installing.$MODULE"
+            if [ -n "$COMPILE" ] || [ -n "$RECONFIGURE" ] || module_installed $MODULE || ! resurrect $MODULE ; then
+              verbose_msg "starting lin \"$MODULE\""
+              if ! SINGLE_MODULE=1 lin $COMPILE $PROBE $SILENT $MODULE ; then
+                if [ -e "$TMP_LIN_FAIL" ] ; then
+                  echo "$MODULE" >> $TMP_LIN_FAIL
+                fi
+                lin_EXIT_STATUS=1;  
+              else
+                if [ -e "$TMP_LIN_SUCCESS" ] ; then
+                  echo "$MODULE" >> $TMP_LIN_SUCCESS
+                fi
               fi
             fi
+          else
+            verbose_msg "Skipping compile and install for held module \"$MODULE\""
           fi
-        else
-          verbose_msg "Skipping compile and install for held module \"$MODULE\""
         fi
-      fi
-    done
+      done
+    fi
 
     # cleanups that we need to do
     temp_destroy $TEMP_DOWNLOADLOG
@@ -164,7 +174,8 @@
     fi
 
     run_details $MODULE &&
-    run_depends $MODULE
+    run_depends $MODULE &&
+    satisfy_depends $MODULE
 
     if [ -z "$DEPS_ONLY" ] ; then
       if ! module_held $MODULE ; then

Index: lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/sbin/lunar,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- lunar	17 Mar 2004 23:28:19 -0000	1.28
+++ lunar	21 Mar 2004 20:51:44 -0000	1.29
@@ -387,7 +387,7 @@
                 "Please enter the email address of the person or role account that should receive reports from this box."  \
                 0 0  "$ADMIN"`
   then
-    write_config "ADMIN=" "    ADMIN=$ADMIN"
+    set_local_config "ADMIN" "$ADMIN"
   fi
 }
 
@@ -398,7 +398,7 @@
                              "Please enter the time in seconds to wait for a response when prompted with a question."  \
                               0 0  "$PROMPT_DELAY"`
   then
-    write_config "PROMPT_DELAY=" "PROMPT_DELAY=$PROMPT_DELAY"
+    set_local_config "PROMPT_DELAY" "$PROMPT_DELAY"
   fi
 }
 



More information about the Lunar-commits mailing list