All of lore.kernel.org
 help / color / mirror / Atom feed
From: Horms <horms@verge.net.au>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: Magnus Damm <magnus@valinux.co.jp>, xen-devel@lists.xensource.com
Subject: Re: [PATCH 11/11] build: Don't assume that mkbuildtree is executable
Date: Tue, 11 Apr 2006 17:50:33 +0900	[thread overview]
Message-ID: <20060411085031.GJ17513@verge.net.au> (raw)
In-Reply-To: <006d95f04460cc89da1845d12d8a16f7@cl.cam.ac.uk>

On Tue, Apr 11, 2006 at 09:26:29AM +0100, Keir Fraser wrote:
> 
> On 11 Apr 2006, at 02:23, Horms wrote:
> 
> >>>I couldn't decide btween chmoding mkbuildtree, which changes
> >>>the tree, and running sh mkbuildtree, which assumes its a shell
> >>>script. I settled on the latter.
> >>
> >>The scripts need bash and sh may not be bash?
> >
> >Would you like me to look through the scripts for bashisms,
> >and perhaps change sh to bash, or just go with the chmod u+x approach?
> 
> I think all the scripts currently specify /bin/bash. You could define 
> SHELL or SH in Config.mk, default to /bin/bash, and use that variable 
> in place of 'sh'.

Understood, if they are indeed all using /bin/bash at the moment.  It
seems as well to just specify bash. It can be made more flexible if the
need arises. Here is an updated patch.

-- 
Horms

# HG changeset patch
# User Horms <horms@verge.net.au>
# Node ID f69f52013d13de62aa66bebfbab511ccebbfe222
# Parent  491d06219ffdc9e9b99a483fe948970b75d52e06
build: Don't assume that mkbuildtree is executable

In some cases, say for instance for some bizzare reason
the tree was checked out of CVS, which doens't neccessarily
store file permissions, mkbuildtree may not be executable.

I couldn't decide btween chmoding mkbuildtree, which changes
the tree, and running sh mkbuildtree, which assumes its a shell
script. I settled on the latter.

Amendum: All the scripts currently specify /bin/bash, so 
use bash rather than sh which was in the original version of this
patch.

Signed-Off-By: Horms <horms@verge.net.au>

diff -r 491d06219ffd -r f69f52013d13 buildconfigs/Rules.mk
--- a/buildconfigs/Rules.mk	Thu Mar 30 15:16:40 2006 +0900
+++ b/buildconfigs/Rules.mk	Thu Mar 30 15:21:11 2006 +0900
@@ -121,14 +121,14 @@ linux-2.6-xen.patch: ref-linux-$(LINUX_V
 linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
 	rm -rf tmp-$@
 	cp -al $(<D) tmp-$@
-	( cd linux-2.6-xen-sparse && ./mkbuildtree ../tmp-$@ )	
+	( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )	
 	diff -Nurp $(<D) tmp-$@ > $@ || true
 	rm -rf tmp-$@
 
 %-xen.patch: ref-%/.valid-ref
 	rm -rf tmp-$@
 	cp -al $(<D) tmp-$@
-	( cd $*-xen-sparse && ./mkbuildtree ../tmp-$@ )	
+	( cd $*-xen-sparse && bash ./mkbuildtree ../tmp-$@ )	
 	diff -Nurp $(<D) tmp-$@ > $@ || true
 	rm -rf tmp-$@
 
diff -r 491d06219ffd -r f69f52013d13 buildconfigs/mk.linux-2.6-xen
--- a/buildconfigs/mk.linux-2.6-xen	Thu Mar 30 15:16:40 2006 +0900
+++ b/buildconfigs/mk.linux-2.6-xen	Thu Mar 30 15:21:11 2006 +0900
@@ -23,8 +23,8 @@ build: $(LINUX_DIR)/include/linux/autoco
 	rm -rf $(LINUX_DIR)
 	cp -al $(<D) $(LINUX_DIR)
 	# Apply arch-xen patches
-	( cd linux-$(LINUX_SERIES)-xen-sparse ; \
-          LINUX_ARCH=$(LINUX_ARCH) ./mkbuildtree ../$(LINUX_DIR) )
+	( cd linux-$(LINUX_SERIES)-xen-sparse && \
+          LINUX_ARCH=$(LINUX_ARCH) bash ./mkbuildtree ../$(LINUX_DIR) )
 	# Re-use config from install dir if one exits else use default config
 	CONFIG_VERSION=$$(sed -ne 's/^EXTRAVERSION = //p' $(LINUX_DIR)/Makefile); \
 	[ -r $(DESTDIR)/boot/config-$(LINUX_VER)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \
diff -r 491d06219ffd -r f69f52013d13 linux-2.6-xen-sparse/mkbuildtree
--- a/linux-2.6-xen-sparse/mkbuildtree	Thu Mar 30 15:16:40 2006 +0900
+++ b/linux-2.6-xen-sparse/mkbuildtree	Thu Mar 30 15:21:11 2006 +0900
@@ -90,8 +90,8 @@ RS=$DESTPATH
 RS=$DESTPATH
 
 # Arch-specific pre-processing
-if [ -x arch/${LINUX_ARCH}/xen-mkbuildtree-pre ]; then
-	arch/${LINUX_ARCH}/xen-mkbuildtree-pre
+if [ -e arch/${LINUX_ARCH}/xen-mkbuildtree-pre ]; then
+	bash arch/${LINUX_ARCH}/xen-mkbuildtree-pre
 fi
 
 # Remove old copies of files and directories at the destination
@@ -115,6 +115,6 @@ relative_lndir ../../../${RS}/../xen/inc
 
 # Arch-specific post-processing
 cd ${AD}
-if [ -x arch/${LINUX_ARCH}/xen-mkbuildtree-post ]; then
-	arch/${LINUX_ARCH}/xen-mkbuildtree-post
+if [ -e arch/${LINUX_ARCH}/xen-mkbuildtree-post ]; then
+	bash arch/${LINUX_ARCH}/xen-mkbuildtree-post
 fi
diff -r 491d06219ffd -r f69f52013d13 tools/debugger/gdb/gdbbuild
--- a/tools/debugger/gdb/gdbbuild	Thu Mar 30 15:16:40 2006 +0900
+++ b/tools/debugger/gdb/gdbbuild	Thu Mar 30 15:21:11 2006 +0900
@@ -7,7 +7,7 @@ tar xjf gdb-6.2.1.tar.bz2
 tar xjf gdb-6.2.1.tar.bz2
 
 cd gdb-6.2.1-xen-sparse
-./mkbuildtree ../gdb-6.2.1
+bash ./mkbuildtree ../gdb-6.2.1
 
 cd ..
 mkdir gdb-6.2.1-linux-i386-xen
diff -r 491d06219ffd -r f69f52013d13 tools/misc/xen-clone
--- a/tools/misc/xen-clone	Thu Mar 30 15:16:40 2006 +0900
+++ b/tools/misc/xen-clone	Thu Mar 30 15:21:11 2006 +0900
@@ -113,7 +113,7 @@ else
 
  # Turn linux into xenolinux then build it
  cd xenolinux-${LINUX_VER}-sparse
- ./mkbuildtree ../../linux-${LINUX_VER}
+ bash ./mkbuildtree ../../linux-${LINUX_VER}
  cd ../..
  mv linux-${LINUX_VER} xenolinux-${LINUX_VER}
  cd xenolinux-${LINUX_VER}

  reply	other threads:[~2006-04-11  8:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-10  2:29 [PATCH 0/11] libxc: various build cleanups Horms
2006-04-10  2:29 ` [PATCH 1/11] build: Remove unused netbsd build fragments Horms
2006-04-10  2:29 ` [PATCH 2/11] build: Remove iptables and python loging helper targets Horms
2006-04-10  2:29 ` [PATCH 3/11] build: Make sure that DESTDIR is set Horms
2006-04-10  2:29 ` [PATCH 4/11] build: Clean up use of .PHONY Horms
2006-04-10  2:29 ` [PATCH 5/11] build: clean up output of make help a little bit Horms
2006-04-10  2:29 ` [PATCH 6/11] build: Document the use of XEN_PYTHON_NATIVE_INSTALL Horms
2006-04-10  2:29 ` [PATCH 7/11] build: clean up kclean and distclean for kernel Horms
2006-04-10  2:29 ` [PATCH 8/11] build: Clean pygrub's a.out Horms
2006-04-10  2:29 ` [PATCH 9/11] build: Use --bzip2 with tar instead of -j Horms
2006-04-10  2:30 ` [PATCH 10/11] build: make linux download more flexable Horms
2006-04-10  2:30 ` [PATCH 11/11] build: Don't assume that mkbuildtree is executable Horms
2006-04-10 15:40   ` Keir Fraser
2006-04-11  1:23     ` Horms
2006-04-11  8:26       ` Keir Fraser
2006-04-11  8:50         ` Horms [this message]
2006-04-11  9:23           ` Keir Fraser
2006-04-13  2:22             ` Horms
2006-04-13 10:21               ` Keir Fraser
2006-04-14  1:44                 ` Horms

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060411085031.GJ17513@verge.net.au \
    --to=horms@verge.net.au \
    --cc=Keir.Fraser@cl.cam.ac.uk \
    --cc=magnus@valinux.co.jp \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.