Re: [PATCH] templates/Makefile: work around SGI install which assumes / if ROOT not defined

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] templates/Makefile: work around SGI install which assumes / if ROOT not defined

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:11

Brandon Casey [off-list ref] writes:
quoted hunk
diff --git a/templates/Makefile b/templates/Makefile
index 9f3f1fc..3ea63e1 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -29,7 +29,7 @@ boilerplates.made : $(bpsrc)
 		case "$$boilerplate" in *~) continue ;; esac && \
 		dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
 		dir=`expr "$$dst" : '\(.*\)/'` && \
-		$(INSTALL) -d -m 755 blt/$$dir && \
+		ROOT=./ $(INSTALL) -d -m 755 blt/$$dir && \
I do not see absolutely any reason to use install there.

I have to wonder why 9907721 (templates/Makefile: don't depend on local
umask setting, 2008-02-28) did not do this instead:

	$(QUIET)umask 022 && ls *--* 2>/dev/null | \
	while read boilerplate; \
	do \
		case "$$boilerplate" in *~) continue ;; esac && \
		dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
		dir=`expr "$$dst" : '\(.*\)/'` && \
		mkdir -p blt/$$dir && \
		case "$$boilerplate" in \
		*--) ;; \
		*) cp $$boilerplate blt/$$dst ;; \
		esac || exit; \
	done && \
	date >$@

Re: [PATCH] templates/Makefile: work around SGI install which assumes / if ROOT not defined

From: Brandon Casey <hidden>
Date: 2016-06-15 22:45:11

Junio C Hamano wrote:
I do not see absolutely any reason to use install there.

I have to wonder why 9907721 (templates/Makefile: don't depend on local
umask setting, 2008-02-28) did not do this instead:

	$(QUIET)umask 022 && ls *--* 2>/dev/null | \
	while read boilerplate; \
	do \
		case "$$boilerplate" in *~) continue ;; esac && \
		dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
		dir=`expr "$$dst" : '\(.*\)/'` && \
		mkdir -p blt/$$dir && \
		case "$$boilerplate" in \
		*--) ;; \
		*) cp $$boilerplate blt/$$dst ;; \
		esac || exit; \
	done && \
	date >$@
That works just fine for me.

-brandon

[PATCH] templates/Makefile: install is unnecessary, just use mkdir -p

From: Brandon Casey <hidden>
Date: 2016-06-15 22:45:12

From: Junio C Hamano <redacted>

The native install on some platforms (namely IRIX 6.5) treats non-absolute
paths as being relative to the root directory rather than relative to
the current directory. Work around this by avoiding install in this case
since it is unnecessary, and instead depend on the local umask setting
and use mkdir.

Tested-by: Brandon Casey <redacted>
---


Junio C Hamano wrote:
I do not see absolutely any reason to use install there.

I have to wonder why 9907721 (templates/Makefile: don't depend on local
umask setting, 2008-02-28) did not do this instead:
works for me.

-brandon


 templates/Makefile |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/templates/Makefile b/templates/Makefile
index cc3fc30..0722a92 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -23,13 +23,13 @@ all: boilerplates.made custom
 
 bpsrc = $(filter-out %~,$(wildcard *--*))
 boilerplates.made : $(bpsrc)
-	$(QUIET)ls *--* 2>/dev/null | \
+	$(QUIET)umask 022 && ls *--* 2>/dev/null | \
 	while read boilerplate; \
 	do \
 		case "$$boilerplate" in *~) continue ;; esac && \
 		dst=`echo "$$boilerplate" | sed -e 's|^this|.|;s|--|/|g'` && \
 		dir=`expr "$$dst" : '\(.*\)/'` && \
-		$(INSTALL) -d -m 755 blt/$$dir && \
+		mkdir -p blt/$$dir && \
 		case "$$boilerplate" in \
 		*--) ;; \
 		*) cp -p $$boilerplate blt/$$dst ;; \
-- 
1.6.0.21.g35a2e
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help