From ab2eb3625208211d6523402d38a54dc60d489119 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 16 Nov 2023 10:31:55 +0200 Subject: Force full refetch on first bdep-init for project (GH issue #343) --- bdep/sync.cxx | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'bdep/sync.cxx') diff --git a/bdep/sync.cxx b/bdep/sync.cxx index eac8b8c..77135fd 100644 --- a/bdep/sync.cxx +++ b/bdep/sync.cxx @@ -841,7 +841,7 @@ namespace bdep linked_configs&& linked_cfgs, const strings& pkg_args, bool implicit, - bool fetch, + optional fetch, bool yes, bool name_cfg, optional upgrade, // true - upgrade, false - patch @@ -894,7 +894,8 @@ namespace bdep // assert (c != nullptr); prjs.back ().configs.push_back ( - sync_project::config {c, true /* origin */, implicit, fetch}); + sync_project::config { + c, true /* origin */, implicit, fetch.has_value ()}); } } @@ -1600,7 +1601,11 @@ namespace bdep if (cfg.reps.empty ()) continue; - run_bpkg (3, co, "fetch", "-d", cfg.path.get (), "--shallow", cfg.reps); + run_bpkg (3, co, + "fetch", + "-d", cfg.path.get (), + (*fetch ? nullptr : "--shallow"), + cfg.reps); } string plan; @@ -2132,7 +2137,7 @@ namespace bdep const shared_ptr& c, bool implicit, const strings& pkg_args, - bool fetch, + optional fetch, bool yes, bool name_cfg, const package_locations& prj_pkgs, @@ -2244,7 +2249,7 @@ namespace bdep move (lcfgs), pkg_args, implicit, - fetch, + fetch ? false /* shallow */ : optional (), yes, name_cfg, nullopt /* upgrade */, @@ -2292,7 +2297,7 @@ namespace bdep move (lcfgs), strings () /* pkg_args */, true /* implicit */, - fetch, + fetch ? false /* shallow */ : optional (), yes, name_cfg, nullopt /* upgrade */, @@ -2361,7 +2366,7 @@ namespace bdep move (lcfgs), strings () /* pkg_args */, true /* implicit */, - fetch, + fetch ? false /* shallow */ : optional (), yes, name_cfg, nullopt /* upgrade */, @@ -2391,7 +2396,7 @@ namespace bdep move (lcfgs), strings () /* pkg_args */, true /* implicit */, - true /* fetch */, + false /* shallow fetch */, true /* yes */, false /* name_cfg */, nullopt /* upgrade */, @@ -2738,7 +2743,7 @@ namespace bdep move (lcfgs), pkg_args, false /* implicit */, - !fetch, + !fetch ? false /* shallow */ : optional (), o.recursive () || o.immediate () ? o.yes () : true, false /* name_cfg */, !o.patch (), // Upgrade by default unless patch requested. @@ -2763,7 +2768,7 @@ namespace bdep move (lcfgs), pkg_args, false /* implicit */, - !fetch, + !fetch ? false /* shallow */ : optional (), o.yes (), false /* name_cfg */, o.upgrade (), @@ -2789,7 +2794,7 @@ namespace bdep move (lcfgs), pkg_args, o.implicit (), - !fetch, + !fetch ? false /* shallow */ : optional (), true /* yes */, o.implicit () /* name_cfg */, nullopt /* upgrade */, -- cgit v1.1