{"thread":{"id":"10734","subject":"[PATCH] instaweb: Minor cleanups and fixes for potential problems","startedAt":"2007-11-08T15:49:40Z","lastAt":"2007-11-08T23:21:42Z","messageCount":2,"participants":["Jonas Fonseca"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"58912","messageId":"20071108154940.GA20988@diku.dk","threadId":"10734","inReplyTo":null,"subject":"[PATCH] instaweb: Minor cleanups and fixes for potential problems","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2007-11-08T15:49:40Z","receivedAt":"2007-11-08T15:49:40Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Fix path quoting and test of empty values that some shells do not like.\nRemove duplicate check and setting of $browser.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n git-instaweb.sh |   11 +++++------\n 1 files changed, 5 insertions(+), 6 deletions(-)\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex f05884c..fbacfb1 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -44,7 +44,7 @@ start_httpd () {\n \thttpd_only=\"`echo $httpd | cut -f1 -d' '`\"\n \tif case \"$httpd_only\" in /*) : ;; *) which $httpd_only >/dev/null;; esac\n \tthen\n-\t\t$httpd $fqgitdir/gitweb/httpd.conf\n+\t\t$httpd \"$fqgitdir/gitweb/httpd.conf\"\n \telse\n \t\t# many httpds are installed in /usr/sbin or /usr/local/sbin\n \t\t# these days and those are not in most users $PATHs\n@@ -158,7 +158,7 @@ EOF\n :DirectoryIndex: [\"gitweb.cgi\"]\n :PidFile: \"$fqgitdir/pid\"\n EOF\n-\ttest \"$local\" = true && echo ':BindAddress: \"127.0.0.1\"' >> \"$conf\"\n+\ttest x\"$local\" = xtrue && echo ':BindAddress: \"127.0.0.1\"' >> \"$conf\"\n }\n \n lighttpd_conf () {\n@@ -171,14 +171,14 @@ server.pid-file = \"$fqgitdir/pid\"\n cgi.assign = ( \".cgi\" => \"\" )\n mimetype.assign = ( \".css\" => \"text/css\" )\n EOF\n-\ttest \"$local\" = true && echo 'server.bind = \"127.0.0.1\"' >> \"$conf\"\n+\ttest x\"$local\" = xtrue && echo 'server.bind = \"127.0.0.1\"' >> \"$conf\"\n }\n \n apache2_conf () {\n \ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n \tmkdir -p \"$GIT_DIR/gitweb/logs\"\n \tbind=\n-\ttest \"$local\" = true && bind='127.0.0.1:'\n+\ttest x\"$local\" = xtrue && bind='127.0.0.1:'\n \techo 'text/css css' > $fqgitdir/mime.types\n \tcat > \"$conf\" <<EOF\n ServerName \"git-instaweb\"\n@@ -271,6 +271,5 @@ webrick)\n esac\n \n start_httpd\n-test -z \"$browser\" && browser=echo\n url=http://127.0.0.1:$port\n-$browser $url || echo $url\n+\"$browser\" $url || echo $url\n-- \n1.5.3.5.1623.g4aab495-dirty\n\n-- \nJonas Fonseca\n"},{"id":"58968","messageId":"20071108232142.GA5082@diku.dk","threadId":"10734","inReplyTo":"20071108154940.GA20988@diku.dk","subject":"[PATCH] instaweb: Minor cleanups and fixes for potential problems","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2007-11-08T23:21:42Z","receivedAt":"2007-11-08T23:21:42Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Fix path quoting and test of empty values that some shells do not like.\nRemove duplicate check and setting of $browser.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n git-instaweb.sh |   19 +++++++++----------\n 1 files changed, 9 insertions(+), 10 deletions(-)\n\n Here is a new version that has some more fixes so that git-instaweb now\n runs from inside a repository with spaces in the path.\n\ndiff --git a/git-instaweb.sh b/git-instaweb.sh\nindex f05884c..375f2f3 100755\n--- a/git-instaweb.sh\n+++ b/git-instaweb.sh\n@@ -27,7 +27,7 @@ browser=\"`git config --get instaweb.browser`\"\n port=`git config --get instaweb.port`\n module_path=\"`git config --get instaweb.modulepath`\"\n \n-conf=$GIT_DIR/gitweb/httpd.conf\n+conf=\"$GIT_DIR/gitweb/httpd.conf\"\n \n # Defaults:\n \n@@ -44,7 +44,7 @@ start_httpd () {\n \thttpd_only=\"`echo $httpd | cut -f1 -d' '`\"\n \tif case \"$httpd_only\" in /*) : ;; *) which $httpd_only >/dev/null;; esac\n \tthen\n-\t\t$httpd $fqgitdir/gitweb/httpd.conf\n+\t\t$httpd \"$fqgitdir/gitweb/httpd.conf\"\n \telse\n \t\t# many httpds are installed in /usr/sbin or /usr/local/sbin\n \t\t# these days and those are not in most users $PATHs\n@@ -158,7 +158,7 @@ EOF\n :DirectoryIndex: [\"gitweb.cgi\"]\n :PidFile: \"$fqgitdir/pid\"\n EOF\n-\ttest \"$local\" = true && echo ':BindAddress: \"127.0.0.1\"' >> \"$conf\"\n+\ttest x\"$local\" = xtrue && echo ':BindAddress: \"127.0.0.1\"' >> \"$conf\"\n }\n \n lighttpd_conf () {\n@@ -171,14 +171,14 @@ server.pid-file = \"$fqgitdir/pid\"\n cgi.assign = ( \".cgi\" => \"\" )\n mimetype.assign = ( \".css\" => \"text/css\" )\n EOF\n-\ttest \"$local\" = true && echo 'server.bind = \"127.0.0.1\"' >> \"$conf\"\n+\ttest x\"$local\" = xtrue && echo 'server.bind = \"127.0.0.1\"' >> \"$conf\"\n }\n \n apache2_conf () {\n \ttest -z \"$module_path\" && module_path=/usr/lib/apache2/modules\n \tmkdir -p \"$GIT_DIR/gitweb/logs\"\n \tbind=\n-\ttest \"$local\" = true && bind='127.0.0.1:'\n+\ttest x\"$local\" = xtrue && bind='127.0.0.1:'\n \techo 'text/css css' > $fqgitdir/mime.types\n \tcat > \"$conf\" <<EOF\n ServerName \"git-instaweb\"\n@@ -231,7 +231,7 @@ EOF\n }\n \n script='\n-s#^\\(my\\|our\\) $projectroot =.*#\\1 $projectroot = \"'`dirname $fqgitdir`'\";#\n+s#^\\(my\\|our\\) $projectroot =.*#\\1 $projectroot = \"'$(dirname \"$fqgitdir\")'\";#\n s#\\(my\\|our\\) $gitbin =.*#\\1 $gitbin = \"'$GIT_EXEC_PATH'\";#\n s#\\(my\\|our\\) $projects_list =.*#\\1 $projects_list = $projectroot;#\n s#\\(my\\|our\\) $git_temp =.*#\\1 $git_temp = \"'$fqgitdir/gitweb/tmp'\";#'\n@@ -251,8 +251,8 @@ gitweb_css () {\n EOFGITWEB\n }\n \n-gitweb_cgi $GIT_DIR/gitweb/gitweb.cgi\n-gitweb_css $GIT_DIR/gitweb/gitweb.css\n+gitweb_cgi \"$GIT_DIR/gitweb/gitweb.cgi\"\n+gitweb_css \"$GIT_DIR/gitweb/gitweb.css\"\n \n case \"$httpd\" in\n *lighttpd*)\n@@ -271,6 +271,5 @@ webrick)\n esac\n \n start_httpd\n-test -z \"$browser\" && browser=echo\n url=http://127.0.0.1:$port\n-$browser $url || echo $url\n+\"$browser\" $url || echo $url\n-- \n1.5.3.5.1623.gabaff-dirty\n\n-- \nJonas Fonseca\n"}]}