threads / patch / 18465

patchdocumentation: Makefile accounts for SHELL_PATH setting

Subject: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

## tl;dr

10 messages between Mar 22, 2009 and Apr 13, 2009. Diffs are folded; open one to read it.

replies: 9people: 5as markdown or json

Ben Walton· Mar 22, 2009, 13:20 UTC · lore

Ensure that the Makefile that generates and installs the Documentation is aware of any SHELL_PATH setting. Use this value if found or the current setting for SHELL if not. This is an accommodation for systems where sh is not bash.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---
 Documentation/Makefile |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
Show changes to Documentation/Makefile +10 −6
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 144ec32..0353690 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -67,6 +67,10 @@ ASCIIDOC_EXTRA += -a docbook-xsl-172
 MANPAGE_XSL = manpage-1.72.xsl
 endif
 
+SHELL_PATH ?= $(SHELL)
+# Shell quote;
+SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
+
 #
 # Please note that there is a minor bug in asciidoc.
 # The version after 6.0.3 _will_ include the patch found here:
@@ -116,7 +120,7 @@ install-pdf: pdf
 	$(INSTALL) -m 644 user-manual.pdf $(DESTDIR)$(pdfdir)
 
 install-html: html
-	sh ./install-webdoc.sh $(DESTDIR)$(htmldir)
+	'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
 
 ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
 	$(MAKE) -C ../ GIT-VERSION-FILE
@@ -178,7 +182,7 @@ user-manual.xml: user-manual.txt user-manual.conf
 
 technical/api-index.txt: technical/api-index-skel.txt \
 	technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS))
-	cd technical && sh ./api-index.sh
+	cd technical && '$(SHELL_PATH_SQ)' ./api-index.sh
 
 $(patsubst %,%.html,$(API_DOCS) technical/api-index): %.html : %.txt
 	$(ASCIIDOC) -b xhtml11 -f asciidoc.conf \
@@ -220,7 +224,7 @@ $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
 
 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
 	$(RM) $@+ $@
