[csw-devel] SF.net SVN: gar:[17631] csw/mgar/pkg/git/trunk
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Mon Apr 9 03:59:13 CEST 2012
Revision: 17631
http://gar.svn.sourceforge.net/gar/?rev=17631&view=rev
Author: bdwalton
Date: 2012-04-09 01:59:12 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
git/trunk: revert to default SANE_TOOL_PATH, work around bug in xpg4/sed
Modified Paths:
--------------
csw/mgar/pkg/git/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/git/trunk/files/0009-Avoid-bug-in-Solaris-xpg4-sed-as-used-in-submodule.patch
Modified: csw/mgar/pkg/git/trunk/Makefile
===================================================================
--- csw/mgar/pkg/git/trunk/Makefile 2012-04-07 19:18:22 UTC (rev 17630)
+++ csw/mgar/pkg/git/trunk/Makefile 2012-04-09 01:59:12 UTC (rev 17631)
@@ -117,6 +117,7 @@
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
+PATCHFILES += 0009-Avoid-bug-in-Solaris-xpg4-sed-as-used-in-submodule.patch
fdirs = $(bindir_install) $(mandir) $(libexecdir_install)
define _git_files
@@ -152,7 +153,6 @@
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/0009-Avoid-bug-in-Solaris-xpg4-sed-as-used-in-submodule.patch
===================================================================
--- csw/mgar/pkg/git/trunk/files/0009-Avoid-bug-in-Solaris-xpg4-sed-as-used-in-submodule.patch (rev 0)
+++ csw/mgar/pkg/git/trunk/files/0009-Avoid-bug-in-Solaris-xpg4-sed-as-used-in-submodule.patch 2012-04-09 01:59:12 UTC (rev 17631)
@@ -0,0 +1,56 @@
+From 097f067a25220fc3cc315163dfef07de6a1c5f20 Mon Sep 17 00:00:00 2001
+From: Ben Walton <bwalton at opencsw.org>
+Date: Mon, 9 Apr 2012 03:14:18 +0200
+Subject: [PATCH] Avoid bug in Solaris xpg4/sed as used in submodule
+
+The sed provided by Solaris in /usr/xpg4/bin has a bug whereby an
+unanchored regex using * for zero or more repetitions sees two
+separate matches fed to the substitution engine in some cases.
+
+This is evidenced by:
+
+$ for sed in /usr/xpg4/bin/sed /usr/bin/sed /opt/csw/gnu/sed; do \
+echo 'ab' | $sed -e 's|[a]*|X|g' \
+done
+XXbX
+XbX
+XbX
+
+This bug was triggered during a git submodule clone operation as
+exercised in the setup stage of t5526-fetch-submodules when using the
+default SANE_TOOL_PATH for Solaris. It led to paths such as
+..../.. being used in the submodule .git gitdir reference.
+
+Using the expression 's|\([^/]*\(/*\)\)|..\2|g' provides the desired
+result with all three three tested sed implementations but is harder
+to read. Instead, use an additional -e script to clean up after the
+bug on Solaris. The second script will be a functional no-op on most
+sed implementations.
+
+Signed-off-by: Ben Walton <bwalton at opencsw.org>
+---
+ git-submodule.sh | 6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/git-submodule.sh b/git-submodule.sh
+index efc86ad..0adad22 100755
+--- a/git-submodule.sh
++++ b/git-submodule.sh
+@@ -167,10 +167,12 @@ module_clone()
+ a=${a%/}
+ b=${b%/}
+
+- rel=$(echo $b | sed -e 's|[^/]*|..|g')
++ # Note: The second -e is to work around a bug in Solairs'
++ # xpg4/sed. It will be a no-op in a working implementation.
++ rel=$(echo $b | sed -e 's|[^/]*|..|g' -e 's|\.\{4\}|..|g')
+ echo "gitdir: $rel/$a" >"$path/.git"
+
+- rel=$(echo $a | sed -e 's|[^/]*|..|g')
++ rel=$(echo $a | sed -e 's|[^/]*|..|g' -e 's|\.\{4\}|..|g')
+ (clear_local_git_env; cd "$path" && GIT_WORK_TREE=. git config core.worktree "$rel/$b")
+ }
+
+--
+1.7.9
+
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