CVS: theedge/var/lib/lunar/functions download.lunar,1.20,1.21

sofar at lunar-linux.org sofar at lunar-linux.org
Sun Jul 20 15:34:38 GMT 2003


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

Modified Files:
	download.lunar 
Log Message:
Fixing lvu search bug, adding full support for svn:// urls, see moonbase/zbeta dor 2 example modules that use svn:// URL's.


Index: download.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/download.lunar,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- download.lunar	17 Jul 2003 20:43:48 -0000	1.20
+++ download.lunar	20 Jul 2003 15:34:36 -0000	1.21
@@ -39,6 +39,9 @@
     exit 1
   fi
 
+  SVN_URL=$(echo $1 | cut -d: -f1-2)
+  SVN_DIR=$(echo $1 | cut -d: -f3)
+
   message  "${MESSAGE_COLOR}Downloading SVN module for" \
  	   "module ${MODULE_COLOR}${MODULE}${DEFAULT_COLOR}"
 
@@ -49,7 +52,7 @@
     verbose_msg "Extracting local SVN copy"
     # unpacking in last component dir of $CVSMODULE
     CD=$(pwd)
-    if ! tar xjf $SOURCE_CACHE/$2 ; then
+    if ! unpack $2 ; then
       message "${PROBLEM_COLOR}Warning: bad local SVN copy, checking out fresh SVN copy${DEFAULT_COLOR}"
       
       rm_source_dir /tmp/$MODULE-$VERSION
@@ -65,12 +68,12 @@
   fi
 
   for (( TRY=1 ; $TRY<$NUM_RETRY+1 ; TRY++ )) ; do
-    if [[ -d $(basename $1).svn ]]; then
-      verbose_msg "[${TRY}] svn up $1"
-      svn up $1 && GOT_SVN="yes" 
-    elif ! [[ -d $(basename $1).svn ]]; then
-      verbose_msg "[${TRY}] svn co $1"
-      svn co $1 && GOT_SVN="yes"
+    if [[ -d ${SVN_DIR}/.svn ]]; then
+      verbose_msg "[${TRY}] svn up $SVN_URL"
+      svn up $SVN_URL && GOT_SVN="yes" 
+    elif ! [[ -d ${SVN_DIR}/.svn ]]; then
+      verbose_msg "[${TRY}] svn co $SVN_URL $SVN_DIR"
+      svn co $SVN_URL $SVN_DIR && GOT_SVN="yes"
     fi
 
     if [[ "$?" == "0" ]]; then
@@ -83,7 +86,7 @@
   if [[ "$GOT_SVN" == "yes" ]]; then
     message "${MESSAGE_COLOR}Creating ${FILE_COLOR}${SOURCE}${DEFAULT_COLOR}"
     # pack in last component dir of $CVSMODULE
-    tar cjf $SOURCE_CACHE/$2 $(basename $1)
+    tar cjf $SOURCE_CACHE/$2 $SVN_DIR
   else
     activity_log "lget"  "$MODULE"  "$VERSION"  "failed" "Could not get $1"
   fi
@@ -130,7 +133,7 @@
     CD=$(pwd)
     mkdir -p $(dirname $CVSMODULE)
     cd $(dirname $CVSMODULE)
-    if ! tar xjf $SOURCE_CACHE/$2 ; then
+    if ! unpack $2 ; then
       message "${PROBLEM_COLOR}Warning: bad local CVS copy, checking out fresh CVS copy${DEFAULT_COLOR}"
       
       rm_source_dir /tmp/$MODULE-$VERSION
@@ -247,52 +250,6 @@
 }
 
 
-disconnect()  {
-
-  if    ps  -C disconnect  >  /dev/null
-  then  return
-  fi
-
-  rm  -f           /tmp/disconnect
-  cat  <<  EOF  >  /tmp/disconnect
-#!/bin/sh
-
-while  ps  -A  |  grep  -q  "lget";  do  sleep  120;  done
-poff
-rm  -f  /tmp/disconnect
-EOF
-
-chmod  a+x  /tmp/disconnect
-            /tmp/disconnect  &
-
-}
-
-
-connect()  {
-
-  if  !  ifconfig  |  grep  -q  "^eth"   &&
-      !  ifconfig  |  grep  -q  "^wlan"  &&
-      !  ifconfig  |  grep  -q  "^ppp"   &&
-      !  ifconfig  |  grep  -q  "^tun";  then
-    pon
-
-    # Timeout in deciseconds to wait for Interface to come up.
-    TIMEOUT=30
-
-    until  ifconfig  |  grep  -q  eth   ||
-           ifconfig  |  grep  -q  ppp   ||
-           [  $TIMEOUT == 0  ]
-    do
-      sleep  10
-      (( TIMEOUT-- ))
-    done
-    disconnect
-
-  fi
-
-}
-
-
 get_url() {
   if  [  -n  "$1"  ] ;  then
     if [ "${1:0:6}" == "cvs://" ] ; then
@@ -407,6 +364,9 @@
       # quit if we did get it
       if `guess_filename $SOURCE_CACHE/$SRC > /dev/null` ; then
         if [ ${URL:0:6} == "cvs://" ] ; then
+	  verbose_msg "trying to download \"$URL\""
+	  get_url $URL $SRC
+	elif [ ${URL:0:6} = "svn://" ] ; then
 	  verbose_msg "trying to download \"$URL\""
 	  get_url $URL $SRC
 	else




More information about the Lunar-commits mailing list