tweeks to make ape's scripts a little more Linux compatible - sad but it allows more configure scripts to run with less pain. -Steve Reference: /n/sources/patch/applied/ape-script-tweeks Date: Tue Jul 26 11:22:47 CES 2011 Signed-off-by: steve@quintile.net --- /rc/bin/ape/grep Tue Jul 26 11:20:58 2011 +++ /rc/bin/ape/grep Tue Jul 26 11:20:55 2011 @@ -7,7 +7,10 @@ argv0=$0 while(! ~ $#* 0){ switch($1){ - case -[cefinsv] + case -e + opts=($opts $1 $2) + shift + case -[cfinsv] opts=($opts $1) case -q opts=($opts -s) --- /rc/bin/ape/ln Tue Jul 26 11:21:04 2011 +++ /rc/bin/ape/ln Tue Jul 26 11:21:00 2011 @@ -15,7 +15,8 @@ shift } -if(~ $force n && test -e $2){ + +if(~ $force n && test -e $2 && ! test -d $2){ echo ln: $2 destination exists >[2=1] exit 'usage' } --- /rc/bin/ape/ls Tue Jul 26 11:21:10 2011 +++ /rc/bin/ape/ls Tue Jul 26 11:21:06 2011 @@ -14,6 +14,7 @@ # -c show ctime # -d dirs # -f no sorting +# -i inode numbers # -l long # -p put slash after dir (-F) # -r reverse @@ -23,7 +24,7 @@ # -1 single-column -flagfmt='A,C,F,H,L,R,U,a,c,d,f,l,p,r,s,t,u,1' +flagfmt='A,C,F,H,L,R,U,a,c,d,f,i,l,p,r,s,t,u,1' args='[file ...]' if(! ifs=() eval `{aux/getflags $*}){ @@ -36,11 +37,16 @@ /$cputype/bin/sed 's/^(.).(.........) . [0-9]+ /\1\2 1 /' } -post=cat +fn qid2inode { + /$cputype/bin/sed 's/^\(([^ ]+).*\) /\1 /' +} + +post1=cat +post2=cat all=() # ignore -A -if(~ $flagC 1) post=mc +if(~ $flagC 1) post1=mc if(~ $flagF 1) all=($all -F) # ignore -H, -L # save -R for later @@ -48,7 +54,8 @@ # ignore -a, -c if(~ $flagd 1) all=($all -d) if(~ $flagf 1) all=($all -n) -if(~ $flagl 1) { all=($all -l); post=fixlong } +if(~ $flagl 1) { all=($all -l); post1=fixlong } +if(~ $flagi 1) { all=($all -q); post2=qid2inode } if(~ $flagp 1) all=($all -F) if(~ $flagr 1) all=($all -r) if(~ $flags 1) all=($all -s) @@ -56,4 +63,4 @@ if(~ $flagu 1) all=($all -u) # ignore -1 -/$cputype/bin/ls $all $* | $post +/$cputype/bin/ls $all $* | $post1 | $post2 --- /rc/bin/ape/psh Tue Jul 26 11:21:16 2011 +++ /rc/bin/ape/psh Tue Jul 26 11:21:12 2011 @@ -7,4 +7,9 @@ bind -b /$cputype/bin/ape /bin if(test -d /$cputype/bin/pub) bind -a /$cputype/bin/pub /bin +if(test -d /$cputype/bin/X11){ + bind -a /$cputype/bin/X11 /bin + DISPLAY=:0.0 +} + /bin/sh $*