[Lunar-commits] CVS: theedge/var/lib/lunar/functions build.lunar, 1.18, 1.19 depends.lunar, 1.27, 1.28 download.lunar, 1.38, 1.39 misc.lunar, 1.6, 1.7 tracking.lunar, 1.10, 1.11

Auke Kok sofar at lunar-linux.org
Wed Mar 3 21:51:09 GMT 2004


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

Modified Files:
	build.lunar depends.lunar download.lunar misc.lunar 
	tracking.lunar 
Log Message:
Some slight fixing of the double-questions (not entirely correct still), adding support for a better CPAN system (more work needed). speediefied the tracking part with smart grep.


Index: build.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/build.lunar,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- build.lunar	23 Feb 2004 21:15:53 -0000	1.18
+++ build.lunar	3 Mar 2004 21:51:07 -0000	1.19
@@ -219,6 +219,11 @@
 default_cpan_pre_build() {
   debug_msg "default_cpan_pre_build ($@)"
   mk_source_dir $SOURCE_DIRECTORY
+  cd $SOURCE_DIRECTORY
+  CPAN_MODULE=${SOURCE_URL/cpan:\/\//}
+  CPAN_SOURCE_BRANCH=$(dirname $CPAN_MODULE)
+  mkdir -p authors/id/${CPAN_SOURCE_BRANCH}
+  install -m 444 $SOURCE_CACHE/$SOURCE authors/id/${CPAN_SOURCE_BRANCH}
 }
 
 
@@ -231,29 +236,14 @@
   fi
   
   CPAN_MODULE=${SOURCE_URL/cpan:\/\//}
-  echo "o conf cpan_root /var/state/lunar
+  echo "o conf cpan_root $STATE_DIRECTORY
         o conf build_dir $SOURCE_DIRECTORY
-        o conf keep_source_where $SOURCE_CACHE/cpan
+        o conf keep_source_where $SOURCE_DIRECTORY
 	install $CPAN_MODULE
-	quit" | /usr/bin/cpan
+	quit" | /usr/bin/cpan || exit 1
   RESULT=$?
   rm_source_dir $SOURCE_DIRECTORY
 
-  # some crude checking is done here:
-  debug_msg "verifying installed version of \"$MODULE\""
-  CHECK=$(echo "o conf cpan_root /var/state/lunar 
-  m $CPAN_MODULE" | cpan | grep INST_VERSION | awk '{print $2}')
-  if [ -z "$CHECK" ] ; then
-    message "${PROBLEM_COLOR}Error: nothing was installed!${DEFAULT_COLOR}"
-    return 1
-  elif [ "$CHECK" == "$VERSION" ] ; then
-    message "${MESSAGE_COLOR}CPAN module ${DEFAULT_COLOR}${MODULE_COLOR}$MODULE${DEFAULT_COLOR}${MESSAGE_COLOR} version ${VERSION_COLOR}$VERSION${DEFAULT_COLOR}${MESSAGE_COLOR} installed OK${DEFAULT_COLOR}"
-    return 0
-  else 
-    message "${PROBLEM_COLOR}Warning: ${DEFAULT_COLOR}${MESSAGE_COLOR}Wrong version ${DEFAULT_COLOR}${VERSION_COLOR}$CHECK${DEFAULT_COLOR}${MESSAGE_COLOR}, expected ${DEFAULT_COLOR}${VERSION_COLOR}$VERSION${DEFAULT_COLOR}${MESSAGE_COLOR} for CPAN module ${DEFAULT_COLOR}${MODULE_COLOR}$MODULE${DEFAULT_COLOR}"
-    return 0
-  fi
-  
 } > $C_FIFO 2>&1
 
 

Index: depends.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/depends.lunar,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- depends.lunar	23 Feb 2004 21:15:53 -0000	1.27
+++ depends.lunar	3 Mar 2004 21:51:07 -0000	1.28
@@ -258,7 +258,7 @@
       OPTS="$OPTS $DEP_OFF"
     elif [ "$DEP_STATUS" == "on" ] && ! module_installed $DEP_MODULE && \
         ! module_held $DEP_MODULE ; then
-      if lin $SILENT $COMPILE $DEP_MODULE ; then
+      if lin $DEPS_ONLY $SILENT $COMPILE $DEP_MODULE ; then
         OPTS="$OPTS $DEP_ON"
       else
         exit 1

Index: download.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/download.lunar,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- download.lunar	29 Dec 2003 18:09:42 -0000	1.38
+++ download.lunar	3 Mar 2004 21:51:07 -0000	1.39
@@ -305,7 +305,9 @@
       fi
     elif [ "${1:0:7}" == "cpan://" ] ; then
       # skip CPAN modules here...
-      :
+      URL="$CPAN_URL/${1:7}"
+      FILE=$(basename $URL)
+      get_url $URL $2
     elif [ "${1:0:5}" == "file:" ] ; then
       # adding this since wget is a bitch and will not fetch this... sigh
       # this will copy file to $2... so you may use it as you like
@@ -401,7 +403,8 @@
 	  verbose_msg "trying to download \"$URL\""
 	  get_url $URL $SOURCE_CACHE/$SRC
 	elif [ "${URL:0:6}" == "cpan://" ] ; then
-	  verbose_msg "skipping CPAN downloads!!!"
+	  verbose_msg "trying to download \"$URL\""
+	  get_url $URL $SOURCE_CACHE/$SRC
 	else
 	  verbose_msg "Skipping download of \"$SRC\" for module \"$MODULE\" (in cache)"
 	  continue 2

Index: misc.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/misc.lunar,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- misc.lunar	5 Aug 2003 07:52:07 -0000	1.6
+++ misc.lunar	3 Mar 2004 21:51:07 -0000	1.7
@@ -125,22 +125,16 @@
 filter() {
   debug_msg "filter ($@)"
   if [ -f "$1" ] ; then
-    grep -v $(
-      for DIR in `directories < $1 2>/dev/null` ; do
-        echo -n "^$DIR\|"
-      done
-      for FILE in `files < $1 2>/dev/null` ; do
-        echo -n "^$FILE\$\|"
-      done
-      for SYM in `symlinks < $1 2>/dev/null` ; do
-        echo -n "^$SYM\$\|"
-      done
-      echo -n "/dev/null"
-      )
+    TMP_GREPRE=$(temp_create "fgrep")
+    directories < $1 | sed -e 's:^:^:g' -e 's:$:/:g'   >> $TMP_GREPRE
+    files       < $1 | sed -e 's:^:^:g' -e 's:$:\$:g' >> $TMP_GREPRE
+    symlinks    < $1 | sed -e 's:^:^:g' -e 's:$:\$:g' >> $TMP_GREPRE
+    read
+    grep -v -f $TMP_GREPRE
+    temp_destroy $TMP_GREPRE
   else
     cat
   fi
-
 }
 
 

Index: tracking.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/tracking.lunar,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- tracking.lunar	1 Oct 2003 16:28:46 -0000	1.10
+++ tracking.lunar	3 Mar 2004 21:51:07 -0000	1.11
@@ -70,7 +70,7 @@
 create_install_log() {
 
   debug_msg "create_install_log ($@)"
- mod_v_safe_edit $MODULE
+  mod_v_safe_edit $MODULE
 
   TMP_INST_LOG=$(temp_create "install-log")
   INST_LOG="$INSTALL_LOGS/$MOD_V_SNAME-$VERSION"



More information about the Lunar-commits mailing list