[Lunar-commits] CVS: theedge/var/lib/lunar/functions modules.lunar, 1.45, 1.46

Auke Kok sofar at lunar-linux.org
Mon Oct 25 19:44:17 UTC 2004


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory espresso.foo-projects.org:/tmp/cvs-serv20232/var/lib/lunar/functions

Modified Files:
	modules.lunar 
Log Message:
generalizing the is_expired code into a per-module function and one that lists all the expired ones in moonbase.


Index: modules.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/modules.lunar,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- modules.lunar	18 Oct 2004 07:28:30 -0000	1.45
+++ modules.lunar	25 Oct 2004 19:44:15 -0000	1.46
@@ -475,28 +475,42 @@
 }
 
 
-# function : list_expired_modules
-# usage    : list_expired_modules
-# purpose  : return a list of modules that need to be updated
-list_expired_modules() {
-  debug_msg "list_expired_modules ($@)"
-  for LINE in $(cat $MODULE_STATUS | grep -v "^moonbase" | sort) ; do
+module_is_expired() {
+  debug_msg "module_is_expired ($@)"
   (
+    if [ -z "$MODULE" ] ; then
+      MODULE=$1
+    fi
+    LINE=$(grep "^$MODULE:" $MODULE_STATUS | grep -v "^moonbase")
     MODULE=$(echo "$LINE" | cut -d: -f1)
     IDATE=$(echo "$LINE" | cut -d: -f2)
     STATUS=$(echo "$LINE" | cut -d: -f3)
     IVERSION=$(echo "$LINE" | cut -d: -f4)
     if run_details $MODULE &> /dev/null ; then
       if [ "$STATUS" == "installed" ] ; then
-        if [ "$VERSION" != "$IVERSION" ] || [ -z "$IDATE" ] || 
-          (( "$UPDATED" > "$IDATE" )) ; then
-          if [ "$MODULE" != "lunar" ] && [ "$MODULE" != "theedge" ] ; then
-            echo $MODULE
-          fi
+        if [ "$VERSION" != "$IVERSION" ] || [ -z "$IDATE" ] ||
+	  (( "$UPDATED" > "$IDATE" )) ; then
+	  if [ "$MODULE" != "lunar" ] && [ "$MODULE" != "theedge" ] ; then
+	    return 0
+	  fi
 	fi
       fi
     fi
+    # nope... it's not expired
+    return -1
   )
+}
+
+
+# function : list_expired_modules
+# usage    : list_expired_modules
+# purpose  : return a list of modules that need to be updated
+list_expired_modules() {
+  debug_msg "list_expired_modules ($@)"
+  for MODULE in $(list_installed) ; do
+    if $(module_is_expired $MODULE) ; then
+      echo "$MODULE"
+    fi
   done
 }
 



More information about the Lunar-commits mailing list