summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-10-25 19:51:38 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:43:33 +0100
commit13d7fbb51aa04a6b5e1f241b74b2e271dbda81bb (patch)
treea163d3f5d7e0cd933b45ead5f75cb79a063a6b36
parent12215fadf8c0122ff9da58ebaab49fde5247d378 (diff)
downloadsamba-13d7fbb51aa04a6b5e1f241b74b2e271dbda81bb.tar.gz
samba-13d7fbb51aa04a6b5e1f241b74b2e271dbda81bb.tar.bz2
samba-13d7fbb51aa04a6b5e1f241b74b2e271dbda81bb.zip
r25733: fix filename substitution and bail out if yacc output isn't generated
metze (This used to be commit 43911e40170176db48ee696c06c92f5fe71f60b8)
-rwxr-xr-xsource4/script/yacc_compile.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/script/yacc_compile.sh b/source4/script/yacc_compile.sh
index c82ef6d686..a56a51da0a 100755
--- a/source4/script/yacc_compile.sh
+++ b/source4/script/yacc_compile.sh
@@ -32,9 +32,12 @@ TOP=`pwd`
if cd $dir && $YACC -d $file; then
if [ -r y.tab.h -a -r y.tab.c ];then
#echo "info: move files"
- sed -e "/^#/!b" -e "/^#/ s|y\.tab\.h|$SRC|" -e "/^#/ s|\"$base.y|\"$SRC|" y.tab.h > $base.h
- sed -e "/^#/ s|y\.tab\.c|$SRC|" -e "/^#/ s|\"$base.y|\"$SRC|" y.tab.c > $base.c
+ sed -e "/^#/!b" -e "s|y\.tab\.h|$SRC|" -e "s|\"$base.y|\"$SRC|" y.tab.h > $base.h
+ sed -e "s|y\.tab\.c|$SRC|" -e "s|\"$base.y|\"$SRC|" y.tab.c > $base.c
rm -f y.tab.c y.tab.h
+ elif [ ! -r $base.h -a ! -r $base.c]; then
+ echo "$base.h nor $base.c generated."
+ exit 1
fi
fi
cd $TOP