From 9dd354c63f2a7b46c399d45b1d4c0bdbbe8d7518 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 27 Jun 2011 12:03:19 -0400 Subject: [PATCH] 5l, 6l, 8l: drop use of ed during build build runs with chmod 0 /bin/ed now R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/4635071 --- doc/install.html | 4 ++-- src/cmd/5l/mkenam | 30 +++++++++++++++--------------- src/cmd/6l/mkenam | 30 +++++++++++++++--------------- src/cmd/8l/mkenam | 30 +++++++++++++++--------------- src/env.bash | 1 - 5 files changed, 47 insertions(+), 48 deletions(-) diff --git a/doc/install.html b/doc/install.html index 2256123ecb8..f2736df57da 100644 --- a/doc/install.html +++ b/doc/install.html @@ -81,8 +81,8 @@ To build it, you need these programs installed:
  • the standard C libraries,
  • the parser generator Bison,
  • GNU make (version 3.81 or later), -
  • awk, and -
  • the text editor ed. +and +
  • awk.

    diff --git a/src/cmd/5l/mkenam b/src/cmd/5l/mkenam index 265cb998880..6cccb02638e 100644 --- a/src/cmd/5l/mkenam +++ b/src/cmd/5l/mkenam @@ -28,18 +28,18 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ed - ../5l/5.out.h <<'!' -v/^ A/d -,s/^ A/ "/ -g/ .*$/s/// -,s/,*$/",/ -1i -char* anames[] = -{ -. -$a -}; -. -w enam.c -Q -! +awk ' +BEGIN { + print "char* anames[] =" + print "{" +} + +/^ A/ { + name=$1 + sub(/,/, "", name) + sub(/^A/, "", name) + print "\t\"" name "\"," +} + +END { print "};" } +' ../5l/5.out.h >enam.c diff --git a/src/cmd/6l/mkenam b/src/cmd/6l/mkenam index 5cabb263337..3001dbe9346 100644 --- a/src/cmd/6l/mkenam +++ b/src/cmd/6l/mkenam @@ -28,18 +28,18 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -/bin/ed - ../6l/6.out.h <<'!' -v/^ A/d -,s/^ A/ "/ -g/ .*$/s/// -,s/,*$/",/ -1i -char* anames[] = -{ -. -$a -}; -. -w enam.c -Q -! +awk ' +BEGIN { + print "char* anames[] =" + print "{" +} + +/^ A/ { + name=$1 + sub(/,/, "", name) + sub(/^A/, "", name) + print "\t\"" name "\"," +} + +END { print "};" } +' ../6l/6.out.h >enam.c diff --git a/src/cmd/8l/mkenam b/src/cmd/8l/mkenam index b33fec7cc40..992aa316073 100644 --- a/src/cmd/8l/mkenam +++ b/src/cmd/8l/mkenam @@ -28,18 +28,18 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ed - ../8l/8.out.h <<'!' -v/^ A/d -,s/^ A/ "/ -g/ .*$/s/// -,s/,*$/",/ -1i -char* anames[] = -{ -. -$a -}; -. -w enam.c -Q -! +awk ' +BEGIN { + print "char* anames[] =" + print "{" +} + +/^ A/ { + name=$1 + sub(/,/, "", name) + sub(/^A/, "", name) + print "\t\"" name "\"," +} + +END { print "};" } +' ../8l/8.out.h >enam.c diff --git a/src/env.bash b/src/env.bash index 19402f30608..1db0daa22b1 100644 --- a/src/env.bash +++ b/src/env.bash @@ -55,7 +55,6 @@ PROGS=" cp cut echo - ed egrep gcc grep