Skip to contentSkip to conversation

instaweb: use minified gitweb.js if available

PATCH New Mark Rada 1 participant 1 message Jun 15, 2016 Kbuild

lore
Share & tools
lore

Mark Rada

author
#0 lore raw

PATCH v2 1/1 instaweb: use minified gitweb.js if available

Makes git-instaweb use gitweb.min.js if it was generated.

---

Changes since v1:
- Updates name of javascript file instaweb creates instead of changing the the copy of gitweb.cgi that embeds.

 Makefile        |   11 ++++++-----
 git-instaweb.sh |    3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)
Makefile +6 -5
index 7c616f8..f80b25e 100644
@@ -1551,12 +1551,12 @@ gitweb:
 	$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
 
 ifdef JSMIN
-OTHER_PROGRAMS += gitweb/gitweb.cgi   gitweb/gitweb.min.js
-gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js
+GITWEB_JS=gitweb/gitweb.min.js
 else
-OTHER_PROGRAMS += gitweb/gitweb.cgi
-gitweb/gitweb.cgi: gitweb/gitweb.perl
+GITWEB_JS=gitweb/gitweb.js
 endif
+OTHER_PROGRAMS += gitweb/gitweb.cgi $(GITWEB_JS)
+gitweb/gitweb.cgi: gitweb/gitweb.perl $(GITWEB_PROGRAMS)
 	$(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) $(patsubst gitweb/%,%,$@)
 
 ifdef JSMIN
@@ -1574,8 +1574,9 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.
 	    -e '/@@GITWEB_CGI@@/d' \
 	    -e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
 	    -e '/@@GITWEB_CSS@@/d' \
-	    -e '/@@GITWEB_JS@@/r gitweb/gitweb.js' \
+	    -e '/@@GITWEB_JS@@/r $(GITWEB_JS)' \
 	    -e '/@@GITWEB_JS@@/d' \
+	    -e 's|@@GITWEB_JS_NAME@@|$(GITWEB_JS)|' \
 	    -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
 	    [email protected] > $@+ && \
 	chmod +x $@+ && \
git-instaweb.sh +2 -1
index 6a65f25..b2fb7f0 100755
@@ -397,12 +397,13 @@ EOFGITWEB
 gitweb_js () {
 	cat > "$1" <<\EOFGITWEB
 @@GITWEB_JS@@
+
 EOFGITWEB
 }
 
 gitweb_cgi "$GIT_DIR/gitweb/gitweb.cgi"
 gitweb_css "$GIT_DIR/gitweb/gitweb.css"
-gitweb_js  "$GIT_DIR/gitweb/gitweb.js"
+gitweb_js  "$GIT_DIR/@@GITWEB_JS_NAME@@"
 
 case "$httpd" in
 *lighttpd*)
Signature · 1 line
1.7.0.2.279.gf1ba1c