[Lunar-commits] r24008 - in lunar/trunk: sbin var/lib/lunar/functions

Auke Kok sofar at lunar-linux.org
Tue Apr 10 17:00:46 CEST 2007


Author: sofar
Date: 2007-04-10 17:00:46 +0200 (Tue, 10 Apr 2007)
New Revision: 24008

Modified:
   lunar/trunk/sbin/lin
   lunar/trunk/var/lib/lunar/functions/build.lunar
   lunar/trunk/var/lib/lunar/functions/depends.lunar
   lunar/trunk/var/lib/lunar/functions/main.lunar
Log:
[FIX] fix mquery being run twice for non-compatible scripts by saving $OPTS

By saving $OPTS per module at run, we can omit running run_configure() twice
and still have the right $OPTS at compile start ready. We save the values in
a tmpfile and refrain from polluting OPTS with PASS_OPTS by adding values
to --opts without touching $OPTS. Works afaics here just fine.


Modified: lunar/trunk/sbin/lin
===================================================================
--- lunar/trunk/sbin/lin	2007-04-10 14:36:17 UTC (rev 24007)
+++ lunar/trunk/sbin/lin	2007-04-10 15:00:46 UTC (rev 24008)
@@ -86,6 +86,7 @@
     if [ -z "$TEMP_DOWNLOAD_PIDS" ] ; then
       export TEMP_DOWNLOAD_PIDS=$(temp_create "download-pids")
       export TEMP_PREPAREDDEPS=$(temp_create "prepared-depends")
+      export TEMP_CONFIGOPTS=$(temp_create "configopts")
     fi
 
     # pass 1 : run full dependency checking
@@ -113,32 +114,32 @@
       done
       (
           for M in $LIST $MODULES; do
-	      SAFE_M=$(echo $M | md5sum | awk '{print $1}')
+              SAFE_M=$(echo $M | md5sum | awk '{print $1}')
               eval THIS_TEMP=\$TEMP_DOWNLOAD_LOG_$SAFE_M
               lget $M > $THIS_TEMP 2>&1 &
               echo "$M:`jobs -p`:$THIS_TEMP" >> $TEMP_DOWNLOAD_PIDS
               wait
           done
-      ) &    
+      ) &
 
       # pass 3 : compile/install
       # no strange stuff should happen here anymore
       for MODULE in $MODULES ; do
         if ! module_installed $MODULE || [ ! -n "$PROBE" ] || ( [ -n "$PROBE" ] && [ "$PROBE_EXPIRED" == "on" ] && module_is_expired $MODULE ) ; then
-	  # 3 more conditions to stop processing this module:
+          # 3 more conditions to stop processing this module:
           if module_held $MODULE ; then
-	    error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} Skipping compile and install for held module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
+            error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} Skipping compile and install for held module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
             continue
-	  elif module_exiled $MODULE ; then
+          elif module_exiled $MODULE ; then
             error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} Skipping compile and install for exiled module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
             continue
-	  elif ! module_license_accepted $MODULE ; then
-	    error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} The license of module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}${MESSAGE_COLOR} is incompatible with the list of"
+          elif ! module_license_accepted $MODULE ; then
+            error_message "${LRM_COLOR}Notice:${DEFAULT_COLOR}${MESSAGE_COLOR} The license of module ${MODULE_COLOR}$MODULE${DEFAULT_COLOR}${MESSAGE_COLOR} is incompatible with the list of"
             error_message "allowed and/or rejected licenses. Please adjust the ACCEPTED_LICENSES or"
             error_message "REJECTED_LICENSES variables to include or not include the specific"
             error_message "license of this module.${DEFAULT_COLOR}"
             continue
-	  else
+          else
             # we're good now, start installing
             linING="/var/lock/installing.$MODULE"
             verbose_msg "starting lin \"$MODULE\""
@@ -146,7 +147,7 @@
               if [ -e "$TMP_LIN_FAIL" ] ; then
                 echo "$MODULE" >> $TMP_LIN_FAIL
               fi
-              lin_EXIT_STATUS=1;  
+              lin_EXIT_STATUS=1;
             else
               if [ -e "$TMP_LIN_SUCCESS" ] ; then
                 echo "$MODULE" >> $TMP_LIN_SUCCESS
@@ -160,6 +161,7 @@
     # cleanups that we need to do
     temp_destroy $TEMP_DOWNLOAD_PIDS
     temp_destroy $TEMP_PREPAREDDEPS
