diff options
Diffstat (limited to 'bdep/sync.cxx')
-rw-r--r-- | bdep/sync.cxx | 88 |
1 files changed, 58 insertions, 30 deletions
diff --git a/bdep/sync.cxx b/bdep/sync.cxx index 760b184..b7e71fb 100644 --- a/bdep/sync.cxx +++ b/bdep/sync.cxx @@ -842,6 +842,7 @@ namespace bdep const strings& pkg_args, bool implicit, optional<bool> fetch, + uint16_t bpkg_fetch_verb, bool yes, bool name_cfg, optional<bool> upgrade, // true - upgrade, false - patch @@ -1631,10 +1632,24 @@ namespace bdep if (cfg.reps.empty ()) continue; - run_bpkg (3, co, + const path& p (cfg.path); + + // If we are deep-fetching multiple configurations, print their names. + // Failed that it will be quite confusing since we may be re-fetching + // the same repositories over and over. + // + // Note: counter-intuitively, we may end up here even if fetch is + // nullopt; see load_implicit() for details. + // + bool deep_fetch (fetch && *fetch); + + if (cfgs.size () != 1 && deep_fetch) + text << "fetching in configuration " << p.representation (); + + run_bpkg (bpkg_fetch_verb, co, "fetch", - "-d", cfg.path.get (), - (*fetch ? nullptr : "--shallow"), + "-d", p, + (deep_fetch ? nullptr : "--shallow"), cfg.reps); } @@ -2201,14 +2216,15 @@ namespace bdep pkg_args, implicit, fetch, + 3 /* bpkg_fetch_verb */, yes, name_cfg, - nullopt /* upgrade */, - nullopt /* recursive */, - false /* disfigure */, + nullopt /* upgrade */, + nullopt /* recursive */, + false /* disfigure */, prj_pkgs, - strings () /* dep_pkgs */, - strings () /* deinit_pkgs */, + strings () /* dep_pkgs */, + strings () /* deinit_pkgs */, so, create_host_config, create_build2_config, @@ -2280,14 +2296,15 @@ namespace bdep pkg_args, implicit, fetch ? false /* shallow */ : optional<bool> (), + 3 /* bpkg_fetch_verb */, yes, name_cfg, - nullopt /* upgrade */, - nullopt /* recursive */, - false /* disfigure */, + nullopt /* upgrade */, + nullopt /* recursive */, + false /* disfigure */, prj_pkgs, - strings () /* dep_pkgs */, - strings () /* deinit_pkgs */, + strings () /* dep_pkgs */, + strings () /* deinit_pkgs */, so, create_host_config, create_build2_config, @@ -2325,17 +2342,18 @@ namespace bdep dir_path () /* prj */, {sync_config (cfg)}, move (lcfgs), - strings () /* pkg_args */, - true /* implicit */, + strings () /* pkg_args */, + true /* implicit */, fetch ? false /* shallow */ : optional<bool> (), + 3 /* bpkg_fetch_verb */, yes, name_cfg, - nullopt /* upgrade */, - nullopt /* recursive */, - false /* disfigure */, - package_locations () /* prj_pkgs */, - strings () /* dep_pkgs */, - strings () /* deinit_pkgs */, + nullopt /* upgrade */, + nullopt /* recursive */, + false /* disfigure */, + package_locations () /* prj_pkgs */, + strings () /* dep_pkgs */, + strings () /* deinit_pkgs */, so, create_host_config, create_build2_config); @@ -2391,20 +2409,21 @@ namespace bdep } cmd_sync (co, - dir_path () /* prj */, + dir_path () /* prj */, move (ocfgs), move (lcfgs), - strings () /* pkg_args */, - true /* implicit */, + strings () /* pkg_args */, + true /* implicit */, fetch ? false /* shallow */ : optional<bool> (), + 3, /* bpkg_fetch_verb */ yes, name_cfg, - nullopt /* upgrade */, - nullopt /* recursive */, - false /* disfigure */, - package_locations () /* prj_pkgs */, - strings () /* dep_pkgs */, - strings () /* deinit_pkgs */, + nullopt /* upgrade */, + nullopt /* recursive */, + false /* disfigure */, + package_locations () /* prj_pkgs */, + strings () /* dep_pkgs */, + strings () /* deinit_pkgs */, so, create_host_config, create_build2_config); @@ -2429,6 +2448,7 @@ namespace bdep strings () /* pkg_args */, true /* implicit */, false /* shallow fetch */, + 3 /* bpkg_fetch_verb */, true /* yes */, false /* name_cfg */, nullopt /* upgrade */, @@ -2760,6 +2780,11 @@ namespace bdep cmd_fetch (o, prj, c, o.fetch_full ()); } + // Increase verbosity for bpkg-fetch command in cmd_sync() if we perform + // explicit fetches as well. + // + uint16_t bpkg_fetch_verb (fetch && !ocfgs.empty () ? 2 : 3); + if (!dep_pkgs.empty ()) { // We ignore the project packages if the dependencies are specified @@ -2778,6 +2803,7 @@ namespace bdep pkg_args, false /* implicit */, !fetch ? false /* shallow */ : optional<bool> (), + bpkg_fetch_verb, o.recursive () || o.immediate () ? o.yes () : true, false /* name_cfg */, !o.patch (), // Upgrade by default unless patch requested. @@ -2803,6 +2829,7 @@ namespace bdep pkg_args, false /* implicit */, !fetch ? false /* shallow */ : optional<bool> (), + bpkg_fetch_verb, o.yes (), false /* name_cfg */, o.upgrade (), @@ -2829,6 +2856,7 @@ namespace bdep pkg_args, o.implicit (), !fetch ? false /* shallow */ : optional<bool> (), + bpkg_fetch_verb, true /* yes */, o.implicit () /* name_cfg */, nullopt /* upgrade */, |