From: "Jan Beulich" Subject: [PATCH] tools/remus: fix build in (symlinked) read-only source tree Date: Tue, 09 Feb 2010 13:36:13 +0000 Message-ID: <4B7172DD020000780002E77B@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartEBC1DCDD.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartEBC1DCDD.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- 2010-02-09.orig/tools/remus/imqebt/Makefile 2010-01-13 18:58:11.0000000= 00 +0100 +++ 2010-02-09/tools/remus/imqebt/Makefile 2010-02-09 12:12:06.0000000= 00 +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-stand= alone.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-stan= dalone.c ; \ printf "\nint main(int argc, char *argv[])\n{\n " >> ebtables-stan= dalone.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/eb= t_$${arg}.c_ ; \ --=__PartEBC1DCDD.0__= Content-Type: text/plain; name="remus-build-ro.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="remus-build-ro.patch" Modifying source files should generally be avoided; if it is being=0Adone, = care should at least be taken to not attempt writes to read-only=0Afiles.= =0A=0AOnce at it, also force the whole ugly construct to fail if any of = its=0Acommands fails.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- 2010-02-09.orig/tools/remus/imqebt/Makefile 2010-01-13 = 18:58:11.000000000 +0100=0A+++ 2010-02-09/tools/remus/imqebt/Makefile = 2010-02-09 12:12:06.000000000 +0100=0A@@ -52,11 +52,12 @@ build: $(PROGRAMS= )=0A # a little scripting for a static binary, making one for ebtables-rest= ore=0A # should be completely analogous=0A imqebt: extensions/ebt_*.c = extensions/ebtable_*.c ebtables.c communication.c ebtables-standalone.c = getethertype.c libebtc.c useful_functions.c=0A- cp ebtables-standalone.c = ebtables-standalone.c_ ; \=0A- cp include/ebtables_u.h include/ebtables_u.= h_ ; \=0A- sed "s/ main(/ pseudomain(/" ebtables-standalone.c > = ebtables-standalone.c__ ; \=0A- mv ebtables-standalone.c__ ebtables-standal= one.c ; \=0A+ set -e ; \=0A+ mv ebtables-standalone.c ebtables-standalon= e.c_ ; \=0A+ sed "s/ main(/ pseudomain(/" ebtables-standalone.c_ > = ebtables-standalone.c ; \=0A printf "\nint main(int argc, char = *argv[])\n{\n " >> ebtables-standalone.c ; \=0A+ mv include/ebtables= _u.h include/ebtables_u.h_ ; \=0A+ cat include/ebtables_u.h_ = >include/ebtables_u.h ; \=0A for arg in $(EXT_FUNC) \=0A ; do \=0A = sed s/_init/_$${arg}_init/ extensions/ebt_$${arg}.c > extensions/ebt_$${arg= }.c_ ; \=0A --=__PartEBC1DCDD.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartEBC1DCDD.0__=--