From 4783c74e0741df5ce403b857caf98c0f3917cd77 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Apr 2018 15:17:21 +0200 Subject: Don't print "fetching..." if all the repositories being fetched are dir: --- bpkg/rep-fetch.cxx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/bpkg/rep-fetch.cxx b/bpkg/rep-fetch.cxx index 452392e..ba0c4f3 100644 --- a/bpkg/rep-fetch.cxx +++ b/bpkg/rep-fetch.cxx @@ -1131,13 +1131,13 @@ namespace bpkg fail << "configuration " << c << " has no repositories" << info << "use 'bpkg rep-add' to add a repository"; + for (const lazy_shared_ptr& r: ua) + repos.push_back (r); + // Always print "fetching ..." for complements of the root, even if // there is only one. // reason = ""; - - for (const lazy_shared_ptr& r: ua) - repos.push_back (r); } else { @@ -1180,7 +1180,21 @@ namespace bpkg // with a pointless "fetching ..." line for this repository. // if (repos.size () > 1) - reason = ""; + { + // Also, as a special case (or hack, if you will), suppress these + // lines if all the repositories are directory-based. For such + // repositories there will never be any fetch progress nor can + // they hang. + // + for (lazy_shared_ptr r: repos) + { + if (!r.load ()->location.directory_based ()) + { + reason = ""; + break; + } + } + } } rep_fetch (o, c, t, repos, o.shallow (), reason); -- cgit v1.1