{"thread":{"id":"1920","subject":"/bin/sh portability question","startedAt":"2005-09-23T07:50:58Z","lastAt":"2005-09-25T19:36:45Z","messageCount":16,"participants":["Peter Eriksen","Junio C Hamano","Sean","H. Peter Anvin","Morten Welinder","Joel Becker","Patrick Mauritz","Nico -telmich- Schottelius"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"9153","messageId":"20050923075058.GA25473@bohr.gbar.dtu.dk","threadId":"1920","inReplyTo":null,"subject":"/bin/sh portability question","fromName":"Peter Eriksen","fromEmail":"s022018@student.dtu.dk","sentAt":"2005-09-23T07:50:58Z","receivedAt":"2005-09-23T07:50:58Z","isPatch":false,"sender":{"key":"s022018@student.dtu.dk","avatar":null},"body":"Hello,\n\nIt seems things are progressing nicely with regard to\nSolaris portability.  However, I still have a few problems:\n\n1) Maybe I didn't notice some new configuration option,\n   but strcasestr is still not found with a simple \"gmake\".\n\n2) In many of the shell scripts there is the idiom:\n\n      #!/bin/sh\n      \n      cmd=\n      path=$(dirname $0)\n      case \"$#\" in\n      0)      ;;\n      *)      cmd=\"$1\"\n              shift\n \n   When run, this gives the error:\n\n      ./git.sh: syntax error at line 4: `path=$' unexpected\n\n   I think it's because (on my Solaris at least), sh is really \n   sh and is not symlinked to bash, and sh doesn't like that \n   syntax.  Are there any good solutions to this other than\n   making the administrators actually change sh to a symlink,\n   (which I tried)?\n\n/Peter\n"},{"id":"9154","messageId":"7vzmq4faz6.fsf@assigned-by-dhcp.cox.net","threadId":"1920","inReplyTo":"20050923075058.GA25473@bohr.gbar.dtu.dk","subject":"Re: /bin/sh portability question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-23T08:24:13Z","receivedAt":"2005-09-23T08:24:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Peter Eriksen\" <s022018@student.dtu.dk> writes:\n\n> 1) Maybe I didn't notice some new configuration option,\n>    but strcasestr is still not found with a simple \"gmake\".\n\nPerhaps \"gmake NO_STRCASESTR=YesPlease\"?\n\nDo people use glibc or other alternative C libraries on Solaris\nthese days?  If nobody does, and everybody on SunOS lack\nstrcasestr, we could make SunOS imply NO_STRCASESTR in the\nMakefile.\n\n> 2) In many of the shell scripts there is the idiom:\n\n>    I think it's because (on my Solaris at least), sh is really \n>    sh and is not symlinked to bash, and sh doesn't like that \n>    syntax.\n\nWriting $(command) instead of `command` is not a bashism; Korn\nsupports it and even ash seems to.  But saying that would not\nreduce the pain from non-sysadmins.\n\nIn many places we could just rewrite them to old-timer back-tick\nform, unless we nest, in which case you would end up doing\nsomething like this for readability:\n\n\tfoo=$(command $(command to compute arg to it))\n\n\targ=`command to compute arg to it`\n        foo=`command \"$arg\"`\n\nI haven't assessed the extent of damage if we tried to use ``\nfor portability lately (I did once, and it did not look too bad\nback then).  If somebody comes up with a readable patch, I might\nbe persuaded to take it [*1*].\n\nAnother thing that will bite you is the use of shell arrays -- I\nwas trying to stay away from it but at least git-grep uses it\nnow (and hopefully nobody else).  It may not be a bad idea to\nrewrite that one script in Perl or Python.\n\n\n[Footnotes]\n\n*1* Personally I feel that the only bug in Bourne was that it\ndid not spell command substitution as $().\n"},{"id":"9159","messageId":"BAYC1-PASMTP05141C92C0F083A17B2EEFAE960@CEZ.ICE","threadId":"1920","inReplyTo":"7vzmq4faz6.fsf@assigned-by-dhcp.cox.net","subject":"Re: /bin/sh portability question","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2005-09-23T09:02:57Z","receivedAt":"2005-09-23T09:02:57Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Fri, September 23, 2005 4:24 am, Junio C Hamano said:\n\n> I haven't assessed the extent of damage if we tried to use ``\n> for portability lately (I did once, and it did not look too bad\n> back then).  If somebody comes up with a readable patch, I might\n> be persuaded to take it [*1*].\n\nJunio,\n\nIt sounds like changing the sha-bang line to \"#!/bin/bash\" would fix the\nproblem on Solaris.  As an aside, it would improve vi syntax highlighting\nas well.  Does any target system lack bash?\n\nIf not, would you accept a patch that first converted the shell scripts to\n#!/bin/bash and then added a \"make install\" option that allowed them to be\nreplaced?   Something like \"make install S=/bin/ash\" for instance?\n\nSean\n"},{"id":"9160","messageId":"7vmzm4duf8.fsf@assigned-by-dhcp.cox.net","threadId":"1920","inReplyTo":"20050923075058.GA25473@bohr.gbar.dtu.dk","subject":"Re: /bin/sh portability question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-23T09:07:07Z","receivedAt":"2005-09-23T09:07:07Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Peter Eriksen\" <s022018@student.dtu.dk> writes:\n\n> It seems things are progressing nicely with regard to\n> Solaris portability.\n\nGood to have a Solaris user.  I have one patch that I've been\nkeeping in the proposed updates branch, waiting for a\ncomfirmation or 'not-good-enough-for-me' answer from people that\nhave cURL installed in nonstandard places.\n\n------------\nSubject: [PATCH] CURLDIR in Makefile\nFrom: Patrick Mauritz <oxygene@studentenbude.ath.cx>\nDate: 1127139079 +0200\n\nSupport systems that do not install curl headers and libraries\nin /usr/{include,lib}.\n\nSigned-off-by: Patrick Mauritz <oxygene@studentenbude.ath.cx>\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n Makefile |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\na5ebfc164f8380eb4c1c2ff92082687c3cb0b39d\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -9,6 +9,9 @@\n # Define NO_CURL if you do not have curl installed.  git-http-pull is not\n # built, and you cannot use http:// and https:// transports.\n #\n+# Define CURLDIR=/foo/bar if your curl header and library files are in\n+# /foo/bar/include and /foo/bar/lib directories.\n+#\n # Define NO_STRCASESTR if you don't have strcasestr.\n #\n # Define PPC_SHA1 environment variable when running make to make use of\n@@ -131,6 +134,13 @@ ifdef WITH_SEND_EMAIL\n endif\n \n ifndef NO_CURL\n+\tifdef CURLDIR\n+\t\t# This is still problematic -- gcc does not want -R.\n+\t\tCFLAGS += -I$(CURLDIR)/include\n+\t\tCURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl\n+\telse\n+\t\tCURL_LIBCURL = -lcurl\n+\tendif\n \tPROGRAMS += git-http-fetch\n endif\n \n@@ -285,7 +295,7 @@ git-ssh-upload: rsh.o\n git-ssh-pull: rsh.o fetch.o\n git-ssh-push: rsh.o\n \n-git-http-fetch: LIBS += -lcurl\n+git-http-fetch: LIBS += $(CURL_LIBCURL)\n git-rev-list: LIBS += $(OPENSSL_LIBSSL)\n \n init-db.o: init-db.c\n"},{"id":"9163","messageId":"7vfyrwdtv0.fsf@assigned-by-dhcp.cox.net","threadId":"1920","inReplyTo":"BAYC1-PASMTP05141C92C0F083A17B2EEFAE960@CEZ.ICE","subject":"Re: /bin/sh portability question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-23T09:19:15Z","receivedAt":"2005-09-23T09:19:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Sean\" <seanlkml@sympatico.ca> writes:\n\n> If not, would you accept a patch that first converted the shell scripts to\n> #!/bin/bash and then added a \"make install\" option that allowed them to be\n> replaced?   Something like \"make install S=/bin/ash\" for instance?\n\n    $ make SHELL_PATH=/bin/bash\n\nPerhaps?\n"},{"id":"9169","messageId":"BAYC1-PASMTP03087B2B759861CF1C864AAE960@CEZ.ICE","threadId":"1920","inReplyTo":"7vfyrwdtv0.fsf@assigned-by-dhcp.cox.net","subject":"Re: /bin/sh portability question","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2005-09-23T10:34:45Z","receivedAt":"2005-09-23T10:34:45Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Fri, September 23, 2005 5:19 am, Junio C Hamano said:\n> \"Sean\" <seanlkml@sympatico.ca> writes:\n>\n>> If not, would you accept a patch that first converted the shell scripts\n>> to\n>> #!/bin/bash and then added a \"make install\" option that allowed them to\n>> be\n>> replaced?   Something like \"make install S=/bin/ash\" for instance?\n>\n>     $ make SHELL_PATH=/bin/bash\n>\n> Perhaps?\n>\n\nHeh.. so you've already got that working :o)   So on Solaris one fix would\nbe to just use the SHELL_PATH setting when installing to point to\n/bin/bash.   What do you think about making /bin/bash the default?\n\nSean\n"},{"id":"9173","messageId":"20050923121705.GA11377@sunq05.gbar.dtu.dk","threadId":"1920","inReplyTo":"7vmzm4duf8.fsf@assigned-by-dhcp.cox.net","subject":"Re: /bin/sh portability question","fromName":"Peter Eriksen","fromEmail":"s022018@student.dtu.dk","sentAt":"2005-09-23T12:17:05Z","receivedAt":"2005-09-23T12:17:05Z","isPatch":false,"sender":{"key":"s022018@student.dtu.dk","avatar":null},"body":"On Fri, Sep 23, 2005 at 02:07:07AM -0700, Junio C Hamano wrote:\n> \"Peter Eriksen\" <s022018@student.dtu.dk> writes:\n> \n> > It seems things are progressing nicely with regard to\n> > Solaris portability.\n> \n> Good to have a Solaris user.  I have one patch that I've been\n> keeping in the proposed updates branch, waiting for a\n> comfirmation or 'not-good-enough-for-me' answer from people that\n> have cURL installed in nonstandard places.\n\nGCC is not complaining.  :-)\n\nMy current make command is like this:\n\ngmake NO_STRCASESTR=YesPlease CURLDIR=/opt/sfw/  \\\n      SHELL_PATH=/bin/bash INSTALL=ginstall install\n\nThere are two problems:\n\n* First of all there really needs to be a TAR variable, \n  since Solaris tar doesn't like the C option. \n\n* Secondly I've noticed that git.sh and gitk don't get \n  their /bin/sh line changed during install.\n\n/Peter\n"},{"id":"9190","messageId":"43345C17.7060402@zytor.com","threadId":"1920","inReplyTo":"20050923075058.GA25473@bohr.gbar.dtu.dk","subject":"Re: /bin/sh portability question","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-09-23T19:48:39Z","receivedAt":"2005-09-23T19:48:39Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Peter Eriksen wrote:\n> \n> 2) In many of the shell scripts there is the idiom:\n> \n>       #!/bin/sh\n>       \n>       cmd=\n>       path=$(dirname $0)\n>       case \"$#\" in\n>       0)      ;;\n>       *)      cmd=\"$1\"\n>               shift\n>  \n>    When run, this gives the error:\n> \n>       ./git.sh: syntax error at line 4: `path=$' unexpected\n> \n>    I think it's because (on my Solaris at least), sh is really \n>    sh and is not symlinked to bash, and sh doesn't like that \n>    syntax.  Are there any good solutions to this other than\n>    making the administrators actually change sh to a symlink,\n>    (which I tried)?\n> \n\nI think $(foo) is required by POSIX.\n\n\t-hpa\n"},{"id":"9191","messageId":"118833cc05092312553b526845@mail.gmail.com","threadId":"1920","inReplyTo":"43345C17.7060402@zytor.com","subject":"Re: /bin/sh portability question","fromName":"Morten Welinder","fromEmail":"mwelinder@gmail.com","sentAt":"2005-09-23T19:55:03Z","receivedAt":"2005-09-23T19:55:03Z","isPatch":false,"sender":{"key":"mwelinder@gmail.com","avatar":null},"body":"> I think $(foo) is required by POSIX.\n\nIndeed, but Solaris really does not have it.\n\nMorten\n"},{"id":"9192","messageId":"20050923195706.GV27375@ca-server1.us.oracle.com","threadId":"1920","inReplyTo":"43345C17.7060402@zytor.com","subject":"Re: /bin/sh portability question","fromName":"Joel Becker","fromEmail":"joel.becker@oracle.com","sentAt":"2005-09-23T19:57:06Z","receivedAt":"2005-09-23T19:57:06Z","isPatch":false,"sender":{"key":"joel.becker@oracle.com","avatar":null},"body":"On Fri, Sep 23, 2005 at 12:48:39PM -0700, H. Peter Anvin wrote:\n> Peter Eriksen wrote:\n> >      path=$(dirname $0)\n> > ...\n> >      ./git.sh: syntax error at line 4: `path=$' unexpected\n> \n> I think $(foo) is required by POSIX.\n\n\tI believe that Solaris and others (AIX IIRC) have /bin/sh linked\nto /bin/ksh, and it behaves as the POSIX shell when run as /bin/ksh, but\nbehaves as a much more true-to-bourne shell when run as /bin/sh.\n\nJoel\n\n-- \n\n\"Nearly all men can stand adversity, but if you really want to\n test a man's character, give him power.\"\n\t- Abraham Lincoln\n\nJoel Becker\nPrincipal Software Developer\nOracle\nE-mail: joel.becker@oracle.com\nPhone: (650) 506-8127\n"},{"id":"9193","messageId":"43345EED.5060706@zytor.com","threadId":"1920","inReplyTo":"20050923195706.GV27375@ca-server1.us.oracle.com","subject":"Re: /bin/sh portability question","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2005-09-23T20:00:45Z","receivedAt":"2005-09-23T20:00:45Z","isPatch":false,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Joel Becker wrote:\n> On Fri, Sep 23, 2005 at 12:48:39PM -0700, H. Peter Anvin wrote:\n> \n>>Peter Eriksen wrote:\n>>\n>>>     path=$(dirname $0)\n>>>...\n>>>     ./git.sh: syntax error at line 4: `path=$' unexpected\n>>\n>>I think $(foo) is required by POSIX.\n> \n> \n> \tI believe that Solaris and others (AIX IIRC) have /bin/sh linked\n> to /bin/ksh, and it behaves as the POSIX shell when run as /bin/ksh, but\n> behaves as a much more true-to-bourne shell when run as /bin/sh.\n> \n\nBut \"sh\" is required to be the POSIX shell (XSH page 850.)\n\nThus, they might have some braindamage where /usr/bin/sh is the POSIX \nshell and /bin/sh is a braindead shell.  Sigh.\n\n\t-hpa\n"},{"id":"9210","messageId":"7vwtl78dyl.fsf@assigned-by-dhcp.cox.net","threadId":"1920","inReplyTo":"20050923121705.GA11377@sunq05.gbar.dtu.dk","subject":"Re: /bin/sh portability question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-24T01:13:54Z","receivedAt":"2005-09-24T01:13:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Peter Eriksen\" <s022018@student.dtu.dk> writes:\n\n> GCC is not complaining.  :-)\n>\n> My current make command is like this:\n>\n> gmake NO_STRCASESTR=YesPlease CURLDIR=/opt/sfw/  \\\n>       SHELL_PATH=/bin/bash INSTALL=ginstall install\n>\n> There are two problems:\n>\n> * First of all there really needs to be a TAR variable, \n>   since Solaris tar doesn't like the C option. \n>\n> * Secondly I've noticed that git.sh and gitk don't get \n>   their /bin/sh line changed during install.\n\nThanks.\n\nWould something like the attached patch, on top of what I sent\nout, look good?  I do not think bash vs ksh vs bourne makes a\ndifference in the case of gitk.\n\n------------\n[PATCH] Solaris: give a bit more built-in defaults.\n\nTaking the make command line Peter Eriksen uses, give defaults\nto SHELL_PATH, TAR, CURLDIR, NO_STRCASESTR, and INSTALL.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n Makefile           |   43 ++++++++++++++++++++++++++-----------------\n git-clone.sh       |    3 ++-\n templates/Makefile |   10 ++++++----\n 3 files changed, 34 insertions(+), 22 deletions(-)\n\n49cbdf77449687da471ee9289796f7c480e7bd73\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -27,8 +27,6 @@\n # Define NEEDS_SOCKET if linking with libc is not enough (SunOS,\n # Patrick Mauritz).\n #\n-# Define NO_GETDOMAINNAME if your library lack it (SunOS, Patrick Mauritz).\n-#\n # Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3.\n #\n # Define COLLISION_CHECK below if you believe that SHA1's\n@@ -63,6 +61,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-cor\n \n CC = gcc\n AR = ar\n+TAR = tar\n INSTALL = install\n RPMBUILD = rpmbuild\n \n@@ -133,17 +132,6 @@ ifdef WITH_SEND_EMAIL\n \tSCRIPT_PERL += git-send-email.perl\n endif\n \n-ifndef NO_CURL\n-\tifdef CURLDIR\n-\t\t# This is still problematic -- gcc does not want -R.\n-\t\tCFLAGS += -I$(CURLDIR)/include\n-\t\tCURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl\n-\telse\n-\t\tCURL_LIBCURL = -lcurl\n-\tendif\n-\tPROGRAMS += git-http-fetch\n-endif\n-\n LIB_FILE=libgit.a\n \n LIB_H = \\\n@@ -166,6 +154,9 @@ LIB_OBJS = \\\n LIBS = $(LIB_FILE)\n LIBS += -lz\n \n+#\n+# Platform specific tweaks\n+#\n ifeq ($(shell uname -s),Darwin)\n \tNEEDS_SSL_WITH_CRYPTO = YesPlease\n \tNEEDS_LIBICONV = YesPlease\n@@ -173,12 +164,28 @@ endif\n ifeq ($(shell uname -s),SunOS)\n \tNEEDS_SOCKET = YesPlease\n \tNEEDS_NSL = YesPlease\n+\tSHELL_PATH = /bin/bash\n+\tNO_STRCASESTR = YesPlease\n+\tCURLDIR = /opt/sfw\n+\tINSTALL = ginstall\n+\tTAR = gtar\n \tPLATFORM_DEFINES += -D__EXTENSIONS__\n endif\n ifneq (,$(findstring arm,$(shell uname -m)))\n \tARM_SHA1 = YesPlease\n endif\n \n+ifndef NO_CURL\n+\tifdef CURLDIR\n+\t\t# This is still problematic -- gcc does not want -R.\n+\t\tCFLAGS += -I$(CURLDIR)/include\n+\t\tCURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl\n+\telse\n+\t\tCURL_LIBCURL = -lcurl\n+\tendif\n+\tPROGRAMS += git-http-fetch\n+endif\n+\n ifndef SHELL_PATH\n \tSHELL_PATH = /bin/sh\n endif\n@@ -245,6 +252,7 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)\n \t  $(patsubst %.py,%,$(SCRIPT_PYTHON)) \\\n \t  gitk\n \n+export TAR INSTALL DESTDIR\n ### Build rules\n \n all: $(PROGRAMS) $(SCRIPTS)\n@@ -254,7 +262,8 @@ all:\n \n git: git.sh Makefile\n \trm -f $@+ $@\n-\tsed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+\n+\tsed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \\\n+\t    -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+\n \tchmod +x $@+\n \tmv $@+ $@\n \n@@ -356,7 +365,7 @@ dist: git-core.spec git-tar-tree\n \t./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar\n \t@mkdir -p $(GIT_TARNAME)\n \t@cp git-core.spec $(GIT_TARNAME)\n-\ttar rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git-core.spec\n+\t$(TAR) rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git-core.spec\n \t@rm -rf $(GIT_TARNAME)\n \tgzip -f -9 $(GIT_TARNAME).tar\n \n@@ -365,7 +374,7 @@ rpm: dist\n \n deb: dist\n \trm -rf $(GIT_TARNAME)\n-\ttar zxf $(GIT_TARNAME).tar.gz\n+\t$(TAR) zxf $(GIT_TARNAME).tar.gz\n \tdpkg-source -b $(GIT_TARNAME)\n \tcd $(GIT_TARNAME) && fakeroot debian/rules binary\n \n@@ -380,5 +389,5 @@ clean:\n \trm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc\n \trm -f git-tk_$(GIT_VERSION)-*.deb\n \t$(MAKE) -C Documentation/ clean\n-\t$(MAKE) -C templates/ clean\n+\t$(MAKE) -C templates clean\n \t$(MAKE) -C t/ clean\ndiff --git a/git-clone.sh b/git-clone.sh\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -139,7 +139,8 @@ yes,yes)\n \tthen\n \t\tHEAD=HEAD\n \tfi\n-\ttar Ccf \"$repo\" - refs $HEAD | tar Cxf \"$D/.git\" - || exit 1\n+\t(cd \"$repo\" && tar cf - refs $HEAD) |\n+\t(cd \"$D/.git\" && tar xf -) || exit 1\n \t;;\n *)\n \tcase \"$repo\" in\ndiff --git a/templates/Makefile b/templates/Makefile\n--- a/templates/Makefile\n+++ b/templates/Makefile\n@@ -1,8 +1,9 @@\n # make and install sample templates\n \n-INSTALL=install\n-prefix=$(HOME)\n-template_dir=$(prefix)/share/git-core/templates/\n+INSTALL ?= install\n+TAR ?= tar\n+prefix ?= $(HOME)\n+template_dir ?= $(prefix)/share/git-core/templates/\n # DESTDIR=\n \n all: boilerplates custom\n@@ -35,4 +36,5 @@ clean:\n \n install: all\n \t$(INSTALL) -d -m755 $(DESTDIR)$(template_dir)\n-\ttar Ccf blt - . | tar Cxf $(DESTDIR)$(template_dir) -\n+\t(cd blt && $(TAR) cf - .) | \\\n+\t(cd $(DESTDIR)$(template_dir) && $(TAR) xf -)\n"},{"id":"9232","messageId":"1127583315.895.11.camel@tetris","threadId":"1920","inReplyTo":"7vmzm4duf8.fsf@assigned-by-dhcp.cox.net","subject":"Re: /bin/sh portability question","fromName":"Patrick Mauritz","fromEmail":"oxygene@studentenbude.ath.cx","sentAt":"2005-09-24T17:35:15Z","receivedAt":"2005-09-24T17:35:15Z","isPatch":false,"sender":{"key":"oxygene@studentenbude.ath.cx","avatar":null},"body":"On Fri, 2005-09-23 at 11:07, Junio C Hamano wrote:\n> Good to have a Solaris user.  I have one patch that I've been\n> keeping in the proposed updates branch, waiting for a\n> comfirmation or 'not-good-enough-for-me' answer from people that\n> have cURL installed in nonstandard places.\nsorry for the lack of reponse.. apart from fixing up context (to match\n0.99.7), this patch works here.\n\n\nthanks,\npatrick mauritz\n"},{"id":"9240","messageId":"7vll1mup98.fsf@assigned-by-dhcp.cox.net","threadId":"1920","inReplyTo":"20050924195029.GA20514@bohr.gbar.dtu.dk","subject":"Re: /bin/sh portability question","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-09-24T21:31:15Z","receivedAt":"2005-09-24T21:31:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Peter Eriksen\" <s022018@student.dtu.dk> writes:\n\n> Here are some small problems to begin with.\n\nThanks.  Next time, please format your patch according to\nDocumentation/SubmittingPatches.  Your MUA ate tabs and leading\nwhitespaces from the diff, and you lack Signed-off-by line.\n\nI think you need to pass down SHELL_PATH, and prepare for people\nrunning 'make' by hand in t/ directory.\n\ndiff --git a/Makefile b/Makefile\n--- a/Makefile\n+++ b/Makefile\n@@ -252,7 +252,7 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)\n \t  $(patsubst %.py,%,$(SCRIPT_PYTHON)) \\\n \t  gitk\n \n-export TAR INSTALL DESTDIR\n+export TAR INSTALL DESTDIR SHELL_PATH\n ### Build rules\n \n all: $(PROGRAMS) $(SCRIPTS)\ndiff --git a/t/Makefile b/t/Makefile\n--- a/t/Makefile\n+++ b/t/Makefile\n@@ -4,8 +4,9 @@\n #\n \n #GIT_TEST_OPTS=--verbose --debug\n+SHELL_PATH ?= $(SHELL)\n \n\nBTW, do you have access to a Linux machine to play with?  It\nwould have caught this fairly easily.\n\nTest of 'tar' timestamp would also fail if you do not use\n'gtar', but as far as I know that test is the only place we\nreally rely on 'tar', so it may not be worth fixing.\n\n'xargs -0' and 'find -print0' is really essential in some of the\ngit barebone scripts.  I think the one in git-reset can go, by \nunlinking in the Perl script instead of printing the name and\nrunning \"xargs -0 rm -f --\" on it.\n\nThe one in git-commit I am not sure about.  We do want to make\nit really generic and keep allowing LF in paths.  Maybe we would\nwant 'git-update-index --stdin [-z]' to read list of paths from\nthe standard input.\n\nThe one in git-grep I would not worry too much about; we should\nrewrite the whole thing in Perl and the problem will disappear.\n"},{"id":"9273","messageId":"20050925192608.GD19023@schottelius.org","threadId":"1920","inReplyTo":"39450.10.10.10.28.1127471685.squirrel@linux1","subject":"Re: /bin/sh portability question","fromName":"Nico -telmich- Schottelius","fromEmail":"nico-linux-git@schottelius.org","sentAt":"2005-09-25T19:26:08Z","receivedAt":"2005-09-25T19:26:08Z","isPatch":false,"sender":{"key":"nico-linux-git@schottelius.org","avatar":null},"body":"Sean [Fri, Sep 23, 2005 at 06:34:45AM -0400]:\n> On Fri, September 23, 2005 5:19 am, Junio C Hamano said:\n> > \"Sean\" <seanlkml@sympatico.ca> writes:\n> >\n> >> If not, would you accept a patch that first converted the shell scripts\n> >> to\n> >> #!/bin/bash and then added a \"make install\" option that allowed them to\n> >> be\n> >> replaced?   Something like \"make install S=/bin/ash\" for instance?\n> >\n> >     $ make SHELL_PATH=/bin/bash\n> >\n> > Perhaps?\n> >\n> \n> Heh.. so you've already got that working :o)   So on Solaris one fix would\n> be to just use the SHELL_PATH setting when installing to point to\n> /bin/bash.   What do you think about making /bin/bash the default?\n\nI think it's a bad idea, because some systems do not have and want bash,\nbecause it's unneeded. On all systems here we've ash as /bin/sh and\n/bin/zsh as primary user shell. Thus, /bin/bash does not exist, because\nit's not as comfortable as zsh and not as small as ash.\n\nNico,\n   who really likes man bash (very well documentated), but not the shell itself\n\n-- \nLatest project: cconfig (http://nico.schotteli.us/papers/linux/cconfig/)\nOpen Source nutures open minds and free, creative developers.\n"},{"id":"9274","messageId":"BAYC1-PASMTP02CBC8364AB52CD372AEC0AE880@CEZ.ICE","threadId":"1920","inReplyTo":"20050925192608.GD19023@schottelius.org","subject":"Re: /bin/sh portability question","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2005-09-25T19:36:45Z","receivedAt":"2005-09-25T19:36:45Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Sun, September 25, 2005 3:26 pm, Nico -telmich- Schottelius said:\n\n> I think it's a bad idea, because some systems do not have and want bash,\n> because it's unneeded. On all systems here we've ash as /bin/sh and\n> /bin/zsh as primary user shell. Thus, /bin/bash does not exist, because\n> it's not as comfortable as zsh and not as small as ash.\n\nHi Nico,\n\nMy guess is that your system configuration is in the minority and that\nmost target systems have bash installed today.  But all you'd have to do\nis make a link from /bin/zsh to /bin/bash, or use the SHELL_PATH variable\nto change all the scripts to /bin/zsh at install time.\n\nSean\n"}]}