CVS: theedge/bin lvu,1.31,1.32

sofar at lunar-linux.org sofar at lunar-linux.org
Thu Aug 7 09:48:33 GMT 2003


Update of /var/cvs/lunar/theedge/bin
In directory dbguin.lunar-linux.org:/tmp/cvs-serv1519/bin

Modified Files:
	lvu 
Log Message:
Adding uniform parameter passing to lvu, fixing up lvu urls to ignore testpack() and connect(), hooking up --help to lunar, also making it call the proper fix/nofix/fixdepends code. Last merged fixing code into check.lunar, so this is all together in one file and not in install.lunar.


Index: lvu
===================================================================
RCS file: /var/cvs/lunar/theedge/bin/lvu,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- lvu	20 Jul 2003 15:34:36 -0000	1.31
+++ lvu	7 Aug 2003 09:48:31 -0000	1.32
@@ -526,21 +526,13 @@
 
 show_urls() { (
   # function overrides:
-  call_wget() {
-    echo $@
-  }
-  guess_filename() {
-    false
-  }
-  file() {
-    return
-  }
-  mv() {
-    return
-  }
-  get_cvs() {
-    return
-  }
+  call_wget() { echo $@ ; }
+  guess_filename() { false ; }
+  file() { return ; }
+  mv() { return ; }
+  get_cvs() { return ; }
+  testpack() { return ; }
+  connect() { return ; }
  
   SILENT=on
   VERBOSE=off
@@ -560,7 +552,7 @@
 ) }
 
 
-parse()  {
+main()  {
   case $1 in
     html)
       lvu_catalog_html
@@ -892,16 +884,32 @@
 }
 
 
-  # main program loop
-  . /etc/lunar/config
 
+. /etc/lunar/config
+
+GETOPT_ARGS=$(getopt -q -n lvu -o "dhv" -l "debug,help,verbose" -- "$@")
+
+if [ -z "$?" ] ; then
+  help | view_file
+  exit
+else
+  eval set -- $GETOPT_ARGS
+  export IFS="$STANDARD_IFS"
+  
   set_priority
+  
+  while true ; do
+    case "$1" in
+      -d|--debug       ) (( LUNAR_DEBUG++ )) ; export LUNAR_DEBUG ; shift   ;;
+      -h|--help        ) help ; exit                                        ;;
+      -v|--verbose     ) export VERBOSE="on" ;                      shift   ;;
+      --) shift ; break ;;
+      *) help ; break ;;
+    esac
+  done
 
-  if [ $# == 0 ] ; then
-    help | view_file
-  else
-    parse $@
-  fi
+  main $@
+fi
 
 
 




More information about the Lunar-commits mailing list