debuggers.hg

changeset 20965:10a54ab63607

tools/remus: fix build in (symlinked) read-only source tree

Modifying source files should generally be avoided; if it is being
done, care should at least be taken to not attempt writes to read-only
files.

While at it, also force the whole ugly construct to fail if any of its
commands fails.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Feb 10 09:19:16 2010 +0000 (2010-02-10)
parents a3fa6d444b25
children 83a6621b91bf
files tools/remus/imqebt/Makefile
line diff
     1.1 --- a/tools/remus/imqebt/Makefile	Wed Feb 10 09:18:43 2010 +0000
     1.2 +++ b/tools/remus/imqebt/Makefile	Wed Feb 10 09:19:16 2010 +0000
     1.3 @@ -52,11 +52,12 @@ build: $(PROGRAMS)
     1.4  # a little scripting for a static binary, making one for ebtables-restore
     1.5  # should be completely analogous
     1.6  imqebt: extensions/ebt_*.c extensions/ebtable_*.c ebtables.c communication.c ebtables-standalone.c getethertype.c libebtc.c useful_functions.c
     1.7 -	cp ebtables-standalone.c ebtables-standalone.c_ ; \
     1.8 -	cp include/ebtables_u.h include/ebtables_u.h_ ; \
     1.9 -	sed "s/ main(/ pseudomain(/" ebtables-standalone.c > ebtables-standalone.c__ ; \
    1.10 -	mv ebtables-standalone.c__ ebtables-standalone.c ; \
    1.11 +	set -e ; \
    1.12 +	mv ebtables-standalone.c ebtables-standalone.c_ ; \
    1.13 +	sed "s/ main(/ pseudomain(/" ebtables-standalone.c_ > ebtables-standalone.c ; \
    1.14  	printf "\nint main(int argc, char *argv[])\n{\n "  >> ebtables-standalone.c ; \
    1.15 +	mv include/ebtables_u.h include/ebtables_u.h_ ; \
    1.16 +	cat include/ebtables_u.h_ >include/ebtables_u.h ; \
    1.17  	for arg in $(EXT_FUNC) \
    1.18  	; do \
    1.19  	sed s/_init/_$${arg}_init/ extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \