threads / patch / 9845

patchRemove non-POSIX alternation in sed script in instaweb

Subject: [PATCH] Remove non-POSIX alternation in sed script in instaweb

## tl;dr

One message between Sep 14, 2007 and Sep 14, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Bryan Larsen· Sep 14, 2007, 21:41 UTC · lore

git-instaweb.sh uses alternation in a sed script. Unfortunately, this is not POSIX compliant and does not work on some BSD's. This patch removes the alternation via the simple expedient of doubling the number of lines in the sed script.

Signed-off-by: Bryan Larsen <bryan@larsen.st>
---
 git-instaweb.sh |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
Show changes to git-instaweb.sh +8 −4
diff --git a/git-instaweb.sh b/git-instaweb.sh
index b79c6b6..ce631a0 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -207,10 +207,14 @@ EOF
 }

 script='
-s#^\(my\|our\) $projectroot =.*#\1 $projectroot = "'`dirname $fqgitdir`'";#
-s#\(my\|our\) $gitbin =.*#\1 $gitbin = "'$GIT_EXEC_PATH'";#
-s#\(my\|our\) $projects_list =.*#\1 $projects_list = $projectroot;#
-s#\(my\|our\) $git_temp =.*#\1 $git_temp = "'$fqgitdir/gitweb/tmp'";#'
+s#^my $projectroot =.*#my $projectroot = "'`dirname $fqgitdir`'";#
+s#^our $projectroot =.*#our $projectroot = "'`dirname $fqgitdir`'";#
+s#my $gitbin =.*#my $gitbin = "'$GIT_EXEC_PATH'";#
+s#our $gitbin =.*#our $gitbin = "'$GIT_EXEC_PATH'";#
+s#my $projects_list =.*#my $projects_list = $projectroot;#
+s#our $projects_list =.*#our $projects_list = $projectroot;#
+s#my $git_temp =.*#my $git_temp = "'$fqgitdir/gitweb/tmp'";#
+s#our $git_temp =.*#our $git_temp = "'$fqgitdir/gitweb/tmp'";#'

 gitweb_cgi () {
        cat > "$1.tmp" <<\EOFGITWEB
-- 
1.5.3.1

← back to recent threads