+    temp_destroy $TEMP_CONFIGOPTS
 
   else
     # we are only doing one module, drop down to:
@@ -173,22 +175,22 @@
     if [ -z "$DEPS_ONLY" ] ; then
       if ! module_held $MODULE ; then
         if [ -n "$PROBE" ] ; then
-	  # --probe install
+          # --probe install
           if ! module_installed $MODULE ; then
             if ! lin_module $MODULE ; then
               temp_destroy $TEMP_PREPAREDDEPS
               exit 1
             fi
-	  elif [ "$PROBE_EXPIRED" == "on" ] && module_is_expired $MODULE ; then
-	    # probe install where module is expired
-	    verbose_msg "module \"$MODULE\" needs to be updated"
-	    if ! SINGLE_MODULE= lin_module $MODULE ; then
-	      temp_destroy $TEMP_PREPAREDDEPS
-	      exit 1
-	    fi	    
+          elif [ "$PROBE_EXPIRED" == "on" ] && module_is_expired $MODULE ; then
+            # probe install where module is expired
+            verbose_msg "module \"$MODULE\" needs to be updated"
+            if ! SINGLE_MODULE= lin_module $MODULE ; then
+              temp_destroy $TEMP_PREPAREDDEPS
+              exit 1
+            fi
           fi
         else
-	  # normal install - not probed
+          # normal install - not probed
           if ! lin_module $MODULE ; then
             temp_destroy $TEMP_PREPAREDDEPS
             exit 1
@@ -199,7 +201,6 @@
       fi
     fi
   fi
-  
 }
 
 

Modified: lunar/trunk/var/lib/lunar/functions/build.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/build.lunar	2007-04-10 14:36:17 UTC (rev 24007)
+++ lunar/trunk/var/lib/lunar/functions/build.lunar	2007-04-10 15:00:46 UTC (rev 24008)
@@ -328,13 +328,15 @@
 
   # add custom passed OPTS before retrieving them
   if [ -n "$PASS_OPTS" ] ; then
-    OPTS="$(get_module_config OPTS) $PASS_OPTS"
-    set_module_config OPTS "$OPTS"
+    SAVE_OPTS="$(get_module_config OPTS) $PASS_OPTS"
+    set_module_config OPTS "$SAVE_OPTS"
   fi
   plugin_call BUILD_CONFIGURE $MODULE
   if has_module_file $MODULE CONFIGURE ; then
     run_module_file $MODULE CONFIGURE
   fi
+  # store $OPTS for later use
+  echo "$MODULE:$OPTS" >> $TEMP_CONFIGOPTS
 }
 
 

Modified: lunar/trunk/var/lib/lunar/functions/depends.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/depends.lunar	2007-04-10 14:36:17 UTC (rev 24007)
+++ lunar/trunk/var/lib/lunar/functions/depends.lunar	2007-04-10 15:00:46 UTC (rev 24008)
@@ -324,7 +324,6 @@
 
 
 build_module_depends() {
-(
   debug_msg "build_module_depends ($@)"
   if [ -n "$DEPS_ONLY" ] ; then
     if ! run_conflicts $1 ; then
@@ -338,11 +337,9 @@
       exit 1
     fi &&
     run_details $1 &&
-    RECONFIGURE= run_configure &&
     RECONFIGURE= run_depends &&
     RECONFIGURE= satisfy_depends
   fi
-)
 }
 
 

Modified: lunar/trunk/var/lib/lunar/functions/main.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/main.lunar	2007-04-10 14:36:17 UTC (rev 24007)
+++ lunar/trunk/var/lib/lunar/functions/main.lunar	2007-04-10 15:00:46 UTC (rev 24008)
@@ -138,7 +138,7 @@
   # the sed trick is advanced: a non-greedy pattern that returns all
   # directory names listed in the input
   for TARGET in $(cat $TMP_TARGETS | sed 's/\/[^\/]*$/\//g' ) ; do
-	if [ ! -d $TARGET ]; then
+    if [ ! -d $TARGET ]; then
       debug_msg "mkdir -p $TARGET"
       mkdir -p $TARGET
     fi
@@ -274,8 +274,9 @@
   run_conflicts               &&
   satisfy_depends             &&
   show_downloading            &&
-  RECONFIGURE= run_configure  &&
 
+  OPTS="`grep ^$MODULE: $TEMP_CONFIGOPTS | cut -d: -f2`"
+
   # last minute source code presence check:
   (
     for SOURCE in $(sources $MODULE) ; do



More information about the Lunar-commits mailing list