On Sun, Jul 13, 2014 at 7:44 AM, Pádraig Brady <[email protected]> wrote:
> On 07/13/2014 01:59 PM, Bernhard Voelker wrote:
>> On 07/12/2014 06:56 PM, Pádraig Brady wrote:
>>> Here is the complete rolled up patch, which I'm about ready to push.
>>> http://www.pixelbeat.org/cu/single-binary_v10.patch
While the build succeeded with other shells, the new dependency
generation would fail with "/bin/sh: line 1: -2: substring expression < 0"
for /bin/sh that happened to be bash-3.x. Using that notation
(name=${man:4: -2}) would also fail with dash and ksh-based
shells. Here's a fix:
From 4d82df724ef1ee0809aa294c68f7cc11c9c0f0f5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Sun, 13 Jul 2014 10:24:33 -0700
Subject: [PATCH] build: adjust new rule not to depend on bash-4.x
* man/local.mk (man/dynamic-deps.mk): Use the same code to
derive FOO from man/FOO.1 as in the .x.1 rule below.
Using the more concise "name=$${man:4: -2}" is not portable enough.
---
man/local.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/man/local.mk b/man/local.mk
index 0f0b66e..a4117b1 100644
--- a/man/local.mk
+++ b/man/local.mk
@@ -61,7 +61,7 @@ CLEANFILES += man/dynamic-deps.mk
man/dynamic-deps.mk: Makefile
$(AM_V_GEN)rm -f $@ $@-t
$(AM_V_at)for man in $(ALL_MANS); do \
- name=$${man:4: -2} ; # Space is important \
+ name=`echo "$$man"|sed 's|.*/||; s|\.1$$||'` || exit 1; \
case $$name in \
arch) prog='uname';; \
install) prog='ginstall';; \
--
2.0.0.421.g786a89d