[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[patch;tools/apt-selection] Use loggable output for TERM emacs



 I often work inside an XEmacs "M-x term" shell buffer.  The TERM
 variable then is set to "emacs"; it doesn't support the spinner that
 "apt-get" uses in a vt100.

2001-09-25  Karl M. Hegbloom  <karlheg@microsharp.com>

	* tools/apt-selection: Always use the -q switch with apt-get when using emacs TERM.

Index: apt-selection
===================================================================
RCS file: /cvs/debian-boot/debian-cd/tools/apt-selection,v
retrieving revision 1.11
diff -u -u -r1.11 apt-selection
--- tools/apt-selection	2001/06/10 14:56:26	1.11
+++ tools/apt-selection	2001/09/25 18:42:10
@@ -7,6 +7,10 @@
 # Apt doesn't always work ... 
 # set -e
 
+if [ "$TERM" = emacs -o "$TERM" = dumb ]; then
+	q=-q
+fi
+
 # Get the configuration information if necessary
 if [ -z "$CODENAME" -o -z "$ARCH" -o -z "$APTTMP" ]; then
 	if [ -e CONF.sh ]; then
@@ -69,7 +73,7 @@
 
 # Launch the command
 if [ "$1" = "update" -o "$1" = "check" ]; then
-	apt-get $options $@
+	apt-get $q $options $@
 	exit $?
 elif [ "$1" = "cache" ]; then
 	shift
@@ -77,7 +81,7 @@
 	exit $?
 elif [ "$1" = "deselected" ]; then
 	shift
-	apt-get $options -s $@ > $temp
+	apt-get $q $options -s $@ > $temp
 	num=$?
 	#if [ $num -ne 0 ]; then 
 	    #echo ": Param: apt-selection deselected $@" >&2; 
@@ -86,7 +90,7 @@
 	perl -ne 'print "$1\n" if /^Remv (\S+).*/' $temp | sort
 elif [ "$1" = "selected" ]; then
 	shift
-	apt-get $options -s $@ > $temp 
+	apt-get $q $options -s $@ > $temp 
 	num=$?
 	#if [ $num -ne 0 ]; then 
 	#    echo "ERROR: Param: apt-selection selected $@" >&2; 
@@ -94,7 +98,6 @@
 	#fi
 	perl -ne 'print "$1\n" if /^Inst (\S+).*/' $temp | sort
 else
-	apt-get $options -s $@
+	apt-get $q $options -s $@
 	exit $?
 fi
-

-- 
mailto: (Karl M. Hegbloom) karlheg@microsharp.com
http://www.microsharp.com
phone://USA/WA/360-260-2066
jabber: karlheg@jabber.org



Reply to: