[Lunar-commits] <lunar> Quick resync between theedge->lunar. license fix, zlocal module locator fix, lrm order fix, download url cosmetic fix. lvu diff fix.

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


commit c6c3bf75987fb3afd5d791c6442e326e3ed7652c
Author: Auke Kok <sofar at lunar-linux.org>
Date:   Sat May 27 16:37:19 2006 +0000

    Quick resync between theedge->lunar. license fix, zlocal module locator fix, lrm order fix, download url cosmetic fix. lvu diff fix.
---
 bin/lvu                                |   13 ++++++-------
 sbin/lrm                               |    6 +++---
 var/lib/lunar/functions/download.lunar |    6 +++---
 var/lib/lunar/functions/modules.lunar  |   22 ++++++++++------------
 var/lib/lunar/functions/optimize.lunar |    2 +-
 5 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/bin/lvu b/bin/lvu
index 7bd8532..ffe5c6e 100755
--- a/bin/lvu
+++ b/bin/lvu
@@ -479,12 +479,11 @@ function show_tree() {
     }
     
     debug_msg "run_depends ($@)"
-    SECTION=$(grep "^$1:" $MODULE_INDEX | cut -d: -f2)
+    SECTION=$(find_section $1)
+    SCRIPT_DIRECTORY=$MOONBASE/$SECTION/$1
     CPU_ARCH=$(uname -m | sed 's/i[456]86/i386/')
-    if [ -f $MOONBASE/$SECTION/$1/DEPENDS.$CPU_ARCH ] ; then
-      . $MOONBASE/$SECTION/$1/DEPENDS.$CPU_ARCH
-    elif [ -f $MOONBASE/$SECTION/$1/DEPENDS ] ; then
-      . $MOONBASE/$SECTION/$1/DEPENDS
+    if has_module_file $1 DEPENDS ; then
+      run_module_file $1 DEPENDS
     fi
   }
  
@@ -762,8 +761,8 @@ diff_module() {
 	  message "no local copy of \"$MODULE\" exists"
 	  exit 1
     fi
-	ZSECTION=$(echo $SECTION | sed 's/zlocal/\//g')
-    diff -Nurb $MOONBASE/$NZSECTION/$MODULE $MOONBASE/zlocal/$ZSECTION/$MODULE --exclude ".svn" --exclude "CVS" | sed "s|^\([+-][+-][+-] \)$MOONBASE/[^/]*/|\1|g" | grep -v "^diff " | sed "s|$ZSECTION\/||g"
+	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"
   fi
 }
 
