[Lunar-commits] CVS: theedge/var/lib/lunar/menu dmodule.menu, 1.2, 1.3 download.menu, 1.5, 1.6 integrity.menu, 1.2, 1.3 mirrors.menu, 1.2, 1.3 optimize.menu, 1.16, 1.17

Auke Kok sofar at lunar-linux.org
Wed Mar 17 22:58:13 GMT 2004


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

Modified Files:
	dmodule.menu download.menu integrity.menu mirrors.menu 
	optimize.menu 
Log Message:
New config concept: atomic config operations:
- get/set_module_config: get/sets a var for a module
- get_set_local_config: get/sets a var in /etc/lunar/local/config
- rewrote menu's and optimization code to fit (contained a bug sinces
last week resulting in optimize menu's not working properly - fixed)
- tested mildly, the concept is sound but I may have dropped a thread!!!
(This commit is ON THE EDGE. You are warned)
- implemented lunar set [VAR [VAL]] for easy access to system vars
- forgot to recode all of moonbase to use these methods. things break. get over it, or help me fix it in the next weekend.
- gone to bed. sleeping while your boxes die.


Index: dmodule.menu
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/menu/dmodule.menu,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- dmodule.menu	25 Mar 2003 22:25:02 -0000	1.2
+++ dmodule.menu	17 Mar 2004 22:58:11 -0000	1.3
@@ -31,18 +31,17 @@
 The modules MUST exist in the moonbase and MUST meet
 some common criteria. Better do not hack by yourself."
 
- LUNAR_MODULES=`echo "$LUNAR_MODULES" | tr " " "\t"`
+ LUNAR_MODULES=$(echo "$LUNAR_MODULES" | tr " " "\t")
  LUNAR_MODULES=${LUNAR_MODULES:=lunar}
-  LUNAR_MODULE=${LUNAR_MODULE:=lunar}
+ LUNAR_MODULE=${LUNAR_MODULE:=lunar}
 
  unset SDM
- for LUNAR in $LUNAR_MODULES
- do
+ for LUNAR in $LUNAR_MODULES ; do
     [ "$LUNAR" == "$LUNAR_MODULE" ] && ONOFF="on" || ONOFF="off"
     SDM=$SDM"$LUNAR:module:$ONOFF:"
  done
 
- SDM=`echo "$SDM" | tr ":" "\t"`
+ SDM=$(echo "$SDM" | tr ":" "\t")
 
  LUNAR_MODULE=`$DIALOG  --title "Default Lunar Module" \
                         --ok-label  "Commit"           \
@@ -50,7 +49,7 @@
                               "$PROMPT"                \
                                0 0 0 $SDM`
 
- write_config "LUNAR_MODULE=" "LUNAR_MODULE=$LUNAR_MODULE"
+ set_local_config "LUNAR_MODULE" "$LUNAR_MODULE"
 
 }
 

