From b72ad077c848b26b81c3bf257829414cb2af0690 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Wed, 18 Aug 2021 11:34:02 -0700 Subject: [PATCH] projtool.pl: support urls --bundle With the --bundle option show the URLs for any existing downloadable bundle files. Signed-off-by: Kyle J. McKay --- toolbox/projtool.pl | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/toolbox/projtool.pl b/toolbox/projtool.pl index ba2d37c..51bc9da 100755 --- a/toolbox/projtool.pl +++ b/toolbox/projtool.pl @@ -10,7 +10,7 @@ use strict; use warnings; use vars qw($VERSION); -BEGIN {*VERSION = \'1.0.8'} +BEGIN {*VERSION = \'1.0.9'} use File::Basename; use Digest::MD5 qw(md5_hex); use IO::Socket; @@ -136,13 +136,14 @@ Usage: %s [...] With --force allow running on a mirror project With no use "list" - urls [--push] + urls [--push | --bundle] show available fetch/push URLs for Note that this does NOT include non-Git protocol URLs such as any home page or any upstream URL for a mirror project -- those are all accessible via the "show" command. The URLs shown are those that would be shown by gitweb.cgi. With --push only show push urls (mirrors have no push urls) + With --bundle show downloadble bundle urls instead listheads list all available heads for and indicate current head @@ -1377,13 +1378,24 @@ sub cmd_worktree { } sub cmd_urls { - my $pushonly; - parse_options("push" => \$pushonly); + my ($pushonly, $bundle); + parse_options("push" => \$pushonly, "bundle" => \$bundle, "bundles" => \$bundle); + $pushonly && $bundle and die "--push and --bundle are incompatible\n"; my @projs = @ARGV; @ARGV <= 1 or die_usage; my $project = get_project_harder_gently($ARGV[0]); defined($project) or die_usage; my $suffix = "/".$project->{name}.".git"; + if ($bundle) { + my $bub = $Girocco::Config::httpbundleurl; + defined($bub) && $bub ne "" or return 0; + $bub =~ s{/$}{}; + $bub .= $suffix . "/"; + foreach ($project->bundles) { + print $bub, $_->[1], "\n"; + } + return 0; + } @Gitweb::Config::git_base_url_list = (); @Gitweb::Config::git_base_push_urls = (); @Gitweb::Config::git_base_mirror_urls = (); -- 2.11.4.GIT