diff --git a/sbin/lrm b/sbin/lrm
index ff2b066..44a92fa 100755
--- a/sbin/lrm
+++ b/sbin/lrm
@@ -182,6 +182,9 @@ lrm_module() {
     verbose_msg "Skipping removal of files completely (REAP=$REAP)"
   fi
 
+  # administration duty time:
+  remove_module $MODULE
+
   # time-out 2: POST_REMOVE
   if [ "$UPGRADE" != "on" ] ; then
     plugin_call BUILD_POST_REMOVE $MODULE
@@ -199,9 +202,6 @@ lrm_module() {
     fi
   fi
 
-  # administration duty time:
-  remove_module $MODULE
-
   message  "${LRM_COLOR}Removed${EXTEMP} module:"  \
            "${MODULE_COLOR}${MODULE}${DEFAULT_COLOR}"
   activity_log  "lrm"  "$MODULE" "$VERSION"  "success"
diff --git a/var/lib/lunar/functions/download.lunar b/var/lib/lunar/functions/download.lunar
index 1182f65..1032c62 100644
--- a/var/lib/lunar/functions/download.lunar
+++ b/var/lib/lunar/functions/download.lunar
@@ -34,7 +34,7 @@ lget_unlock() {
 
 
 download_url() {
-    local RETVAL
+	local RETVAL
 	debug_msg "download_url($@)"
 	verbose_msg "trying to download \"$1/$2\""
 	connect &&
@@ -92,7 +92,7 @@ download_module() {
 			if [ -n "$1" ]; then
 				if ! echo " $ALL_URLS " | grep -q " $1 "; then
 					# make sure the URL has ONE "/" at the end
-					ALL_URLS="$ALL_URLS $(echo "$1/" | sed "s:[/][/]$:/:g")"
+					ALL_URLS="$ALL_URLS $(echo "$1/" | sed "s:[/]*$:/:g")"
 				fi
 			fi
 		}
@@ -129,7 +129,7 @@ download_module() {
 					fi
 				done
 				add_url $LRESORT_URL
-		    fi
+			fi
 
 			for URL in $ALL_URLS; do
 				# and download
diff --git a/var/lib/lunar/functions/modules.lunar b/var/lib/lunar/functions/modules.lunar
index 2dfac45..586ca45 100644
--- a/var/lib/lunar/functions/modules.lunar
+++ b/var/lib/lunar/functions/modules.lunar
@@ -107,19 +107,14 @@ create_module_index() {
     grep "/DETAILS$" $INSTALL_LOGS/moonbase-$(installed_version moonbase) | \
         sed -e 's:/var/lib/lunar/moonbase/::' -e 's:/DETAILS::g' \
         -e 's/\/\([^/]*\)$/:\1/' -e 's/\(.*\):\(.*\)/\2:\1/g' > $TMP_INDEX
-    # we search zlocal locally to make sure they get found:
-    find $MOONBASE/zlocal -type f -name DETAILS | \
-        sed -e "s:$MOONBASE/::g" -e 's:/DETAILS::g' \
-        -e 's/\/\([^/]*\)$/:\1/' -e 's/\(.*\):\(.*\)/\2:\1/g' >> $TMP_INDEX
   else
     # this *really* is the fastest way to do it, no guarantees, we
     # do have to make sure MOONBASE is coherent and tidy though
     debug_msg "Regenerating \$MODULE_INDEX manually..."
-    find $MOONBASE -type f -name DETAILS | \
-        sed -e "s:$MOONBASE/::g" -e 's:/DETAILS::g' \
-        -e 's/\/\([^/]*\)$/:\1/' -e 's/\(.*\):\(.*\)/\2:\1/g' > $TMP_INDEX
+    find $MOONBASE -type f -name DETAILS ! -regex "$MOONBASE/zlocal/.*" \
+        -printf "%h\n" | sed "s:$MOONBASE/::g;s:^\(.*\)/\(.*\)$:\2\:\1:g" > $TMP_INDEX
   fi
-  
+
   # this should be safe enough:
   lock_file $MODULE_INDEX &&
   install -m644 $TMP_INDEX $MODULE_INDEX
@@ -232,7 +227,10 @@ run_details() {
     SOURCE_DIRECTORY=${SOURCE_DIRECTORY:-$BUILD_DIRECTORY/$1-$VERSION}
     MODULE_CONFIG=${MODULE_CONFIG:-$DEPENDS_CONFIG/$MODULE}
     MODULE_PREFIX=${MODULE_PREFIX:-$DEFAULT_PREFIX}
-
+    if [ "$MODULE_PREFIX" != "$DEFAULT_PREFIX" ]; then
+      export PKG_CONFIG_PATH=$MODULE_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
+      export PATH=$PATH:$MODULE_PREFIX/bin
+    fi
     return 0
   fi
 }
@@ -287,7 +285,7 @@ module_license_accepted() {
   #
   # valid licenses currently are:
   # osi == gpl gpl2 lgpl gfdl bsd mpl cc apache artistic qpl
-  
+
   debug_msg "module_license_accepted ($@)"
 
   local L LICENSE IS_OSI
@@ -297,7 +295,7 @@ module_license_accepted() {
     debug_msg "assuming LICENSE=\"osi\""
     LICENSE="osi"
   fi
-  
+
   # check for osi license
   case $LICENSE in
     gpl|gpl2|lgpl|gfdl|bsd|mpl|cc|apache|artistic|qpl|osi)
@@ -312,7 +310,7 @@ module_license_accepted() {
   # * accept "all" will accept anything
   if [[ -n "$ACCEPTED_LICENSES" ]]; then
     for L in $ACCEPTED_LICENSES; do
-      if [[ "$L" == "osi" ]] && "$IS_OSI" == "yes" ]] || [ "$L" == "all" ] || [ "$LICENSE" == "$L" ] ; then
+      if [[ "$L" == "osi" ]] && [[ "$IS_OSI" == "yes" ]] || [ "$L" == "all" ] || [ "$LICENSE" == "$L" ] ; then
         # explicitly accepted license!
 	debug_msg "module_license_accepted: \"$LICENSE\" is explicitly accepted"
         return 0
diff --git a/var/lib/lunar/functions/optimize.lunar b/var/lib/lunar/functions/optimize.lunar
index 03b3919..bd85aaa 100644
--- a/var/lib/lunar/functions/optimize.lunar
+++ b/var/lib/lunar/functions/optimize.lunar
@@ -41,7 +41,7 @@ optimize_menu()
 			$DIALOG --msgbox "There are no configurable compontents. Please update your moonbase!" 6 60
 			return
 		fi
-		PLUGIN=`$DIALOG --cancel-label "Close" --menu "Select a component for which to configure optimizations" 0 0 0 $(plugin_call OPTIMIZE_MENU)`
+		PLUGIN=`$DIALOG --cancel-label "Close" --default-item "$PLUGIN" --menu "Select a component for which to configure optimizations" 0 0 0 $(plugin_call OPTIMIZE_MENU)`
 		if [ $? != 0 ]; then
 			return
 		fi


More information about the Lunar-commits mailing list