Re: [PATCH] instaweb: use minified gitweb.js if available

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

 



Mark Rada schrieb:
> --- a/Makefile
> +++ b/Makefile
> @@ -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,12 +1574,13 @@ 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|@@PERL@@|$(PERL_PATH_SQ)|g' \
>  	    $@.sh > $@+ && \
>  	chmod +x $@+ && \
> -	mv $@+ $@
> +	mv $@+ $@ && \
> +	sed -i '' -e 's/min\.js/js/' $@

sed -i is not portable. But do you need it at all? Can't you add this
change to the -e list above?

> --- a/git-instaweb.sh
> +++ b/git-instaweb.sh
> @@ -397,6 +397,7 @@ EOFGITWEB
>  gitweb_js () {
>  	cat > "$1" <<\EOFGITWEB
>  @@GITWEB_JS@@
> +
>  EOFGITWEB
>  }
>  -- 1.7.0.1.300.gd855a

This new blank line is an accident, isn't it?

-- Hannes

--
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]