[Lunar-commits] r22712 - lunar/trunk/var/lib/lunar/functions

Chad Kittel v3rt1g0 at lunar-linux.org
Fri Dec 22 23:28:38 CET 2006


Author: v3rt1g0
Date: 2006-12-22 23:28:38 +0100 (Fri, 22 Dec 2006)
New Revision: 22712

Modified:
   lunar/trunk/var/lib/lunar/functions/check.lunar
Log:
  * I didn't feel that lunar _nofix_ should run though the list of modules
    twice.  First to get the list of broken and second time, to do all the work
    again, but just on the broken ones.  So I relocated the conditional that
    checked for NOFIX from inside the fix loop to outside the loop all together

  * I also changed it so that the final "log" that gets printed out
    differentiates between 'fix' and 'nofix'

  * In the svn diff, it looks like a lot changed, but that's only because
    I had to indent things one level deeper to be consistent in format,
    the changes were actually really small.


Modified: lunar/trunk/var/lib/lunar/functions/check.lunar
===================================================================
--- lunar/trunk/var/lib/lunar/functions/check.lunar	2006-12-22 21:13:22 UTC (rev 22711)
+++ lunar/trunk/var/lib/lunar/functions/check.lunar	2006-12-22 22:28:38 UTC (rev 22712)
@@ -119,12 +119,18 @@
 		return
 	fi
 
-	# discover BROKEN modules
-	for MODULE in $MODULES ; do
-		if ! run_checks $MODULE ; then
-			 BROKEN_MODULES=( ${BROKEN_MODULES[@]} $MODULE )
-		fi
-	done
+	# discover BROKEN modules and note them if we plan on fixing them
+	if [[ ! -n "$NOFIX" ]] ; then
+		for MODULE in $MODULES ; do
+			if ! run_checks $MODULE ; then
+				 BROKEN_MODULES=( ${BROKEN_MODULES[@]} $MODULE )
+			fi
+		done
+	else
+		for MODULE in $MODULES ; do
+			run_checks $MODULE
+		done
+	fi
 
 	# if we were called with --fixdepends then we may skip the rest
 	if [ -n "$FIXDEPENDS" ] ; then
@@ -134,30 +140,32 @@
 	export TMP_LIN_SUCCESS=$(temp_create "successful")
 	export TMP_LIN_FAIL=$(temp_create "failed")
 
-	for MODULE in $(sort_by_dependency ${BROKEN_MODULES[@]}) ; do
-		if module_installed $MODULE && ! module_held $MODULE ; then
-			if ! run_checks $MODULE ; then
-				if [[ -n "$NOFIX" ]] ; then
-					continue
-				fi
-				NEVER_ASK=1 DEPS_ONLY= satisfy_depends      &&
-				NEVER_ASK=1 DEPS_ONLY= FIX= satisfy_depends &&
+        if [[ ! -n "$NOFIX" ]] ; then
+		for MODULE in $(sort_by_dependency ${BROKEN_MODULES[@]}) ; do
+			if module_installed $MODULE && ! module_held $MODULE ; then
+				if ! run_checks $MODULE ; then
+					NEVER_ASK=1 DEPS_ONLY= satisfy_depends      &&
+					NEVER_ASK=1 DEPS_ONLY= FIX= satisfy_depends &&
 
-				if ! run_checks $MODULE ; then
-					verbose_msg "Attempting to recompile \"$MODULE\""
-					if ! FIX= lin --compile $MODULE ; then
-						verbose_msg "Attempt to recompile \"$MODULE\" FAILED"
-						continue
-					elif ! run_checks $MODULE ; then
-						verbose_msg "Attempt to recompile \"$MODULE\" succeeded but \"$MODULE\" still is broken!"
-						continue
+					if ! run_checks $MODULE ; then
+						verbose_msg "Attempting to recompile \"$MODULE\""
+						if ! FIX= lin --compile $MODULE ; then
+							verbose_msg "Attempt to recompile \"$MODULE\" FAILED"
+							continue
+						elif ! run_checks $MODULE ; then
+							verbose_msg "Attempt to recompile \"$MODULE\" succeeded but \"$MODULE\" still is broken!"
+							continue
+						fi
 					fi
 				fi
 			fi
-		fi
-	done
+		done
+		
+		display_update_log fix
+	else
+		display_update_log nofix
+	fi
 
-	display_update_log fix
 	temp_destroy $TMP_LIN_SUCCESS
 	temp_destroy $TMP_LIN_FAIL
 }



More information about the Lunar-commits mailing list