xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/remus: fix build in (symlinked) read-only source tree
@ 2010-02-09 13:36 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2010-02-09 13:36 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

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.

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

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-02-09.orig/tools/remus/imqebt/Makefile	2010-01-13 18:58:11.000000000 +0100
+++ 2010-02-09/tools/remus/imqebt/Makefile	2010-02-09 12:12:06.000000000 +0100
@@ -52,11 +52,12 @@ build: $(PROGRAMS)
 # a little scripting for a static binary, making one for ebtables-restore
 # should be completely analogous
 imqebt: extensions/ebt_*.c extensions/ebtable_*.c ebtables.c communication.c ebtables-standalone.c getethertype.c libebtc.c useful_functions.c
-	cp ebtables-standalone.c ebtables-standalone.c_ ; \
-	cp include/ebtables_u.h include/ebtables_u.h_ ; \
-	sed "s/ main(/ pseudomain(/" ebtables-standalone.c > ebtables-standalone.c__ ; \
-	mv ebtables-standalone.c__ ebtables-standalone.c ; \
+	set -e ; \
+	mv ebtables-standalone.c ebtables-standalone.c_ ; \
+	sed "s/ main(/ pseudomain(/" ebtables-standalone.c_ > ebtables-standalone.c ; \
 	printf "\nint main(int argc, char *argv[])\n{\n "  >> ebtables-standalone.c ; \
+	mv include/ebtables_u.h include/ebtables_u.h_ ; \
+	cat include/ebtables_u.h_ >include/ebtables_u.h ; \
 	for arg in $(EXT_FUNC) \
 	; do \
 	sed s/_init/_$${arg}_init/ extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \




[-- Attachment #2: remus-build-ro.patch --]
[-- Type: text/plain, Size: 1469 bytes --]

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.

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

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- 2010-02-09.orig/tools/remus/imqebt/Makefile	2010-01-13 18:58:11.000000000 +0100
+++ 2010-02-09/tools/remus/imqebt/Makefile	2010-02-09 12:12:06.000000000 +0100
@@ -52,11 +52,12 @@ build: $(PROGRAMS)
 # a little scripting for a static binary, making one for ebtables-restore
 # should be completely analogous
 imqebt: extensions/ebt_*.c extensions/ebtable_*.c ebtables.c communication.c ebtables-standalone.c getethertype.c libebtc.c useful_functions.c
-	cp ebtables-standalone.c ebtables-standalone.c_ ; \
-	cp include/ebtables_u.h include/ebtables_u.h_ ; \
-	sed "s/ main(/ pseudomain(/" ebtables-standalone.c > ebtables-standalone.c__ ; \
-	mv ebtables-standalone.c__ ebtables-standalone.c ; \
+	set -e ; \
+	mv ebtables-standalone.c ebtables-standalone.c_ ; \
+	sed "s/ main(/ pseudomain(/" ebtables-standalone.c_ > ebtables-standalone.c ; \
 	printf "\nint main(int argc, char *argv[])\n{\n "  >> ebtables-standalone.c ; \
+	mv include/ebtables_u.h include/ebtables_u.h_ ; \
+	cat include/ebtables_u.h_ >include/ebtables_u.h ; \
 	for arg in $(EXT_FUNC) \
 	; do \
 	sed s/_init/_$${arg}_init/ extensions/ebt_$${arg}.c > extensions/ebt_$${arg}.c_ ; \

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-09 13:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-09 13:36 [PATCH] tools/remus: fix build in (symlinked) read-only source tree Jan Beulich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).