summary refs log tree commit diff
path: root/debian/bsdyacc
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:32:28 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2005-09-26 18:32:28 +1000
commit05c1076ba2d1a68fe7f3a5ae618f786b8898d327 (patch)
tree8e3b5ecace201bfd29027ccb59110cc1d600ad37 /debian/bsdyacc
downloaddash-05c1076ba2d1a68fe7f3a5ae618f786b8898d327.tar.gz
dash-05c1076ba2d1a68fe7f3a5ae618f786b8898d327.zip
Initial import.
Diffstat (limited to 'debian/bsdyacc')
-rw-r--r--debian/bsdyacc20
1 files changed, 20 insertions, 0 deletions
diff --git a/debian/bsdyacc b/debian/bsdyacc
new file mode 100644
index 0000000..ce71f4c
--- /dev/null
+++ b/debian/bsdyacc
@@ -0,0 +1,20 @@
+#!/bin/sh -e
+
+if echo "$@" | grep -q -- -o; then
+	OUTPUT=$(echo "$@" |
+		 sed 's/.*-o[[:blank:]]\+\([^[:blank:]]\+\)\.c.*/\1/')
+	OPTIONS=$(echo "$@" |
+		 sed 's/\(.*\)-o[[:blank:]]\+[^[:blank:]]\+\(.*\)/\1\2/')
+	NEW=1
+else
+	OUTPUT=$(echo "$@" |
+		 sed -e 's/.*[[:blank:]]\+\([^[:blank:]]\+\)\.y.*/\1/')
+	OPTIONS="$@"
+	NEW=0
+fi
+
+byacc $OPTIONS
+if [ $NEW = 1 ]; then
+	mv y.tab.c $OUTPUT.c
+fi
+mv y.tab.h $OUTPUT.h