Git development
 help / color / mirror / Atom feed
* [RFC/PATCH] Install templates directory using mkdir -p, not install -d
@ 2008-08-23 19:29 Miklos Vajna
  2008-08-23 19:44 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Miklos Vajna @ 2008-08-23 19:29 UTC (permalink / raw)
  To: git

The templates directory was previously installed using install -d, but
install has no '-d' option for example on HP-UX.

Using mkdir -p instead seem to solve the problem.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---

I checked Linux and Solaris so far, both have mkdir -p -m. I'm not sure
about other platforms, hence the RFC prefix.

 templates/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/templates/Makefile b/templates/Makefile
index cc3fc30..5d35e51 100644
--- a/templates/Makefile
+++ b/templates/Makefile
@@ -4,7 +4,7 @@ ifndef V
 	QUIET = @
 endif
 
-INSTALL ?= install
+MKDIR ?= mkdir
 TAR ?= tar
 RM ?= rm -f
 prefix ?= $(HOME)
@@ -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 && \
+		$(MKDIR) -p -m 755 blt/$$dir && \
 		case "$$boilerplate" in \
 		*--) ;; \
 		*) cp -p $$boilerplate blt/$$dst ;; \
@@ -46,6 +46,6 @@ clean:
 	$(RM) -r blt boilerplates.made
 
 install: all
-	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
+	$(MKDIR) -p -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'
 	(cd blt && $(TAR) cf - .) | \
 	(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)
-- 
1.6.0.rc3.17.gc14c8.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC/PATCH] Install templates directory using mkdir -p, not install -d
  2008-08-23 19:29 [RFC/PATCH] Install templates directory using mkdir -p, not install -d Miklos Vajna
@ 2008-08-23 19:44 ` Junio C Hamano
  2008-08-23 19:53   ` Miklos Vajna
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2008-08-23 19:44 UTC (permalink / raw)
  To: Miklos Vajna; +Cc: git

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC/PATCH] Install templates directory using mkdir -p, not install -d
  2008-08-23 19:44 ` Junio C Hamano
@ 2008-08-23 19:53   ` Miklos Vajna
  0 siblings, 0 replies; 3+ messages in thread
From: Miklos Vajna @ 2008-08-23 19:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 849 bytes --]

On Sat, Aug 23, 2008 at 12:44:51PM -0700, Junio C Hamano <gitster@pobox.com> wrote:
> 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.

The other method would be adding some stripped down version of GNU
automake's install-sh, then we use say install-sh -d without caring
about what switches 'install' has on the given platform.

At least that's how HP builds their binary git package:

http://hpux.connect.org.uk/hppd/cgi-bin/wwwtar?/hpux/Development/Tools/git-1.5.6.3/git-1.5.6.3-src-11.11.tar.gz+git-1.5.6.3/HPUX.Install+text

I think the mkdir one would be much simpler.

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-08-23 19:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-23 19:29 [RFC/PATCH] Install templates directory using mkdir -p, not install -d Miklos Vajna
2008-08-23 19:44 ` Junio C Hamano
2008-08-23 19:53   ` Miklos Vajna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox