[Lunar-commits] <lunar> Merge from theedge: minor fixes only.

Auke Kok sofar at lunar-linux.org
Mon Jul 2 04:43:16 CEST 2012


commit 7b703d19869544b6dcdb4102e31a833b01cc23df
Author: Auke Kok <sofar at lunar-linux.org>
Date:   Tue Apr 1 21:55:50 2008 +0000

    Merge from theedge: minor fixes only.
---
 sbin/lin                             |    3 ++-
 var/lib/lunar/functions/config.lunar |   12 ++++++----
 var/lib/lunar/menu/download.menu     |   44 +++++++++++++++++-----------------
 3 files changed, 31 insertions(+), 28 deletions(-)

diff --git a/sbin/lin b/sbin/lin
index a878576..26d10f1 100755
--- a/sbin/lin
+++ b/sbin/lin
@@ -86,14 +86,15 @@ main() {
     if [ -z "$TEMP_DOWNLOAD_PIDS" ] ; then
       export TEMP_DOWNLOAD_PIDS=$(temp_create "download-pids")
       export TEMP_PREPAREDDEPS=$(temp_create "prepared-depends")
-      export TEMP_CONFIGOPTS=$(temp_create "configopts")
     fi
+    export TEMP_CONFIGOPTS=$(temp_create "configopts")
 
     # pass 1 : run full dependency checking
     # This pass does configuration and dependency identification.
     if ! DEPS_ONLY=--deps build_depends $MODULES ; then
       temp_destroy $TEMP_DOWNLOAD_PIDS
       temp_destroy $TEMP_PREPAREDDEPS
+      temp_destroy $TEMP_CONFIGOPTS
       verbose_msg "Unexpected errors, bailing out!"
       exit 1
     fi
diff --git a/var/lib/lunar/functions/config.lunar b/var/lib/lunar/functions/config.lunar
index bd2dc9f..ad8fb6c 100644
--- a/var/lib/lunar/functions/config.lunar
+++ b/var/lib/lunar/functions/config.lunar
@@ -23,9 +23,13 @@ set_config()
 	local LINE NEW FILE VAR
 	debug_msg "set_config ($@)"
 
-	LINE=$(grep -w "$2=.*" $1)
+	# remove leading/trailing whitespace
+	VAR=${2#"${2%%[![:space:]]*}"}
+	VAR=${VAR%%+([[:space:]])}
+
+	LINE=$(grep -w "$VAR=.*" $1)
 	FILE=$1
-	VAR=$2
+
 	shift 2
 	if [ "$FILE" == "$LOCAL_CONFIG" ] ; then
 		NEW="$(printf "%16s" "$VAR")=\"$@\""
@@ -40,9 +44,7 @@ set_config()
 
 	lock_file $FILE &&
 	if [ -n "$LINE" ] ; then
-		# make sure we escape those ':' characters:
-		LINE=$(echo $LINE | sed 's/:/\\:/g')
-		sedit "/[^ ]$VAR=/d" $FILE
+		sedit "/^\s*$VAR=/d" $FILE
 	fi
 	echo "$NEW" >> $FILE
 	unlock_file $FILE
diff --git a/var/lib/lunar/menu/download.menu b/var/lib/lunar/menu/download.menu
index 2fd0442..9805a7f 100644
--- a/var/lib/lunar/menu/download.menu
+++ b/var/lib/lunar/menu/download.menu
@@ -113,17 +113,17 @@ Example: enter 8000 for downloading no faster then \
   fi
 }
 
-set_cvs_threshold()  {
-  PROMPT="Please enter the minimum time between CVS updates in minutes, \
+set_repository_threshold()  {
+  PROMPT="Please enter the minimum time between repository updates in minutes, \
 enter 0 for no threshold. Default threshold is 10 minutes"
 
-  if  CVS_THRESHOLD=`$DIALOG  --title "CVS threshold" \
+  if  REPOSITORY_THRESHOLD=`$DIALOG  --title "Repository threshold" \
                               --ok-label  "Commit"    \
                               --inputbox              \
                               "$PROMPT"               \
-                               0 0  "$CVS_THRESHOLD"`
+                               0 0  "$REPOSITORY_THRESHOLD"`
   then
-    set_local_config "CVS_THRESHOLD" "$CVS_THRESHOLD"
+    set_local_config "REPOSITORY_THRESHOLD" "$REPOSITORY_THRESHOLD"
   fi
 }
 
@@ -286,7 +286,7 @@ while
     R_HELP="Per process download rate"
     P_HELP="Proxy Settings"
     E_HELP="Test all mirrors available on download"
-    T_HELP="CVS update threshold time"
+    T_HELP="Repository update threshold time"
 
     COMMAND=`$DIALOG  --title "Download Options"               \
                       --item-help                              \
@@ -295,25 +295,25 @@ while
                       --menu                                   \
                       ""                                       \
                       0 40 8                                   \
-                      "A"  "Ftp Active/Passive"     "$A_HELP"  \
-                      "C"  "Partial Downloads"      "$C_HELP"  \
-                      "H"  "Cache Usage"            "$H_HELP"  \
-                      "N"  "Number of Retries"      "$N_HELP"  \
-                      "P"  "Proxies"                "$P_HELP"  \
-                      "R"  "Download Rate"          "$R_HELP"  \
-		      "E"  "Exhaustive mirrors"     "$E_HELP"  \
-		      "T"  "CVS update threshold"   "$T_HELP"`
+                      "A"  "Ftp Active/Passive"          "$A_HELP"  \
+                      "C"  "Partial Downloads"           "$C_HELP"  \
+                      "H"  "Cache Usage"                 "$H_HELP"  \
+                      "N"  "Number of Retries"           "$N_HELP"  \
+                      "P"  "Proxies"                     "$P_HELP"  \
+                      "R"  "Download Rate"               "$R_HELP"  \
+		      "E"  "Exhaustive mirrors"          "$E_HELP"  \
+		      "T"  "Repository update threshold" "$T_HELP"`
 
   do
     case  $COMMAND in
-      A)  set_ftp_active         ;;
-      C)  set_partial_downloads  ;;
-      H)  set_cache_usage        ;;
-      N)  set_retries            ;;
-      P)  proxy_menu             ;;
-      R)  set_download_rate      ;;
-      E)  set_exhaustive         ;;
-      T)  set_cvs_threshold      ;;
+      A)  set_ftp_active           ;;
+      C)  set_partial_downloads    ;;
+      H)  set_cache_usage          ;;
+      N)  set_retries              ;;
+      P)  proxy_menu               ;;
+      R)  set_download_rate        ;;
+      E)  set_exhaustive           ;;
+      T)  set_repository_threshold ;;
     esac
   done
 }


More information about the Lunar-commits mailing list