[csw-devel] SF.net SVN: gar:[17543] csw/mgar/pkg/git/trunk

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Sun Mar 25 04:23:01 CEST 2012


Revision: 17543
          http://gar.svn.sourceforge.net/gar/?rev=17543&view=rev
Author:   bdwalton
Date:     2012-03-25 02:23:00 +0000 (Sun, 25 Mar 2012)
Log Message:
-----------
git/trunk: add two patches to fix a sh-spawning bug that affects us because sh is not posix compliant

Modified Paths:
--------------
    csw/mgar/pkg/git/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/git/trunk/files/0008-run-command.c-Define-SHELL_PATH-macro-for-use-in-pre.patch
    csw/mgar/pkg/git/trunk/files/0009-Makefile-Set-EXTRA_CPPFLAGS-during-the-compilation-o.patch

Modified: csw/mgar/pkg/git/trunk/Makefile
===================================================================
--- csw/mgar/pkg/git/trunk/Makefile	2012-03-24 22:36:30 UTC (rev 17542)
+++ csw/mgar/pkg/git/trunk/Makefile	2012-03-25 02:23:00 UTC (rev 17543)
@@ -115,6 +115,8 @@
 PATCHFILES_isa-sparcv8 += 0005-Force-en_US.UTF-8-for-a-git-svn-test.patch
 PATCHFILES += 0006-Patch-out-a-few-usr-share-references.patch
 PATCHFILES += 0007-on-solaris-we-need-to-use-lintl-to-allow-the-new-i18.patch
+PATCHFILES += 0008-run-command.c-Define-SHELL_PATH-macro-for-use-in-pre.patch
+PATCHFILES += 0009-Makefile-Set-EXTRA_CPPFLAGS-during-the-compilation-o.patch
 
 fdirs = $(bindir_install) $(mandir) $(libexecdir_install)
 define _git_files
@@ -150,6 +152,7 @@
 CONFIGURE_ARGS += --with-gitconfig=$(sysconfdir)/gitconfig
 CONFIGURE_ARGS += --with-pager=/opt/csw/bin/less
 CONFIGURE_ARGS += --without-python
+CONFIGURE_ARGS += --with-sane-tool-path=/opt/csw/gnu:/opt/csw/bin:/usr/xpg6/bin:/usr/xpg4/bin
 
 BUILD_ARGS = MSGFMT=gmsgfmt SHELL_PATH=/opt/csw/bin/bash \
 		ASCIIDOC_NO_ROFF=YesPlease \

Added: csw/mgar/pkg/git/trunk/files/0008-run-command.c-Define-SHELL_PATH-macro-for-use-in-pre.patch
===================================================================
--- csw/mgar/pkg/git/trunk/files/0008-run-command.c-Define-SHELL_PATH-macro-for-use-in-pre.patch	                        (rev 0)
+++ csw/mgar/pkg/git/trunk/files/0008-run-command.c-Define-SHELL_PATH-macro-for-use-in-pre.patch	2012-03-25 02:23:00 UTC (rev 17543)
@@ -0,0 +1,48 @@
+From 22b0d13eb6983c26f4322d158cb339dc4d907844 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Sat, 24 Mar 2012 22:12:43 -0400
+Subject: [PATCH 1/2] run-command.c: Define SHELL_PATH macro for use in
+ prepare_shell_cmd
+
+The shell spawned in run-command.c:prepare_shell_cmd was hard coded to
+'sh'.  Instead, make this a macro named SHELL_PATH so that it can be
+overridden by the build system.  Use 'sh' as the default to preserve
+original behaviour and ensure that a value is always set.
+
+This avoids a situation where some commands were spawned using a
+different shell than the one configured at build time.  Previously, it
+was possible for things to be executed by a non-POSIX shell depending
+on the user's PATH.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ run-command.c |    6 +++++-
+ 1 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/run-command.c b/run-command.c
+index 1db8abf..f005a31 100644
+--- a/run-command.c
++++ b/run-command.c
+@@ -4,6 +4,10 @@
+ #include "sigchain.h"
+ #include "argv-array.h"
+ 
++#ifndef SHELL_PATH
++# define SHELL_PATH "sh"
++#endif
++
+ struct child_to_clean {
+ 	pid_t pid;
+ 	struct child_to_clean *next;
+@@ -90,7 +94,7 @@ static const char **prepare_shell_cmd(const char **argv)
+ 		die("BUG: shell command is empty");
+ 
+ 	if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
+-		nargv[nargc++] = "sh";
++		nargv[nargc++] = SHELL_PATH;
+ 		nargv[nargc++] = "-c";
+ 
+ 		if (argc < 2)
+-- 
+1.7.5.4
+

Added: csw/mgar/pkg/git/trunk/files/0009-Makefile-Set-EXTRA_CPPFLAGS-during-the-compilation-o.patch
===================================================================
--- csw/mgar/pkg/git/trunk/files/0009-Makefile-Set-EXTRA_CPPFLAGS-during-the-compilation-o.patch	                        (rev 0)
+++ csw/mgar/pkg/git/trunk/files/0009-Makefile-Set-EXTRA_CPPFLAGS-during-the-compilation-o.patch	2012-03-25 02:23:00 UTC (rev 17543)
@@ -0,0 +1,31 @@
+From 108e986bc5da901b6447afb3ce9687384ad90249 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Sat, 24 Mar 2012 22:10:17 -0400
+Subject: [PATCH 2/2] Makefile: Set EXTRA_CPPFLAGS during the compilation of
+ run-command
+
+When building run-command.o, we want to pass in a define for
+SHELL_PATH to ensure that the shell configured at build time is used
+at run time when spawning external commands.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ Makefile |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index be1957a..344e2e0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1913,6 +1913,8 @@ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
+ 	'-DGIT_MAN_PATH="$(mandir_SQ)"' \
+ 	'-DGIT_INFO_PATH="$(infodir_SQ)"'
+ 
++run-command.o: EXTRA_CPPFLAGS = -DSHELL_PATH='"$(SHELL_PATH)"'
++
+ $(BUILT_INS): git$X
+ 	$(QUIET_BUILT_IN)$(RM) $@ && \
+ 	ln git$X $@ 2>/dev/null || \
+-- 
+1.7.5.4
+

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list