aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/rc/checkparse
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2020-05-05 08:29:45 -0400
committerRuss Cox <rsc@swtch.com>2020-05-05 08:30:14 -0400
commit601e07b63653d0fed91594ebba261b733d017653 (patch)
treedc96bb79d1d9e773cbe2ba94ed4850bb5d86509f /src/cmd/rc/checkparse
parentff74f7cdda7b08da6fe7c8bbcca990305fd6b547 (diff)
downloadplan9port-601e07b63653d0fed91594ebba261b733d017653.tar.gz
plan9port-601e07b63653d0fed91594ebba261b733d017653.tar.bz2
plan9port-601e07b63653d0fed91594ebba261b733d017653.zip
rc: clean up parser levels, disallow free carats on lists
Diffstat (limited to 'src/cmd/rc/checkparse')
-rwxr-xr-xsrc/cmd/rc/checkparse13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cmd/rc/checkparse b/src/cmd/rc/checkparse
index 1ff84667..0a1472b2 100755
--- a/src/cmd/rc/checkparse
+++ b/src/cmd/rc/checkparse
@@ -1,16 +1,23 @@
#!/bin/bash
+aflag=false
+if [ "$1" = -a ]; then
+ aflag=true
+ shift
+fi
+
files="$@"
if [ $# = 0 ]; then
files=$(echo ./test.rc;
grep -l '^#!/usr/local/plan9/bin/rc' /usr/local/plan9/bin/{*,*/*} 2>/dev/null;
- grep -l '^#!/bin/rc' $HOME/pub/plan9/rc/bin/{*,*/*} 2>/dev/null)
+ grep -R -l '^#!/bin/rc' $HOME/pub/plan9 | egrep -v 'plan9/(lib/(oui|pci)|sys/man|sys/lib/man|sys/lib/scsicodes)' 2>/dev/null)
fi
for i in $files
do
if ! diff <(./o.rc -DY $i 2>&1) <(./o.rc -D $i 2>&1); then
- echo '#' $i
- exit 1
+ echo '^^^' $i
+ ! $aflag && exit 1
fi
done
+