[arch-commits] CVS update of arch/build/base/initscripts (3 files)

Dan McGee dan at archlinux.org
Wed Aug 15 04:02:00 UTC 2007


    Date: Wednesday, August 15, 2007 @ 00:02:00
  Author: dan
    Path: /home/cvs-arch/arch/build/base/initscripts

Modified: PKGBUILD (1.175 -> 1.176) functions (1.11 -> 1.12)
          rc.sysinit (1.108 -> 1.109)

upgpkg: initscripts 2007.08-2


------------+
 PKGBUILD   |   21 ++++++++++-----------
 functions  |   26 +++++++++++++++++++++-----
 rc.sysinit |    4 ++--
 3 files changed, 33 insertions(+), 18 deletions(-)


Index: arch/build/base/initscripts/PKGBUILD
diff -u arch/build/base/initscripts/PKGBUILD:1.175 arch/build/base/initscripts/PKGBUILD:1.176
--- arch/build/base/initscripts/PKGBUILD:1.175	Mon Jul 30 16:24:42 2007
+++ arch/build/base/initscripts/PKGBUILD	Wed Aug 15 00:01:59 2007
@@ -1,27 +1,27 @@
-# $Id: PKGBUILD,v 1.175 2007/07/30 20:24:42 tpowa Exp $
+# $Id: PKGBUILD,v 1.176 2007/08/15 04:01:59 dan Exp $
 # Maintainer: judd <jvinet at zeroflux.org>
 pkgname=initscripts
 pkgver=2007.08
-pkgrel=1
+pkgrel=2
 pkgdesc="System initialization/bootup scripts"
-arch=(i686 x86_64)
+arch=('i686' 'x86_64')
+url="http://www.archlinux.org"
 backup=(etc/inittab etc/rc.conf etc/rc.local etc/rc.local.shutdown)
-depends=('bash' 'awk' 'grep' 'coreutils' 'sed' 'udev>=081')
+depends=('glibc' 'bash' 'awk' 'grep' 'coreutils' 'sed' 'udev>=081')
 install=initscripts.install
 source=(functions inittab rc.conf rc.local rc.multi rc.shutdown \
-        rc.single rc.sysinit network minilogd.c isatty.c netfs makedevs \
+        rc.single rc.sysinit network minilogd.c netfs makedevs \
         netcfg profile-template rc.local.shutdown)
-md5sums=('ec6e98cf3d2e4dfe588175a61015058c'
+md5sums=('b377a66678b6bd9cdbf1a71750860930'
          'b1d53aba3997e2a85cc887da45ec8c0f'
          '9151763518526dffe33a2483b2e9dec3'
          'bd236a57bc00aa4727b98c5ae401c457'
          '3c1f9e4cadc877a0ac65de18b0b7df2c'
          '42367d7e023500775a6db5c738f08ff9'
          'df82de02bc276ed82ead63e776406602'
-         'caf4650b9ecbe8c1cf6f0b90ec60ef8d'
+         '8f9c843418575126c86b083123a69f61'
          'af0896125a451c16cda0b18b416784b9'
          'f638d2a7ecbdb1d0207023ef41621586'
-         'fba6fca3508578fc8b3c0ae1dd509373'
          '5de1b6b4812a83f65ef3fcefc3942217'
          '324f1d8e26d31af0edb172319b839f82'
          '2d308ca2e8efd2d3e9b217575db03390'
@@ -38,11 +38,10 @@
   done
   install -D -m755 network $startdir/pkg/etc/rc.d/network
   install -D -m755 netfs $startdir/pkg/etc/rc.d/netfs
-  gcc -o minilogd minilogd.c || return 1
+  gcc $CFLAGS -o minilogd minilogd.c || return 1
   install -D -m755 minilogd $startdir/pkg/sbin/minilogd
-  gcc -o isatty isatty.c || return 1
-  install -D -m755 isatty $startdir/pkg/bin/isatty
   install -D -m755 netcfg $startdir/pkg/usr/bin/netcfg
   install -D -m755 makedevs $startdir/pkg/sbin/makedevs
   install -D -m600 profile-template $startdir/pkg/etc/network-profiles/template
 }
+
Index: arch/build/base/initscripts/functions
diff -u arch/build/base/initscripts/functions:1.11 arch/build/base/initscripts/functions:1.12
--- arch/build/base/initscripts/functions:1.11	Sun Dec 17 07:53:22 2006
+++ arch/build/base/initscripts/functions	Wed Aug 15 00:01:59 2007
@@ -3,12 +3,25 @@
 # functions
 #
 
-STAT_COL=$[`stty size | awk 'BEGIN { RS=" " }; END { print $1 }'` - 13]
+# width:
+
+STAT_COL=$(stty size)
+# strip the rows number, we just want columns
+STAT_COL=${STAT_COL##* }
+if [ "$STAT_COL" = "0" ]; then
+	# if output was 0 (serial console), set default width to 80
+	STAT_COL=80
+elif [ ! -t 1 ]; then
+	# disable color on output to non-tty
+	STAT_COL=80
+	USECOLOR=""
+fi
+# we use 13 characters for our own stuff
+STAT_COL=$[$STAT_COL - 13]
 
 # colors:
 
 if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then
-
 	C_MAIN="\033[1;37m"       # main text
 	C_OTHER="\033[1;34m"      # prefix & brackets
 	C_SEPARATOR="\033[1;30m"  # separator
@@ -24,8 +37,11 @@
 	C_CLEAR="\033[1;0m"
 fi
 
-SAVE_POSITION="\033[s"
-RESTORE_POSITION="\033[u"
+if [ -t 1 ]; then
+	SAVE_POSITION="\033[s"
+	RESTORE_POSITION="\033[u"
+	DEL_TEXT="\033[$(($STAT_COL+4))G"
+fi
 
 # prefixes:
 
@@ -35,7 +51,7 @@
 # functions:
 
 deltext() {
-	echo -ne "\033[$(($STAT_COL+4))G"
+	echo -ne "$DEL_TEXT"
 }
 
 printhl() {
Index: arch/build/base/initscripts/rc.sysinit
diff -u arch/build/base/initscripts/rc.sysinit:1.108 arch/build/base/initscripts/rc.sysinit:1.109
--- arch/build/base/initscripts/rc.sysinit:1.108	Mon Jul 30 16:24:43 2007
+++ arch/build/base/initscripts/rc.sysinit	Wed Aug 15 00:01:59 2007
@@ -341,7 +341,7 @@
 	/usr/bin/kbd_mode -u
 	/usr/bin/dumpkeys | /bin/loadkeys --unicode
 	# the $CONSOLE check helps us avoid this when running scripts from cron
-	echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a isatty ]; then echo -ne "\e%G"; fi' >>/etc/profile.d/locale.sh
+	echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then echo -ne "\e%G"; fi' >>/etc/profile.d/locale.sh
 	stat_done
 fi
 
@@ -355,7 +355,7 @@
 		fi
 	done
 	# the $CONSOLE check helps us avoid this when running scripts from cron
-	echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a isatty ]; then echo -ne "\e(K"; fi' >>/etc/profile.d/locale.sh
+	echo 'if [ "$CONSOLE" = "" -a "$TERM" = "linux" -a -t 1 ]; then echo -ne "\e(K"; fi' >>/etc/profile.d/locale.sh
 	stat_done
 fi
 # Adding persistent network/cdrom generated rules




More information about the arch-commits mailing list