From b15e7316a47b7c3e4ff6f477e270023f1a851a86 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 22 Sep 2007 09:42:38 +0000 Subject: r25297: - fix sed arguments to make the replacement work - always add #include "config.h" in the first line metze (This used to be commit 7939f847bfdda6977e7d04dc5a55e1333ade7b14) --- source4/script/lex_compile.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/script/lex_compile.sh b/source4/script/lex_compile.sh index f655f81f2d..9bba7257b1 100755 --- a/source4/script/lex_compile.sh +++ b/source4/script/lex_compile.sh @@ -35,8 +35,14 @@ if cd $dir && $LEX $ARGS $file; then if [ -r $base.yy.c ];then # we must guarantee that config.h comes first echo "#include \"config.h\"" > $base.c - sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c >> $base.c + sed -e "s|$base\.yy\.c|$DEST|" $base.yy.c >> $base.c rm -f $base.yy.c + elif [ -r $base.c ];then + # we must guarantee that config.h comes first + mv $base.c $base.c.tmp + echo "#include \"config.h\"" > $base.c + sed -e "s|$base\.yy\.c|$DEST|" $base.c.tmp >> $base.c + rm -f $base.c.tmp elif [ ! -r base.c ]; then echo "$base.c nor $base.yy.c generated." exit 1 -- cgit