[Lunar-commits] r20790 - in lunar/branches/stable: bin var/lib/lunar/functions var/lib/lunar/plugins

Auke Kok sofar at lunar-linux.org
Mon Jul 24 16:07:38 UTC 2006


Author: sofar
Date: 2006-07-24 16:07:38 +0000 (Mon, 24 Jul 2006)
New Revision: 20790

Modified:
   lunar/branches/stable/bin/lvu
   lunar/branches/stable/var/lib/lunar/functions/download.lunar
   lunar/branches/stable/var/lib/lunar/functions/modules.lunar
   lunar/branches/stable/var/lib/lunar/plugins/initd.plugin
   lunar/branches/stable/var/lib/lunar/plugins/postbuild-generic.plugin
Log:
Sync with theedge bugfixes:

* fix download display
* fix /zlocal/ modules not being found
* fix gather_docs unsetting LD_PRELOAD
* fix list_sections not showing zlocal sections
* add LUNAR_RESTART_SERVICE global switch (on|off, default on)


Modified: lunar/branches/stable/bin/lvu
===================================================================
--- lunar/branches/stable/bin/lvu	2006-07-24 14:17:31 UTC (rev 20789)
+++ lunar/branches/stable/bin/lvu	2006-07-24 16:07:38 UTC (rev 20790)
@@ -456,7 +456,7 @@
       error_message "${PROBLEM_COLOR}Unable to find module ${MODULE_COLOR}${1}${PROBLEM_COLOR} in ${FILE_COLOR}${MOONBASE}${DEFAULT_COLOR}"
     return 1
   fi
-  
+
   # create dependency tracking file if needed
   if [ -z "$TMP_SEEN" ] ; then
     export TMP_SEEN=$(temp_create "seen")
@@ -477,7 +477,7 @@
       DEP=$(NEVER_ASK=1 unalias $1)
       echo "-$DEP"
     }
-    
+
     debug_msg "run_depends ($@)"
     SECTION=$(find_section $1)
     SCRIPT_DIRECTORY=$MOONBASE/$SECTION/$1
@@ -486,7 +486,7 @@
       run_module_file $1 DEPENDS
     fi
   }
- 
+
   if [ -z "$1" ] ; then
     help
     exit 1

Modified: lunar/branches/stable/var/lib/lunar/functions/download.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/download.lunar	2006-07-24 14:17:31 UTC (rev 20789)
+++ lunar/branches/stable/var/lib/lunar/functions/download.lunar	2006-07-24 16:07:38 UTC (rev 20790)
@@ -36,7 +36,7 @@
 download_url() {
 	local RETVAL
 	debug_msg "download_url($@)"
-	verbose_msg "trying to download \"$1/$2\""
+	verbose_msg "trying to download \"${2}\" from \"${1}\""
 	connect &&
 	plugin_call SOURCE_DOWNLOAD $1 $2 $3
 	RETVAL=$?
@@ -47,7 +47,6 @@
 }
 
 