Index: download.menu
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/menu/download.menu,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- download.menu	16 Mar 2003 20:59:51 -0000	1.5
+++ download.menu	17 Mar 2004 22:58:11 -0000	1.6
@@ -49,37 +49,29 @@
 
 confirm_proxy_settings() {
 
-confirm()  {
- $DIALOG  $2  --nocancel  --yesno  "$1"  8 50
-}
-    FINISHED=NO
+  confirm()  {
+    $DIALOG  $2  --nocancel  --yesno  "$1"  8 50
+  }
 
-    while [ "$FINISHED" != "YES" ]
-    do
-      PROMPT="Are these settings correct?"
-      PROMPT="$PROMPT\nHTTP Proxy:  $HPROXY"
-      PROMPT="$PROMPT\n FTP Proxy:  $FPROXY"
-      PROMPT="$PROMPT\n  No Proxy:  $NPROXY"
+  FINISHED=NO
 
-   if confirm "$PROMPT" "--cr-wrap"; then
+  while [ "$FINISHED" != "YES" ] ; do
+    PROMPT="Are these settings correct?"
+    PROMPT="$PROMPT\nHTTP Proxy:  $HPROXY"
+    PROMPT="$PROMPT\n FTP Proxy:  $FPROXY"
+    PROMPT="$PROMPT\n  No Proxy:  $NPROXY"
+
+    if confirm "$PROMPT" "--cr-wrap" ; then
        FINISHED=YES
-   else
+    else
        configure_proxy
        FINISHED=NO
-   fi
-    done
+    fi
+  done
 
-    [ "$HPROXY" != "" ] && 
-      write_config "http_proxy=" "  http_proxy=$HPROXY" ||
-      write_config "http_proxy="
-      
-    [ "$FPROXY" != "" ] && 
-      write_config "ftp_proxy="  "   ftp_proxy=$FPROXY" ||
-      write_config "ftp_proxy="
-      
-    [ "$NPROXY" != "" ] && 
-      write_config "no_proxy="   "    no_proxy=$NPROXY" ||
-      write_config "no_proxy=" 
+  set_local_config "http_proxy" "$HPROXY" 
+  set_local_config "ftp_proxy" "$FPROXY"
+  set_local_config "no_proxy" "$NPROXY"
 }
 
 proxy_exit_message() {
@@ -117,9 +109,7 @@
                               "$PROMPT"               \
                                0 0  "$DOWNLOAD_RATE"`
   then
-    [  -z  "$DOWNLOAD_RATE"          ]  ||
-    [      "$DOWNLOAD_RATE" ==  "0"  ]  ||
-    write_config "DOWNLOAD_RATE=" "DOWNLOAD_RATE=$DOWNLOAD_RATE"
+    set_local_config "DOWNLOAD_RATE" "$DOWNLOAD_RATE"
   fi
 }
 
@@ -133,9 +123,7 @@
                               "$PROMPT"               \
                                0 0  "$CVS_THRESHOLD"`
   then
-    [  -z  "$CVS_THRESHOLD"          ]  ||
-    [      "$DOWNLOAD_RATE" ==  "0"  ]  ||
-    write_config "CVS_THRESHOLD=" "CVS_THRESHOLD=$CVS_THRESHOLD"
+    set_local_config "CVS_THRESHOLD" "$CVS_THRESHOLD"
   fi
 }
 
@@ -174,8 +162,8 @@
       Passive)  FTP_ACTIVE=off
                ;;
    esac
-
-   write_config "FTP_ACTIVE" "   FTP_ACTIVE=$FTP_ACTIVE"
+   
+   set_local_config "FTP_ACTIVE" "$FTP_ACTIVE"
 }
 
 set_partial_downloads(){
@@ -200,11 +188,10 @@
    #lets get rid of " and spaces in the variable
    PARTIAL=`echo $PARTIAL | sed s/\"//g | tr -d " "`
 
-   if [ "$PARTIAL" == "Enable" ]
-   then
-      write_config "CONTINUE" "     CONTINUE=on"     
+   if [ "$PARTIAL" == "Enable" ] ; then
+     set_local_config "CONTINUE" "on"
    else
-      write_config "CONTINUE" "     CONTINUE=off"
+     set_local_config "CONTINUE" "off"
    fi
 }
 
@@ -212,16 +199,15 @@
 
    PROMPT="Please enable/disable the fuzzy download option.
 
-The default behaviour of lget is to try all possible file
-extensions while downloading the files, regardless of the 
-file extension given in DETAILS file. You may disable this
-behaviour if you want to search and download the exact filename
-and extension.
+The default behaviour of lget is to skip all possible file
+extensions while downloading the files.  You may enable this
+behaviour if you want to search and download alternative filenames
+and extensions.
 
 This option can also be set per module basis. Add
 FUZZY=off in DETAILS file :=) or vice-versa."
 
-   FUZZY=${FUZZY:=on}
+   FUZZY=${FUZZY:=off}
 
    FUZZ=`$DIALOG  --title "Fuzzy Downloads" \
                             --ok-label  "Commit" \
@@ -233,11 +219,10 @@
    #lets get rid of " and spaces in the variable
    FUZZ=`echo $FUZZ | sed s/\"//g | tr -d " "`
 
-   if [ "$FUZZ" == "Enable" ]
-   then
-      write_config "FUZZY"  "        FUZZY=on"
+   if [ "$FUZZ" == "Enable" ] ; then
+     set_local_config "FUZZY" "on"
    else
-      write_config "FUZZY"  "        FUZZY=off"        
+     set_local_config "FUZZY" "off"
    fi
 }
 
@@ -264,11 +249,10 @@
    #lets get rid of " and spaces in the variable
    CACHE=`echo $CACHE | sed s/\"//g | tr -d " "`
 
-   if [ "$CACHE" == "Enable" ]
-   then
-      write_config "USE_CACHE" "    USE_CACHE=on"
+   if [ "$CACHE" == "Enable" ] ; then
+     set_local_config "USE_CACHE" "on"
    else
-      write_config "USE_CACHE" "    USE_CACHE=off"
+     set_local_config "USE_CACHE" "off"
    fi
 }
 
