[Lunar-commits] CVS: theedge/var/lib/lunar/functions aliases.lunar, 1.3, 1.4 depends.lunar, 1.50, 1.51 messages.lunar, 1.23, 1.24

Auke Kok sofar at lunar-linux.org
Thu Apr 21 10:32:27 UTC 2005


Update of /var/cvs/lunar/theedge/var/lib/lunar/functions
In directory espresso.foo-projects.org:/home/sofar/active/theedge/var/lib/lunar/functions

Modified Files:
	aliases.lunar depends.lunar messages.lunar 
Log Message:
Alias fixes: add a 'NEVER_ASK' flag for the two occurences where this is absolutely required: lvu (s)tree and sort_by_dependency. For safety I removed the STDIN pipe to unalias in that function as well. Since sort_by_dependency removes aliases automatically the sort order isn't disturbed, and lvu will show the aliases if they're not installed just the way it should.


Index: aliases.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/aliases.lunar,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- aliases.lunar	13 Apr 2005 09:52:54 -0000	1.3
+++ aliases.lunar	21 Apr 2005 10:32:25 -0000	1.4
@@ -23,11 +23,6 @@
 	return
       fi
     done
-    # shortcut out when not installed and running lvu
-    if [ "$(basename $0)" == "lvu" ] ; then
-      echo $1
-      return
-    fi
     # shortcut out: in the satisfy_depends stage we should NOT ask this again
     if [ -z "$DEPS_ONLY" ] ; then
       # first we check if this dependency is already existant in the exact
@@ -60,6 +55,12 @@
       done
     fi
 
+    # shortcut out when explicitly instructed so
+    if [ -n "$NEVER_ASK" ] ; then
+      echo $1
+      return
+    fi
+
     # propose one and let the user pick it from a list:
     debug_msg "unalias: starting selection loop"
     error_message "${MODULE_COLOR}$MODULE${DEFAULT_COLOR}${MESSAGE_COLOR} depends on ${DEFAULT_COLOR}${QUERY_COLOR}\"${1:1}\"${DEFAULT_COLOR}${MESSAGE_COLOR} which is an alias${DEFAULT_COLOR}"

Index: depends.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/depends.lunar,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- depends.lunar	25 Mar 2005 15:54:17 -0000	1.50
+++ depends.lunar	21 Apr 2005 10:32:25 -0000	1.51
@@ -67,7 +67,16 @@
   done
 
   # tsort the existing dep relations in all of moonbase
-  cat $DEPENDS_CACHE | awk -F: '{print $1" "$2}' | while read A B ; do echo $A $(unalias $B) ; done | tsort 2> /dev/null | tac > $TMP_ALL
+  TMP_TSRT=$(temp_create "dependency.sort")
+  for LINE in $(cat $DEPENDS_CACHE); do
+    A=$(echo $LINE | cut -d: -f1)
+	B=$(echo $LINE | cut -d: -f1)
+    B=$(MODULE=$A NEVER_ASK=1 DEPS_ONLY= unalias $B)
+    echo "$A $B" >> $TMP_TSRT
+  done
+  tsort $TMP_TSRT 2> /dev/null | tac > $TMP_ALL
+  temp_destroy $TMP_TSRT
+
   # append all modules that do not have a DEPENDS file at all at the end
   # note that this is logically WRONG, but it actually will help with
   # unincluded depends, and therefore is *better* behaviour

Index: messages.lunar
===================================================================
RCS file: /var/cvs/lunar/theedge/var/lib/lunar/functions/messages.lunar,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- messages.lunar	18 Apr 2005 11:48:22 -0000	1.23
+++ messages.lunar	21 Apr 2005 10:32:25 -0000	1.24
@@ -52,18 +52,23 @@
 
 debug_msg() {
   if [ -n "$LUNAR_DEBUG" ] ; then
+    if [ "$LUNAR_DEBUG" -ge "2" ] ; then
+	  PLUSSES="+++++++++++++++++++++++++*"
+	  echo -n "${PLUSSES:0:${#FUNCNAME[@]}} " >&2
+	  unset PLUSSES
+	fi
     if [ "$LUNAR_DEBUG" -ge "4" ] ; then
-      PLUSSES="+++++++++++++++++++++++++*"
-      echo "${PLUSSES:0:${#FUNCNAME[@]}} $(basename $0)[$$]: $(basename ${BASH_SOURCE[1]}):${BASH_LINENO[1]}: ${FUNCNAME[1]} ($@)" >&2
-      unset PLUSSES
-    elif [ "$LUNAR_DEBUG" -ge "3" ] ; then
-      PLUSSES="+++++++++++++++++++++++++*"
-      echo "${PLUSSES:0:${#FUNCNAME[@]}} $(basename ${BASH_SOURCE[1]}):${BASH_LINENO[1]}: ${FUNCNAME[1]} ($@)" >&2
-      unset PLUSSES
-    elif [ "$LUNAR_DEBUG" -ge "2" ] ; then
-      PLUSSES="+++++++++++++++++++++++++*"
-      echo "${PLUSSES:0:${#FUNCNAME[@]}} ${FUNCNAME[1]} ($@)" >&2
-      unset PLUSSES
+      echo -n "$(basename $0)[$$]: " >&2
+	fi
+	if [ "$LUNAR_DEBUG" -ge "3" ] ; then
+      echo -n "$(basename ${BASH_SOURCE[1]}):${BASH_LINENO[1]}: " >&2
+	fi
+    if [ "$LUNAR_DEBUG" -ge "2" ] ; then
+	  if [ "${FUNCNAME[1]}" != "$1" ]; then
+	    echo "$@" >&2
+	  else
+        echo "${FUNCNAME[1]} ($@)" >&2
+	  fi
     else
       echo "++ $@" >&2
     fi
@@ -81,6 +86,7 @@
   fi
 }
 
+
 # function : xterm_msg
 # usage : xterm_msg MESSAGE
 # purpose : To display a short message in the title bar of a X terminal



More information about the Lunar-commits mailing list