From 7857f06c99449520fe29fa1632692ed931ae85e7 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 14 Aug 2015 22:29:07 -0700 Subject: [PATCH] gitweb: support optional display of bundle info If a repository contains a 'bundles' subdirectory and the new gitweb configuration option $git_base_bundles_url is set then the summary page will show a 'bundle info' link. Signed-off-by: Kyle J. McKay --- gitweb/gitweb.perl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 7a5b23acf2..95972b5b49 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -159,6 +159,12 @@ our $export_auth_hook = undef; # only allow viewing of repositories also shown on the overview page our $strict_export = "++GITWEB_STRICT_EXPORT++"; +# base URL for bundle info link shown on summary page, but only if +# this config item is defined AND a 'bundles' subdirectory exists +# in the project's repository. +# i.e. full URL is "git_base_bundles_url/$project/bundles" +our $git_base_bundles_url = undef; + # list of git base URLs used for URL to where fetch project from, # i.e. full URL is "$git_base_url/$project" our @git_base_url_list = grep { $_ ne '' } ("++GITWEB_BASE_URL++"); @@ -6563,6 +6569,14 @@ sub git_summary { print format_repo_url($url_tag, $git_url); $url_tag = ""; } + if ($git_base_bundles_url && -d "$projectroot/$project/bundles") { + my $projname = $project; + $projname =~ s|^.*/||; + my $url = "$git_base_bundles_url/$project/bundles"; + print format_repo_url( + "bundle info", + "$projname downloadable bundles"); + } # Tag cloud my $show_ctags = gitweb_check_feature('ctags'); -- 2.11.4.GIT