git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] Install templates directory using mkdir -p, not install -d

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 23, 2008, 19:44 UTC
Message-ID
<7vsksvy0qz.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<1219519746-7438-1-git-send-email-vmiklos@frugalware.org>

I have the attached patch queued for about 36 hours already, but I ended up wasting a lot of time fixing other people's bugs last night and haven't had a chance to push out the result yet.

I think using mkdir in blt/ area is fine, but I have doubts about not using $(INSTALL), which is designed to be a standard "marker" in Makefiles and meant to be replaceable on deficient platforms, for installing to real final destination directories. IOW, I do not think the last hunk in your patch is a good idea.

>From 96cda0b1067b4b5a2f87785cc49e1e648d68ae1d Mon Sep 17 00:00:00 2001
From: Junio C Hamano <gitster@pobox.com>
Date: Thu, 21 Aug 2008 19:31:50 -0500
Subject: [PATCH] templates/Makefile: install is unnecessary, just use mkdir -p

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 <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 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.51.g078ae
Previous: Miklos VajnaNext: Miklos Vajna
Message 2 of 3 in “Install templates directory using mkdir -p, not install -d”
  1. Install templates directory using mkdir -p, not install -dMiklos Vajna, Aug 23, 2008
  2. Junio C HamanoAug 23, 2008
  3. Miklos VajnaAug 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.