-
 download_module() {
 (
 	local MAX_SOURCES SRC ALL_URLS URLS URL MLIST ALT REST HIT
@@ -91,8 +90,7 @@
 		add_url() {
 			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 $1"
 				fi
 			fi
 		}

Modified: lunar/branches/stable/var/lib/lunar/functions/modules.lunar
===================================================================
--- lunar/branches/stable/var/lib/lunar/functions/modules.lunar	2006-07-24 14:17:31 UTC (rev 20789)
+++ lunar/branches/stable/var/lib/lunar/functions/modules.lunar	2006-07-24 16:07:38 UTC (rev 20790)
@@ -28,10 +28,11 @@
 # usage    : list_sections
 # purpose  : list the moonbase sections, filter out the specific files
 list_sections() {
-  debug_msg "list_sections ($@)"
-  check_module_index
-  cut -d: -f2 < $MODULE_INDEX | sort | uniq
-  return 0
+	debug_msg "list_sections ($@)"
+	check_module_index
+	cut -d: -f2 < $MODULE_INDEX | sort | uniq
+	find $MOONBASE/zlocal -name DETAILS | sed "s:^$MOONBASE\/::g;s:\/[^\/]*\/DETAILS$::g" | sort | uniq
+	return 0
 }
 
 
@@ -39,19 +40,26 @@
 # usage    : list_modules $SECTION
 # purpose  : list the modules in a section, filter out the specific files
 list_modules() {
-  debug_msg "list_modules ($@)"
-  if [[ -z "$1" ]] ; then
-    error_message "${PROBLEM_COLOR}list_modules(): no SECTION defined!${DEFAULT_COLOR}"
-    exit 1
-  fi
+	debug_msg "list_modules ($@)"
+	if [[ -z "$1" ]] ; then
+		error_message "${PROBLEM_COLOR}list_modules(): no SECTION defined!${DEFAULT_COLOR}"
+		exit 1
+	fi
 
-  if ! grep -q ":$1$" $MODULE_INDEX ; then
-    error_message "${PROBLEM_COLOR}list_modules(): no such section \"$1\"!${DEFAULT_COLOR}"
-    exit 1
-  fi
+	if [[ ! -d $MOONBASE/$1 ]] ; then
+		error_message "${PROBLEM_COLOR}list_modules(): no such section \"$1\"!${DEFAULT_COLOR}"
+		exit 1
+	fi
 
-  grep ":$1$" $MODULE_INDEX | cut -d: -f1
-  return 0
+	if grep -q ":$1$" $MODULE_INDEX; then
+		grep ":$1$" $MODULE_INDEX | cut -d: -f1
+		return 0
+	else
+	 (
+		 cd $MOONBASE/$1
+		 find . -maxdepth 2 -name DETAILS -type f | sed 's/\.\///g;s/\/DETAILS$//g'
+	 )
+	fi
 }
 
 
@@ -59,11 +67,11 @@
 # usage    : list_moonbase
 # purpose  : returns the names of all modules in moonbase
 list_moonbase() {
-  local SECTION
-  debug_msg "list_moonbase ($@)"
-  for SECTION in $(list_sections) ; do
-    list_modules $SECTION
-  done				
+	local SECTION
+	debug_msg "list_moonbase ($@)"
+	for SECTION in $(list_sections) ; do
+		list_modules $SECTION
+	done
 }
 
 
@@ -71,8 +79,8 @@
 # usage    : list_installed
 # purpose  : return a list of installed (or held) modules
 list_installed() {
-  debug_msg "list_installed ($@)"
-  grep -e ":installed:" -e ":held:" $MODULE_STATUS | cut -d: -f1 | sort
+	debug_msg "list_installed ($@)"
+	grep -e ":installed:" -e ":held:" $MODULE_STATUS | cut -d: -f1 | sort
 }
 
 
@@ -156,37 +164,51 @@
 # purpose  : finds the section of a given module as parameter
 # returns  : (0) on success, (1) on failure, errors on stdout
 find_section() {
-  local SECTION SECTIONS
-  debug_msg "find_section ($@)"
+	local SECTION SECTIONS
+	debug_msg "find_section ($@)"
 
-  if [[ "${ZLOCAL_OVERRIDES:-off}" == "on" ]] ; then
-    if SECTION=$(find "$MOONBASE/zlocal/" -type d -name $1 | sed -e "s|$MOONBASE/||;s|/$1$||" ) ; then
-      if [[ -n "$SECTION" ]]; then
-        echo $SECTION
-        return 0
-      fi
-    fi
-  fi
+	# if using ZLOCAL, we must search there first
+	if [[ "${ZLOCAL_OVERRIDES:-off}" == "on" ]] ; then
+		if SECTION=$(find "$MOONBASE/zlocal/" -type d -name $1 | sed -e "s|$MOONBASE/||;s|/$1$||" ) ; then
+			if [[ -n "$SECTION" ]]; then
+				echo $SECTION
+				return 0
+			fi
+		fi
+	fi
 
-  SECTION=$(awk -F: "(\$1==\"$1\"){print \$2;exit 0}" $MODULE_INDEX)
-  if [[ -n "$SECTION" ]] && [[ -d "$MOONBASE/$SECTION/$1" ]] ; then
-    echo "$SECTION"
-    return 0
-  fi
+	# otherwise check for ordinary modules named that way
+	SECTION=$(awk -F: "(\$1==\"$1\"){print \$2;exit 0}" $MODULE_INDEX)
+	if [[ -n "$SECTION" ]] && [[ -d "$MOONBASE/$SECTION/$1" ]] ; then
+		echo "$SECTION"
+		return 0
+	fi
 
-  if ! check_module_index ; then
-    # shave some time off not trying the rest of the code below since that
-    # is useless
-    return 1
-  fi
+	# assuming we're not using ZLOCAL, we haven't looked there yet!
+	# perhaps it's a zlocal module ? search zlocal for it now
+	if SECTION=$(find "$MOONBASE/zlocal/" -type d -name $1 | sed -e "s|$MOONBASE/||;s|/$1$||" ) ; then
+		if [[ -n "$SECTION" ]]; then
+			echo $SECTION
+			return 0
+		fi
+	fi
 
-  SECTION=$(awk -F: "(\$1==\"$1\"){print \$2;exit 0}" $MODULE_INDEX)
-  if [[ -n "$SECTION" ]] && [[ -d "$MOONBASE/$SECTION/$1" ]] ; then
-    echo "$SECTION"
-    return 0
-  fi
+	# still not found? refresh module index... this may take a while
+	if ! check_module_index ; then
+		# shave some time off not trying the rest of the code below since that
+		# is useless
+		return 1
+	fi
 
-  return 1
+	# and search again, this should be quick now
+	SECTION=$(awk -F: "(\$1==\"$1\"){print \$2;exit 0}" $MODULE_INDEX)
+	if [[ -n "$SECTION" ]] && [[ -d "$MOONBASE/$SECTION/$1" ]] ; then
+		echo "$SECTION"
+		return 0
+	fi
+
+	# bummer, not found
+	return 1
 }
 
 

Modified: lunar/branches/stable/var/lib/lunar/plugins/initd.plugin
===================================================================
--- lunar/branches/stable/var/lib/lunar/plugins/initd.plugin	2006-07-24 14:17:31 UTC (rev 20789)
+++ lunar/branches/stable/var/lib/lunar/plugins/initd.plugin	2006-07-24 16:07:38 UTC (rev 20790)
@@ -73,8 +73,10 @@
     CHKCONFIG=`grep '^# chkconfig:' /etc/init.d/$INITDSCRIPT | cut -d : -f 2-2`
     if `echo $CHKCONFIG | grep -q $(/sbin/runlevel | cut -d ' ' -f 2-2) -`
     then
-      ( cd / && /etc/init.d/$INITDSCRIPT stop )
-      ( cd / && /etc/init.d/$INITDSCRIPT start )
+      if [ "${LUNAR_RESTART_SERVICES:=on}" == "on" ]; then
+        ( cd / && /etc/init.d/$INITDSCRIPT stop )
+        ( cd / && /etc/init.d/$INITDSCRIPT start )
+      fi
     fi
 
   done

Modified: lunar/branches/stable/var/lib/lunar/plugins/postbuild-generic.plugin
===================================================================
--- lunar/branches/stable/var/lib/lunar/plugins/postbuild-generic.plugin	2006-07-24 14:17:31 UTC (rev 20789)
+++ lunar/branches/stable/var/lib/lunar/plugins/postbuild-generic.plugin	2006-07-24 16:07:38 UTC (rev 20790)
@@ -38,7 +38,6 @@
   DOC_DIR=${DOCUMENT_DIRECTORY}/${MODULE}
   if [ -d "$SOURCE_DIRECTORY" ] ; then
     cd $SOURCE_DIRECTORY
-    invoke_installwatch
     mkdir -p $DOC_DIR
     # For each parameter that is an existing file
     for FILE in ${@}; do
@@ -48,14 +47,13 @@
         install -D -m 644 ${FILE} ${DOC_DIR}/${FILE}
       elif [ -d ${FILE} ] ; then
         # copy the directory to the docdir
-	verbose_msg "Installing extra documentation to: ${DOC_DIR}/${FILE}"
-	cp -a ${FILE} ${DOC_DIR}/
+        verbose_msg "Installing extra documentation to: ${DOC_DIR}/${FILE}"
+        cp -a ${FILE} ${DOC_DIR}/
       fi
     done
-    devoke_installwatch
-	# do not return 2 here: this function is called directly and
-	# must return true (0) here
-	return 0
+        # do not return 2 here: this function is called directly and
+        # must return true (0) here
+        return 0
   fi
   return 2
 }



More information about the Lunar-commits mailing list