From 053e82d8cd31685b21546904e146aaca16643761 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 6 Aug 2020 00:35:49 -0700 Subject: [PATCH] install: fully hook up and configure git-browser Install the git-diff.cgi script to make by-date.html fully functional. Configure the "home" button on by-commit.html and by-date.html to by "summary" and go to the project's summary page. Replace the gitweb "graphiclog" button with "graphiclog1" and "graphiclog2" buttons that activate by-commit and by-date respectively. Signed-off-by: Kyle J. McKay --- gitweb/gitweb_config.perl | 3 ++- install.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gitweb/gitweb_config.perl b/gitweb/gitweb_config.perl index dca3a2b..80ef3aa 100644 --- a/gitweb/gitweb_config.perl +++ b/gitweb/gitweb_config.perl @@ -209,7 +209,8 @@ $feature{'pathinfo'}{'default'}=[1]; $feature{'forks'}{'default'}=[1]; $feature{'actions'}{'default'}=[ - ('graphiclog', "@{[url_path($Girocco::Config::gitwebfiles)]}/git-browser/by-commit.html?r=%n", 'log'), + ('graphiclog1', "@{[url_path($Girocco::Config::gitwebfiles)]}/git-browser/by-commit.html?r=%n", 'log'), + ('graphiclog2', "@{[url_path($Girocco::Config::gitwebfiles)]}/git-browser/by-date.html?r=%n", 'graphiclog1'), ('edit', "@{[url_path($Girocco::Config::webadmurl)]}/editproj.cgi?name=%e", 'refs'), ('fork', "@{[url_path($Girocco::Config::webadmurl)]}/regproj.cgi?fork=%e", 'edit') ]; diff --git a/install.sh b/install.sh index f7d545a..ee09737 100755 --- a/install.sh +++ b/install.sh @@ -857,14 +857,30 @@ mkdir -p "$webroot"/git-browser "$cgiroot" -e 's/"git-browser\.conf"/"$ENV{"CFG"}"/' git-browser.cgi >"$cgiroot"/git-browser.cgi.$$ && chmod a+x "$cgiroot"/git-browser.cgi.$$ && chown_make "$cgiroot"/git-browser.cgi.$$ && + perl -p \ + -e 's/^#!.*perl/#!$ENV{PERLBIN}/ if $. == 1;' \ + -e 's/"git-browser\.conf"/"$ENV{"CFG"}"/' git-diff.cgi >"$cgiroot"/git-diff.cgi.$$ && + chmod a+x "$cgiroot"/git-diff.cgi.$$ && + chown_make "$cgiroot"/git-diff.cgi.$$ && mv -f "$cgiroot"/git-browser.cgi.$$ "$cgiroot"/git-browser.cgi && + mv -f "$cgiroot"/git-diff.cgi.$$ "$cgiroot"/git-diff.cgi && cp -r *.html *.js *.css js.lib "$webroot"/git-browser && cp -r JSON "$cgiroot" ) test $? -eq 0 rm -f "$webroot"/git-browser/index.html +gitwebabs="$cfg_gitweburl" +case "$gitwebabs" in "http://"[!/]*|"https://"[!/]*) + gitwebabs="${gitwebabs#*://}" + case "$gitwebabs" in + *"/"*) gitwebabs="/${gitwebabs#*/}";; + *) gitwebabs="";; + esac +esac +case "$gitwebabs" in */);;*) gitwebabs="$gitwebabs/"; esac cat >"$basedir/gitweb"/git-browser.conf.$$ <<-EOT gitbin: $cfg_git_bin + gitweb: $gitwebabs warehouse: $cfg_reporoot doconfig: $cfg_basedir/gitweb/gitbrowser_config.perl EOT @@ -873,6 +889,8 @@ mv -f "$basedir/gitweb"/git-browser.conf.$$ "$basedir/gitweb"/git-browser.conf cat >"$webroot"/git-browser/GitConfig.js.$$ <<-EOT cfg_gitweb_url="$cfg_gitweburl/" cfg_browsercgi_url="$cfg_webadmurl/git-browser.cgi" + cfg_home_url="$cfg_gitweburl/%n" + cfg_home_text="summary" EOT chown_make "$webroot"/git-browser/GitConfig.js.$$ mv -f "$webroot"/git-browser/GitConfig.js.$$ "$webroot"/git-browser/GitConfig.js -- 2.11.4.GIT