[Lunar-commits] <lunar> full sync:

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


commit 7ae781cd9f8914eb1be5ac5c789f500ffce0c715
Author: Auke Kok <sofar at lunar-linux.org>
Date:   Tue Mar 6 19:30:33 2007 +0000

    full sync:
    
    API change - mquery extended syntax
    alias code speedups and more verbose printout of choice availability
    lget -w + man page
    lvu diff format update
---
 bin/lvu                                |    4 +++-
 sbin/lget                              |    5 ++++-
 usr/share/man/man8/lget.8              |   14 +++++++++-----
 var/lib/lunar/functions/aliases.lunar  |    6 +++++-
 var/lib/lunar/functions/messages.lunar |    9 ++++++++-
 5 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/bin/lvu b/bin/lvu
index 2ecc69d..daa8036 100755
--- a/bin/lvu
+++ b/bin/lvu
@@ -763,7 +763,9 @@ diff_module() {
 	  exit 1
     fi
 	ZSECTION=$(echo "$SECTION/" | sed 's/^zlocal\///g;s/\/$//')
-    diff -Nurb $MOONBASE/$NZSECTION/$MODULE $MOONBASE/zlocal/$ZSECTION/$MODULE --exclude ".svn" --exclude "CVS" | grep -v "^diff " | sed "s:$MOONBASE/$NZSECTION/::g;s:$MOONBASE/zlocal/$ZSECTION/::g"
+    echo diff a/$NZSECTION/$MODULE b/$NZSECTION/$MODULE
+    diff -Nur $MOONBASE/$NZSECTION/$MODULE $MOONBASE/zlocal/$ZSECTION/$MODULE --exclude ".svn" --exclude "CVS" | \
+    grep -v ^diff | sed "s:$MOONBASE/$NZSECTION/:a/$NZSECTION/:g;s:$MOONBASE/zlocal/$ZSECTION/:b/$NZSECTION/:g"
   fi
 }
 
diff --git a/sbin/lget b/sbin/lget
index 2382fc3..5b83ee9 100755
--- a/sbin/lget
+++ b/sbin/lget
@@ -45,6 +45,8 @@ Optional Parameters:
    -u | --url     URL           Specify an alternate download URL
    -v | --verbose               Increases the level of message output
    -V | --Version               Select specific Version of module to install
+   -w | --want version          Try to download a different version that is
+                                not in moonbase
 EOF
 
   exit  1
@@ -84,7 +86,7 @@ main() {
 
 . /etc/lunar/config
 
-GETOPT_ARGS=$(getopt -q -n lget -o "adf:hu:vV:" -l "all,debug,from:,help,url:,verbose,Version:" -- "$@")
+GETOPT_ARGS=$(getopt -q -n lget -o "adf:hu:vV:w:" -l "all,debug,from:,help,url:,verbose,Version:want:" -- "$@")
 
 if [ -z "$?" ] ; then
   help | view_file
@@ -103,6 +105,7 @@ else
       -h|--help    ) help ;                                     exit  1 ;;
       -u|--url     ) export BASE_URL="$2" ;                     shift 2 ;;
       -v|--verbose ) export VERBOSE="on" ;                      shift   ;;
+      -w|--want    ) export WANT_VERSION=$2 ;                   shift 2 ;;
       --) shift ; break ;;
       *) help ; exit ;;
     esac
diff --git a/usr/share/man/man8/lget.8 b/usr/share/man/man8/lget.8
index 23f6e21..eaa49e6 100644
--- a/usr/share/man/man8/lget.8
+++ b/usr/share/man/man8/lget.8
@@ -9,7 +9,7 @@ module_1 module_2 module_3
 .PP
 .B lget -a|--all
 .PP
-.B lget -d|--debug|-f|--from|-u|--url|-v|--verbose 
+.B lget -d|--debug|-f|--from|-u|--url|-v|--verbose|-w|--want
 module_1 module_2
 .SH COPYRIGHT
 .if n lget(8) is Copyright (C) 2002-2003 Terry Chan with portions copyrighted by previous authors 2001-2002
@@ -41,8 +41,7 @@ This is useful if you have a fast link or want to start your own Lunar source co
 .PP
 Enables debug messages, very useful when emailing a bug report.
 .TP
-.B lget
--f|--from path/dir
+.B lget -f|--from path/dir
 .PP
 This specifies a different
 .I /var/spool/lunar
@@ -52,12 +51,17 @@ directory. This is the default location for downloaded sources.
 .PP
 Outputs short help.
 .TP
-.B lget
--u|--url URL module_1
+.B lget -u|--url URL module_1
 .PP
 This tries to download the specified module from a different location. This is
 useful if the original link is down.
 .TP
+.B lget -w|--want version
+.PP
+Attempt to download version version of the module by substituting the current
+version of the module with the wanted version. May fail if the package requires
+more than one file download, or other reasons.
+.TP
 .B lget -v|--verbose
 .PP
 Increases the level of message output
diff --git a/var/lib/lunar/functions/aliases.lunar b/var/lib/lunar/functions/aliases.lunar
index 7e31a05..53ebb45 100644
--- a/var/lib/lunar/functions/aliases.lunar
+++ b/var/lib/lunar/functions/aliases.lunar
@@ -54,7 +54,11 @@ unalias() {
     for TARGET in $TARGETS ; do
       ((N++))
       TARGETBYNUM[$N]=$TARGET
-      error_message "  ${QUERY_COLOR}$N${MESSAGE_COLOR} - ${DEFAULT_COLOR}${MODULE_COLOR}$TARGET${DEFAULT_COLOR}"
+      if module_installed $TARGET ; then
+        error_message "  ${QUERY_COLOR}$N${MESSAGE_COLOR} - ${DEFAULT_COLOR}${MODULE_COLOR}$TARGET${DEFAULT_COLOR} ${LRM_COLOR}(Installed)${DEFAULT_COLOR}"
+      else
+        error_message "  ${QUERY_COLOR}$N${MESSAGE_COLOR} - ${DEFAULT_COLOR}${MODULE_COLOR}$TARGET${DEFAULT_COLOR} ${MESSAGE_COLOR}(Not installed)${DEFAULT_COLOR}"
+      fi
     done
     read CHOICE
     # test directly first
diff --git a/var/lib/lunar/functions/messages.lunar b/var/lib/lunar/functions/messages.lunar
index 2d587dd..fcbfe39 100644
--- a/var/lib/lunar/functions/messages.lunar
+++ b/var/lib/lunar/functions/messages.lunar
@@ -167,8 +167,9 @@ query() {
 
 # mquery is a wrapper to autodetect if a certain y/n parameter in a module
 # config is not set yet and handles the case in a single function
-# usage: mqeury USE_LILO "Use lilo instead of grub" ?
+# usage: mquery USE_LILO "Use lilo instead of grub ?" y [yesopts] [noopts]
 # note : $MODULE must be set properly
+# note : both [yesopts] and [noopts] may be empty or ""
 mquery()
 {
     debug_msg "mquery ($@)"
@@ -181,6 +182,12 @@ mquery()
                 set_module_config "$1" n
             fi
         fi
+        # and lookup the result in case of yes/no opts
+        if [ $(get_module_config $1) == "y" ] ; then
+            OPTS="$OPTS $4"
+        else
+            OPTS="$OPTS $5"
+        fi
     fi
 }
 


More information about the Lunar-commits mailing list