[Lunar-commits] <lunar> [FIX] #451: lunar update|renew no longer run autofix and autoprune if update queue is empty

Stefan Wold ratler at lunar-linux.org
Fri Feb 25 20:12:43 CET 2011


commit 03387bada17acf368964ec7bb66194b14d836407
Author: Stefan Wold <ratler at lunar-linux.org>
Date:   Fri Feb 25 20:12:43 2011 +0100

    [FIX] #451: lunar update|renew no longer run autofix and autoprune if update queue is empty
---
 var/lib/lunar/functions/main.lunar    |   25 ++++++++++++++-----------
 var/lib/lunar/functions/modules.lunar |    5 ++++-
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/var/lib/lunar/functions/main.lunar b/var/lib/lunar/functions/main.lunar
index 5229c12..3254204 100644
--- a/var/lib/lunar/functions/main.lunar
+++ b/var/lib/lunar/functions/main.lunar
@@ -30,17 +30,20 @@ renew() {
 
   update_modules
 
-  if [ "$AUTOFIX" == "on" ] ; then
-    message "${MESSAGE_COLOR}Executing AUTOFIX : lunar fix${DEFAULT_COLOR}"
-    run_fix
-  fi
+  # Only run this if there was something to update
+  if [ $? -ne "255" ]; then
+    if [ "$AUTOFIX" == "on" ] ; then
+      message "${MESSAGE_COLOR}Executing AUTOFIX : lunar fix${DEFAULT_COLOR}"
+      run_fix
+    fi
 
-  if [ "$AUTOPRUNE" == "on" ] ; then
-    message "${MESSAGE_COLOR}Executing AUTOPRUNE : lunar prune${DEFAULT_COLOR}"
-    prune
-  fi
+    if [ "$AUTOPRUNE" == "on" ] ; then
+      message "${MESSAGE_COLOR}Executing AUTOPRUNE : lunar prune${DEFAULT_COLOR}"
+      prune
+    fi
 
-  display_update_log renew
+    display_update_log renew
+  fi
 
   temp_destroy $TMP_LIN_SUCCESS
   temp_destroy $TMP_LIN_FAIL
@@ -73,7 +76,7 @@ update() {
   fi
 
   if lin moonbase ; then
-    if (( $(lvu installed $LUNAR_MODULE) < $(lvu version $LUNAR_MODULE) )) 
+    if (( $(lvu installed $LUNAR_MODULE) < $(lvu version $LUNAR_MODULE) ))
     then
       lin $LUNAR_MODULE && lunar renew
     else
@@ -316,7 +319,7 @@ lin_module()  {
       report $COMPILE_LOGS/$MODULE-$VERSION.bz2 "compile log" $MODULE $VERSION
       activity_log  "lin"  "$MODULE"  "$VERSION"  "failed" "Due to build errors during $LIN_ERROR"
       return 1
-    fi  
+    fi
 
     if ! finish_install ; then
       LIN_ERROR="POST_BUILD"
diff --git a/var/lib/lunar/functions/modules.lunar b/var/lib/lunar/functions/modules.lunar
index d8c2831..a0b3f66 100644
--- a/var/lib/lunar/functions/modules.lunar
+++ b/var/lib/lunar/functions/modules.lunar
@@ -603,7 +603,7 @@ update_modules() {
 
   if [ -z "$LIST" ] ; then
     verbose_msg "Nothing to update!"
-    return
+    return 255
   fi
 
   verbose_msg "Sorting update queue"
@@ -625,6 +625,9 @@ update_modules() {
 
   if [ -n "$QUEUE" ] ; then
     lin -c $QUEUE
+  else
+    verbose_msg "Nothing to update!"
+    return 255
   fi
 }
 


More information about the Lunar-commits mailing list