# [PATCH] documentation: Makefile accounts for SHELL_PATH setting

10 messages from 2009-03-22 to 2009-04-13. Participants: Ben Walton, Jeff King, Mike Hommey, Nanako Shiraishi, Junio C Hamano.
Thread: https://gitlist.dev/t/18465

## Ben Walton, 2009-03-22 13:20

Subject: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <1237728044-15651-1-git-send-email-bwalton@artsci.utoronto.ca>
URL: https://gitlist.dev/e/1237728044-15651-1-git-send-email-bwalton%40artsci.utoronto.ca

```
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(-)

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, 2009-03-23 06:57

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <20090323065710.GA7048@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20090323065710.GA7048%40coredump.intra.peff.net
In-Reply-To: <1237728044-15651-1-git-send-email-bwalton@artsci.utoronto.ca>

```
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, 2009-03-23 12:57

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <1237812904-sup-3864@ntdws12.chass.utoronto.ca>
URL: https://gitlist.dev/e/1237812904-sup-3864%40ntdws12.chass.utoronto.ca
In-Reply-To: <20090323065710.GA7048@coredump.intra.peff.net>

```
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, 2009-03-23 14:03

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <20090323140302.GA11005@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20090323140302.GA11005%40coredump.intra.peff.net
In-Reply-To: <1237812904-sup-3864@ntdws12.chass.utoronto.ca>

```
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, 2009-03-23 14:12

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <20090323141238.GA14722@glandium.org>
URL: https://gitlist.dev/e/20090323141238.GA14722%40glandium.org
In-Reply-To: <20090323140302.GA11005@coredump.intra.peff.net>

```
On Mon, Mar 23, 2009 at 10:03:02AM -0400, Jeff King <peff@peff.net> wrote:
> 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, 2009-04-10 00:34

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <20090410093430.6117@nanako3.lavabit.com>
URL: https://gitlist.dev/e/20090410093430.6117%40nanako3.lavabit.com
In-Reply-To: <1237728044-15651-1-git-send-email-bwalton@artsci.utoronto.ca>

```
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?

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

```

## Junio C Hamano, 2009-04-11 20:42

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <7vmyamdirk.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vmyamdirk.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20090410093430.6117@nanako3.lavabit.com>

```
Nanako Shiraishi <nanako3@lavabit.com> writes:

> 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, 2009-04-12 01:49

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <1239500938-sup-5545@ntdws12.chass.utoronto.ca>
URL: https://gitlist.dev/e/1239500938-sup-5545%40ntdws12.chass.utoronto.ca
In-Reply-To: <7vmyamdirk.fsf@gitster.siamese.dyndns.org>

```
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, 2009-04-12 08:28

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <7vzlem9sxu.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vzlem9sxu.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1239500938-sup-5545@ntdws12.chass.utoronto.ca>

```
Ben Walton <bwalton@artsci.utoronto.ca> writes:

> 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, 2009-04-13 14:21

Subject: Re: [PATCH] documentation: Makefile accounts for SHELL_PATH setting
Message-ID: <1239632383-sup-5048@ntdws12.chass.utoronto.ca>
URL: https://gitlist.dev/e/1239632383-sup-5048%40ntdws12.chass.utoronto.ca
In-Reply-To: <7vzlem9sxu.fsf@gitster.siamese.dyndns.org>

```
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.

```