@@ -290,8 +274,7 @@
                            "$PROMPT"                \
                             0 0  "$NUM_RETRY"`
   then
-    [  -z  "$NUM_RETRY"          ]  ||
-    write_config "NUM_RETRY=" "    NUM_RETRY=$NUM_RETRY"
+    set_local_config "NUM_RETRY" "$NUM_RETRY"
   fi
 }
 
@@ -315,10 +298,10 @@
 
   EXHAUSTIVE=`echo $EXHAUSTIVE | sed s/\"//g | tr -d " "`
 
-  if [ "$EXHAUSTIVE" == "Enable" ]; then
-    write_config "EXHAUSTIVE" "  EXHAUSTIVE=on"
+  if [ "$EXHAUSTIVE" == "Enable" ] ; then
+    set_local_config "EXHAUSTIVE" "on"
   else
-    write_config "EXHAUSTIVE" "  EXHAUSTIVE=off"
+    set_local_config "EXHAUSTIVE" "off"
   fi
 
 }

Index: integrity.menu
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/menu/integrity.menu,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- integrity.menu	12 Sep 2003 00:33:18 -0000	1.2
+++ integrity.menu	17 Mar 2004 22:58:11 -0000	1.3
@@ -51,10 +51,10 @@
       esac
     done
 
-    write_config "FIND_CHECK="   "  FIND_CHECK=$FIND_CHECK"
-    write_config "MD5SUM_CHECK=" "MD5SUM_CHECK=$MD5SUM_CHECK"
-    write_config "LDD_CHECK="    "   LDD_CHECK=$LDD_CHECK"
-    write_config "SYM_CHECK="    "   SYM_CHECK=$SYM_CHECK"
+    set_local_config "FIND_CHECK" "$FIND_CHECK"
+    set_local_config "LDD_CHECK" "$LDD_CHECK"
+    set_local_config "MD5SUM_CHECK" "$MD5SUM_CHECK"
+    set_local_config "SYM_CHECK" "$SYM_CHECK"
 
   fi
 }

Index: mirrors.menu
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/menu/mirrors.menu,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- mirrors.menu	2 Sep 2002 18:42:36 -0000	1.2
+++ mirrors.menu	17 Mar 2004 22:58:11 -0000	1.3
@@ -80,11 +80,10 @@
          MIRROR_URL=`$DIALOG  --inputbox  "Please enter the URL."  0 0`
       fi
 
-      [ -z "$MIRROR_URL" ] && continue
-
-      write_config "$MIRROR=" "$MIRROR=$MIRROR_URL" &&
-
-      $DIALOG  --msgbox  "$MIRROR=$MIRROR_URL saved in $LOCAL_CONFIG" 8 60
+      if [ -n "$MIRROR_URL" ] ; then
+        set_local_config "$MIRROR" "$MIRROR_URL" &&
+        $DIALOG  --msgbox  "$MIRROR=$MIRROR_URL saved in $LOCAL_CONFIG" 8 60
+      fi
     fi
   done
 }

Index: optimize.menu
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/menu/optimize.menu,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- optimize.menu	19 Oct 2003 04:36:53 -0000	1.16
+++ optimize.menu	17 Mar 2004 22:58:11 -0000	1.17
@@ -1,21 +1,10 @@
 #Copyrighted Jason Johnston  2002 under GPLv2
 
-optimize() {
+set_optimize() {
+
+  GCCVER=${GCCVER:=3}
+  set_local_config "GCCVER" "$GCCVER"
 
-  if ! [[ $COMPILER ]]; then
-     COMPILER=2;
-  fi
-  if ! [[ $GCCVER ]]; then
-     GCCVER=$COMPILER
-  fi
-  if [[ `grep GCCVER /etc/lunar/local/config` ]]; then
-     if [[ $GCCVER == "" ]]; then
-        sedit "s/GCCVER=/GCCVER=$COMPILER/" /etc/lunar/local/config
-     fi
-     sedit "s/GCCVER=[2|3]/GCCVER=$COMPILER/" /etc/lunar/local/config
-  else
-     echo -e GCCVER=$COMPILER >> /etc/lunar/local/config
-  fi
   echo -e PLATFORM=$PLATFORM            '\n'\
           BUILD=$BUILD                  '\n'\
 	  MAKES=$MAKES                  '\n'\
@@ -420,4 +409,5 @@
                         0 0 0                   \
                       "${OPTIONS[@]}"`
    fi
+
 }



More information about the Lunar-commits mailing list