aboutsummaryrefslogtreecommitdiff
path: root/bdep/sync.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-16 16:17:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-16 16:17:07 +0200
commit12857770f878e385e83cb76e39e2f99a09d1b043 (patch)
treea2d843eac07ae2d1a16de219ae64f803f53a42d0 /bdep/sync.cxx
parentf3c57d0941ead602ff8f2936cd30019567ff42de (diff)
Don't prompt and automatically drop unused prerequisites in sync
Diffstat (limited to 'bdep/sync.cxx')
-rw-r--r--bdep/sync.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/bdep/sync.cxx b/bdep/sync.cxx
index 6f95080..f8a5bed 100644
--- a/bdep/sync.cxx
+++ b/bdep/sync.cxx
@@ -17,7 +17,8 @@ namespace bdep
cmd_sync (const common_options& co,
const dir_path& prj,
const shared_ptr<configuration>& c,
- bool fetch)
+ bool fetch,
+ bool yes)
{
assert (!c->packages.empty ());
@@ -54,12 +55,21 @@ namespace bdep
spec += '@';
spec += prj.string ();
+ // It feels right to drop unused dependencies without any confirmation.
+ //
+ // @@ TODO: right now it is silent. Can we print a plan without the
+ // prompts? Probably also a good idea even if from build system
+ // hook... Issue: drop dependents has no "drop " prefix. Also indented
+ // stuff out of nowhere will look odd.
+ //
run_bpkg (co,
"build",
"-d", c->path,
"--no-fetch",
"--configure-only",
+ "--drop-prerequisite",
"--keep-out",
+ (yes ? "--yes" : nullptr),
spec);
}
@@ -125,6 +135,8 @@ namespace bdep
// Don't re-fetch if we just fetched.
//
cmd_sync (o, prj, c, !fetch);
+
+ //@@ TODO: sync upgrade (see status for structure ideas). Pass o.yes().
}
return 0;