[hackers] [wmii] Make sure that the 'read' command exists when running rc.wmii.

From: Kris Maglione <jg_AT_suckless.org>
Date: Sat Apr 14 06:09:15 2007

changeset: 2067:239b41cd3133
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Sat Apr 14 00:07:52 2007 -0400
summary: Make sure that the 'read' command exists when running rc.wmii.

diff -r 29c1ffbc7d86 -r 239b41cd3133 rc/rc.wmii.rc
--- a/rc/rc.wmii.rc Fri Apr 13 19:23:24 2007 -0400
+++ b/rc/rc.wmii.rc Sat Apr 14 00:07:52 2007 -0400
@@ -3,11 +3,6 @@
 
 oldpath=$path
 path=($PLAN9/bin $path)
-
-if(echo $0 | grep -vs '/rc.wmii$') {
- echo Fatal: This file should only be run as rc.wmii >[1=2]
- exit badname
-}
 
 MODKEY=Mod1
 UP=k
@@ -39,6 +34,23 @@ fn config_whatis {
         prog=$1; shift
         echo `{{path=$confpath whatis $prog} | grep -v '=|^fn '} $*
 }
+
+if(echo $0 | grep -vs '/rc.wmii$') {
+ echo Fatal: This file should only be run as rc.wmii >[1=2]
+ exit badname
+}
+
+if(! text -x $PLAN9/read) {
+ echo Can't find the '''read''' command >[1=2]
+ xmessage -file - <<! &
+ exec `{config_whatis wmiirc}
+}
+rc.wmii can't run:
+ You have a Plan 9 utilities installed, but are missing the 'read' command.
+ This likely means that you have an out-of-date 9base installed.
+
+wmiirc will be run instead.
+!
 
 # Source Variables, &c
 local = `{config_whatis rc.wmii.local}
Received on Sat Apr 14 2007 - 06:09:15 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:37 UTC