[Lunar-commits] CVS: theedge/var/lib/lunar/functions depends.lunar, 1.30, 1.31 modules.lunar, 1.32, 1.33

Auke Kok sofar at lunar-linux.org
Mon Mar 8 21:33:51 GMT 2004


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory dbguin.lunar-linux.org:/tmp/cvs-serv8061/var/lib/lunar/functions

Modified Files:
	depends.lunar modules.lunar 
Log Message:
Speedups for people running with system moonbases, up to 5x faster regeneration of module.index and depends.cache


Index: depends.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/depends.lunar,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- depends.lunar	7 Mar 2004 23:32:31 -0000	1.30
+++ depends.lunar	8 Mar 2004 21:33:49 -0000	1.31
@@ -336,8 +336,17 @@
       :
     }
 
+    # speedups for system moonbases:
+    if [ "$MOONASE" == "/var/lib/lunar/moonbase" ] ; then
+      DEPFILES=$(grep "/DEPENDS$" $INSTALL_LOGS/moonbase-$(installed_version moonbase))
+      # don't forget zlocal:
+      DEPFILES="$DEPFILES $(find $MOONBASE/zlocal -type f -name DEPENDS)"
+    else
+      DEPFILES=$(find $MOONBASE -type f -name DEPENDS)
+    fi
+
     # fast method for re-creating the depends.cache, might take long though
-    for DEPFILE in $(find $MOONBASE -type f -name DEPENDS) ; do
+    for DEPFILE in $DEPFILES ; do
       MODULE=$(echo $DEPFILE | sed -e "s:$MOONBASE/::g" -e "s:/DEPENDS::g" | cut -d/ -f2-) . $DEPFILE
     done > $TMP_DEP_CACHE &&
     install -m644 $TMP_DEP_CACHE $DEPENDS_CACHE 

Index: modules.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/modules.lunar,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- modules.lunar	7 Mar 2004 23:32:31 -0000	1.32
+++ modules.lunar	8 Mar 2004 21:33:49 -0000	1.33
@@ -98,11 +98,22 @@
   # index file
   TMP_INDEX=$(temp_create "module.index")
 
-  # this *really* is the fastest way to do it, no guarantees, we
-  # do have to make sure MOONBASE is coherent and tidy though
-  echo MOONBASE_MD5:$(set_moonbase_md5) > $TMP_INDEX
-  find $MOONBASE -type f -name DETAILS | sed "s:$MOONBASE/::g" | sed 's|/|:|' | sed 's:/DETAILS::g' | awk -F: '{print $2":"$1}' >> $TMP_INDEX
-
+  # here we have two options: system moonbase or custom:
+  if [ "$MOONBASE" == "/var/lib/lunar/moonbase" ] ; then
+    # short way out:
+    echo MOONBASE_MD5:$(set_moonbase_md5) > $TMP_INDEX
+    grep "/DETAILS$" $INSTALL_LOGS/moonbase-$(installed_version moonbase) | \
+        sed -e 's:/DETAILS$::g' -e 's:/var/lib/lunar/moonbase/::g' | \
+	awk -F: '{print $2":"$1}' >> $TMP_INDEX
+    # we search zlocal locally to make sure they get found:
+    find $MOONBASE/zlocal -type f -name DETAILS | sed "s:$MOONBASE/::g" | sed 's|/|:|' | sed 's:/DETAILS::g' | awk -F: '{print $2":"$1}' >> $TMP_INDEX
+  else
+    # this *really* is the fastest way to do it, no guarantees, we
+    # do have to make sure MOONBASE is coherent and tidy though
+    echo MOONBASE_MD5:$(set_moonbase_md5) > $TMP_INDEX
+    find $MOONBASE -type f -name DETAILS | sed "s:$MOONBASE/::g" | sed 's|/|:|' | sed 's:/DETAILS::g' | awk -F: '{print $2":"$1}' >> $TMP_INDEX
+  fi
+  
   # this should be safe enough:
   lock_file $MODULE_INDEX &&
   install -m644 $TMP_INDEX $MODULE_INDEX



More information about the Lunar-commits mailing list