[PATCH 1/4] git-instaweb: Extract configuring web server into configure_httpd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is preparatory work for making start/restart check that
git-instaweb set up correct configuration, and generate it if it is
missing.

Pure refactoring, no functional changes. 

Signed-off-by: Jakub Narebski <jnareb@xxxxxxxxx>
---
As usual, you can check this change with

  $ git blame -w --date=short -C -C HEAD^.. -- git-instaweb.sh |
    grep -C 3 -e '^[^^]' | less -S

assuming that it is checked out (HEAD == this commit).

Thanks Junio for the tip!


Nb. it would be nice to have an option to 'git diff' which would
function like '-w' but ignore code movement...

 git-instaweb.sh |   46 +++++++++++++++++++++++++---------------------
 1 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/git-instaweb.sh b/git-instaweb.sh
index 8bfa8a0..49bab7b 100755
--- a/git-instaweb.sh
+++ b/git-instaweb.sh
@@ -587,32 +587,36 @@ our \$projects_list = \$projectroot;
 EOF
 }
 
+configure_httpd() {
+	case "$httpd" in
+	*lighttpd*)
+		lighttpd_conf
+		;;
+	*apache2*|*httpd*)
+		apache2_conf
+		;;
+	webrick)
+		webrick_conf
+		;;
+	*mongoose*)
+		mongoose_conf
+		;;
+	*plackup*)
+		plackup_conf
+		;;
+	*)
+		echo "Unknown httpd specified: $httpd"
+		exit 1
+		;;
+	esac
+}
+
 gitweb_conf
 
 resolve_full_httpd
 mkdir -p "$fqgitdir/gitweb/$httpd_only"
 
-case "$httpd" in
-*lighttpd*)
-	lighttpd_conf
-	;;
-*apache2*|*httpd*)
-	apache2_conf
-	;;
-webrick)
-	webrick_conf
-	;;
-*mongoose*)
-	mongoose_conf
-	;;
-*plackup*)
-	plackup_conf
-	;;
-*)
-	echo "Unknown httpd specified: $httpd"
-	exit 1
-	;;
-esac
+configure_httpd
 
 start_httpd
 url=http://127.0.0.1:$port

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]