{"thread":{"id":"15181","subject":"[RFC/PATCH] Install templates directory using mkdir -p, not install -d","startedAt":"2008-08-23T19:29:06Z","lastAt":"2008-08-23T19:53:18Z","messageCount":3,"participants":["Miklos Vajna","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"88309","messageId":"1219519746-7438-1-git-send-email-vmiklos@frugalware.org","threadId":"15181","inReplyTo":null,"subject":"[RFC/PATCH] Install templates directory using mkdir -p, not install -d","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-08-23T19:29:06Z","receivedAt":"2008-08-23T19:29:06Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"The templates directory was previously installed using install -d, but\ninstall has no '-d' option for example on HP-UX.\n\nUsing mkdir -p instead seem to solve the problem.\n\nSigned-off-by: Miklos Vajna <vmiklos@frugalware.org>\n---\n\nI checked Linux and Solaris so far, both have mkdir -p -m. I'm not sure\nabout other platforms, hence the RFC prefix.\n\n templates/Makefile |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/templates/Makefile b/templates/Makefile\nindex cc3fc30..5d35e51 100644\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -4,7 +4,7 @@ ifndef V\n \tQUIET = @\n endif\n \n-INSTALL ?= install\n+MKDIR ?= mkdir\n TAR ?= tar\n RM ?= rm -f\n prefix ?= $(HOME)\n@@ -29,7 +29,7 @@ boilerplates.made : $(bpsrc)\n \t\tcase \"$$boilerplate\" in *~) continue ;; esac && \\\n \t\tdst=`echo \"$$boilerplate\" | sed -e 's|^this|.|;s|--|/|g'` && \\\n \t\tdir=`expr \"$$dst\" : '\\(.*\\)/'` && \\\n-\t\t$(INSTALL) -d -m 755 blt/$$dir && \\\n+\t\t$(MKDIR) -p -m 755 blt/$$dir && \\\n \t\tcase \"$$boilerplate\" in \\\n \t\t*--) ;; \\\n \t\t*) cp -p $$boilerplate blt/$$dst ;; \\\n@@ -46,6 +46,6 @@ clean:\n \t$(RM) -r blt boilerplates.made\n \n install: all\n-\t$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'\n+\t$(MKDIR) -p -m 755 '$(DESTDIR_SQ)$(template_instdir_SQ)'\n \t(cd blt && $(TAR) cf - .) | \\\n \t(cd '$(DESTDIR_SQ)$(template_instdir_SQ)' && umask 022 && $(TAR) xfo -)\n-- \n1.6.0.rc3.17.gc14c8.dirty\n"},{"id":"88312","messageId":"7vsksvy0qz.fsf@gitster.siamese.dyndns.org","threadId":"15181","inReplyTo":"1219519746-7438-1-git-send-email-vmiklos@frugalware.org","subject":"Re: [RFC/PATCH] Install templates directory using mkdir -p, not install -d","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-23T19:44:51Z","receivedAt":"2008-08-23T19:44:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I have the attached patch queued for about 36 hours already, but I ended\nup wasting a lot of time fixing other people's bugs last night and haven't\nhad a chance to push out the result yet.\n\nI think using mkdir in blt/ area is fine, but I have doubts about not\nusing $(INSTALL), which is designed to be a standard \"marker\" in Makefiles\nand meant to be replaceable on deficient platforms, for installing to real\nfinal destination directories.  IOW, I do not think the last hunk in your\npatch is a good idea.\n\n>From 96cda0b1067b4b5a2f87785cc49e1e648d68ae1d Mon Sep 17 00:00:00 2001\nFrom: Junio C Hamano <gitster@pobox.com>\nDate: Thu, 21 Aug 2008 19:31:50 -0500\nSubject: [PATCH] templates/Makefile: install is unnecessary, just use mkdir -p\n\nThe native install on some platforms (namely IRIX 6.5) treats non-absolute\npaths as being relative to the root directory rather than relative to\nthe current directory. Work around this by avoiding install in this case\nsince it is unnecessary, and instead depend on the local umask setting\nand use mkdir.\n\nTested-by: Brandon Casey <casey@nrlssc.navy.mil>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n templates/Makefile |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/templates/Makefile b/templates/Makefile\nindex cc3fc30..0722a92 100644\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -23,13 +23,13 @@ all: boilerplates.made custom\n \n bpsrc = $(filter-out %~,$(wildcard *--*))\n boilerplates.made : $(bpsrc)\n-\t$(QUIET)ls *--* 2>/dev/null | \\\n+\t$(QUIET)umask 022 && ls *--* 2>/dev/null | \\\n \twhile read boilerplate; \\\n \tdo \\\n \t\tcase \"$$boilerplate\" in *~) continue ;; esac && \\\n \t\tdst=`echo \"$$boilerplate\" | sed -e 's|^this|.|;s|--|/|g'` && \\\n \t\tdir=`expr \"$$dst\" : '\\(.*\\)/'` && \\\n-\t\t$(INSTALL) -d -m 755 blt/$$dir && \\\n+\t\tmkdir -p blt/$$dir && \\\n \t\tcase \"$$boilerplate\" in \\\n \t\t*--) ;; \\\n \t\t*) cp -p $$boilerplate blt/$$dst ;; \\\n-- \n1.6.0.51.g078ae\n"},{"id":"88313","messageId":"20080823195318.GE23800@genesis.frugalware.org","threadId":"15181","inReplyTo":"7vsksvy0qz.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC/PATCH] Install templates directory using mkdir -p, not install -d","fromName":"Miklos Vajna","fromEmail":"vmiklos@frugalware.org","sentAt":"2008-08-23T19:53:18Z","receivedAt":"2008-08-23T19:53:18Z","isPatch":true,"sender":{"key":"vmiklos@frugalware.org","avatar":"https://gravatar.com/avatar/401c1cbbb3a5d13e650c691a2c71d6fd0b80df1a01bc74d9f1972675dd58f2bd?d=mp&s=160"},"body":"On Sat, Aug 23, 2008 at 12:44:51PM -0700, Junio C Hamano <gitster@pobox.com> wrote:\n> I think using mkdir in blt/ area is fine, but I have doubts about not\n> using $(INSTALL), which is designed to be a standard \"marker\" in Makefiles\n> and meant to be replaceable on deficient platforms, for installing to real\n> final destination directories.  IOW, I do not think the last hunk in your\n> patch is a good idea.\n\nThe other method would be adding some stripped down version of GNU\nautomake's install-sh, then we use say install-sh -d without caring\nabout what switches 'install' has on the given platform.\n\nAt least that's how HP builds their binary git package:\n\nhttp://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\n\nI think the mkdir one would be much simpler.\n"}]}