-	sh ./howto-index.sh $(wildcard howto/*.txt) >$@+
+	'$(SHELL_PATH_SQ)' ./howto-index.sh $(wildcard howto/*.txt) >$@+
 	mv $@+ $@
 
 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
@@ -234,14 +238,14 @@ $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
 	mv $@+ $@
 
 install-webdoc : html
-	sh ./install-webdoc.sh $(WEBDOC_DEST)
+	'$(SHELL_PATH_SQ)' ./install-webdoc.sh $(WEBDOC_DEST)
 
 quick-install: quick-install-man
 
 quick-install-man:
-	sh ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir)
+	'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir)
 
 quick-install-html:
-	sh ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
+	'$(SHELL_PATH_SQ)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
 
 .PHONY: .FORCE-GIT-VERSION-FILE
-- 
1.6.0.4
Jeff King· Mar 23, 2009, 06:57 UTC · re: Ben Walton · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

On Sun, Mar 22, 2009 at 09:20:44AM -0400, Ben Walton wrote:
> Ensure that the Makefile that generates and installs the Documentation
> is aware of any SHELL_PATH setting.  Use this value if found or the
> current setting for SHELL if not.  This is an accommodation for systems
> where sh is not bash.
Nit: I have lots of systems where sh is not bash, and they work fine. It
is really about "where sh is not horribly broken". There aren't (AFAIK)
and should not be any bash-isms in these scripts.
The patch itself looks fine; thanks for addressing my concerns.
-Peff
Ben Walton· Mar 23, 2009, 12:57 UTC · re: Jeff King · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

Excerpts from Jeff King's message of Mon Mar 23 02:57:10 -0400 2009:
> Nit: I have lots of systems where sh is not bash, and they work fine. It
> is really about "where sh is not horribly broken". There aren't (AFAIK)
> and should not be any bash-isms in these scripts.

That's a fair point. I've been lugging this around for a bit in the build tree I use, so I don't recall specifically what was breaking. The sh in question is the one found in solaris 8. When I get a few mintues, I'll build without the patch to see what the problem was...

> The patch itself looks fine; thanks for addressing my concerns.
Thanks for the helpful feedback! :)
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
Jeff King· Mar 23, 2009, 14:03 UTC · re: Ben Walton · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

On Mon, Mar 23, 2009 at 08:57:27AM -0400, Ben Walton wrote:
> That's a fair point.  I've been lugging this around for a bit in the
> build tree I use, so I don't recall specifically what was breaking.
> The sh in question is the one found in solaris 8.  When I get a few
> mintues, I'll build without the patch to see what the problem was...

I wouldn't worry about it. The /bin/sh on Solaris 8 is pretty hopelessly broken for our use. At the very least it doesn't understand $() subsititution.

-Peff
Mike Hommey· Mar 23, 2009, 14:12 UTC · re: Jeff King · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

On Mon, Mar 23, 2009 at 10:03:02AM -0400, Jeff King <peff@peff.net> wrote:
Show 10 quoted lines
> On Mon, Mar 23, 2009 at 08:57:27AM -0400, Ben Walton wrote:
> 
> > That's a fair point.  I've been lugging this around for a bit in the
> > build tree I use, so I don't recall specifically what was breaking.
> > The sh in question is the one found in solaris 8.  When I get a few
> > mintues, I'll build without the patch to see what the problem was...
> 
> I wouldn't worry about it. The /bin/sh on Solaris 8 is pretty hopelessly
> broken for our use. At the very least it doesn't understand $()
> subsititution.
Neither does it on solaris 10. Fortunately, there is /usr/xpg4/bin/sh.
Mike
Nanako Shiraishi· Apr 10, 2009, 00:34 UTC · re: Ben Walton · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

Quoting Ben Walton:
Show 6 quoted lines
> Ensure that the Makefile that generates and installs the Documentation
> is aware of any SHELL_PATH setting.  Use this value if found or the
> current setting for SHELL if not.  This is an accommodation for systems
> where sh is not bash.
>
> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Junio, may I ask what happened to this patch?
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Junio C Hamano· Apr 11, 2009, 20:42 UTC · re: Nanako Shiraishi · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

Nanako Shiraishi <nanako3@lavabit.com> writes:
Show 10 quoted lines
> Quoting Ben Walton:
>
>> Ensure that the Makefile that generates and installs the Documentation
>> is aware of any SHELL_PATH setting.  Use this value if found or the
>> current setting for SHELL if not.  This is an accommodation for systems
>> where sh is not bash.
>>
>> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
>
> Junio, may I ask what happened to this patch?

There was a discussion going that eventurally petered out without seeing success (or breakage) reports from people with various platforms.

I think the patch text is Ok, with "where sh is not bash" in the log message rephrased to "where sh is not POSIX", but I do not have an easy access to a system where /bin/sh is broken (perhaps I should install OpenSolaris in a vbox to try out), so it is still sitting in my inbox.

Ben Walton· Apr 12, 2009, 01:49 UTC · re: Junio C Hamano · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

Excerpts from Junio C Hamano's message of Sat Apr 11 16:42:39 -0400 2009:
> There was a discussion going that eventurally petered out without seeing
> success (or breakage) reports from people with various platforms.

I didn't see that part of the discussion. Were there breakage reports? I'm willing to make any required corrections to the patch such that it gets included (then I could drop it locally).

> I think the patch text is Ok, with "where sh is not bash" in the log
> message rephrased to "where sh is not POSIX", but I do not have an
> easy

I'll resubmit with the wording correction and any other requested alterations.

Thanks -Ben

-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
Junio C Hamano· Apr 12, 2009, 08:28 UTC · re: Ben Walton · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

Ben Walton <bwalton@artsci.utoronto.ca> writes:
Show 7 quoted lines
> Excerpts from Junio C Hamano's message of Sat Apr 11 16:42:39 -0400 2009:
>> There was a discussion going that eventurally petered out without seeing
>> success (or breakage) reports from people with various platforms.
>
> I didn't see that part of the discussion.  Were there breakage
> reports?  I'm willing to make any required corrections to the patch
> such that it gets included (then I could drop it locally).

I do not recall breakage reports nor success reports. At least it does not seem to break things for me, but I do not do anything so...

Ben Walton· Apr 13, 2009, 14:21 UTC · re: Junio C Hamano · lore

Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting

Excerpts from Junio C Hamano's message of Sun Apr 12 04:28:45 -0400 2009:
> I do not recall breakage reports nor success reports.  At least it does
> not seem to break things for me, but I do not do anything so...

Ok. I see that you've applied the patch to 'next' already (with modified patch text), so I won't re-submit unless someone points out a breakage that the change introduced.

Thanks -Ben

-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.

← back to recent threads