summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-08-12 09:51:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:33:20 -0500
commitefd0d2a0daba1e1bf8127aed9a55ddaa2891691d (patch)
treebc14c5f68794137b4c3e915052de49b5e2f7140c
parent597e4234d0ef8e1a7335a6e2b35cb8cced0d7207 (diff)
downloadsamba-efd0d2a0daba1e1bf8127aed9a55ddaa2891691d.tar.gz
samba-efd0d2a0daba1e1bf8127aed9a55ddaa2891691d.tar.bz2
samba-efd0d2a0daba1e1bf8127aed9a55ddaa2891691d.zip
r9260: only overwrite destination files when the temp files was created correct
metze (This used to be commit b5626c978fe3349f0972e1aeea51b05e66c6ce33)
-rwxr-xr-xsource4/script/lex_compile.sh6
-rwxr-xr-xsource4/script/yacc_compile.sh9
2 files changed, 10 insertions, 5 deletions
diff --git a/source4/script/lex_compile.sh b/source4/script/lex_compile.sh
index 09f8253af7..f33a7f0fba 100755
--- a/source4/script/lex_compile.sh
+++ b/source4/script/lex_compile.sh
@@ -18,7 +18,9 @@ if [ -r $DEST ]; then
fi
TOP=`pwd`
if cd $dir && $LEX $file; then
- sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c > $base.c
- rm -f $base.yy.c
+ if [ -r $base.yy.c ];then
+ sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c > $base.c
+ rm -f $base.yy.c
+ fi
fi
cd $TOP
diff --git a/source4/script/yacc_compile.sh b/source4/script/yacc_compile.sh
index 4c87b7c4b7..77b5efb06f 100755
--- a/source4/script/yacc_compile.sh
+++ b/source4/script/yacc_compile.sh
@@ -18,8 +18,11 @@ if [ -r $DEST ]; then
fi
TOP=`pwd`
if cd $dir && $YACC -d $file; then
- sed -e "/^#/!b" -e "s|y\.tab\.h|$base.h|" y.tab.h > $base.h
- sed '/^#/ s|y\.tab\.c|$base.c|' y.tab.c > $base.c
- rm -f y.tab.c y.tab.h
+ if [ -r y.tab.h -a -r y.tab.c ];then
+ echo "move files"
+ sed -e "/^#/!b" -e "s|y\.tab\.h|$base.h|" y.tab.h > $base.h
+ sed '/^#/ s|y\.tab\.c|$base.c|' y.tab.c > $base.c
+ rm -f y.tab.c y.tab.h
+ fi
fi
cd $TOP