From 974a8c152bf7c9a4a5ce3c45808af65657c2ff1f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 8 Feb 2018 12:44:06 +0200 Subject: Add --for|-f option to pkg-update and pkg-build This allows executing build2 -for-X operations (e.g., update-for-install or update-for-test) in order to minimize the amount of stuff to be updated. --- bpkg/pkg-command.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'bpkg/pkg-command.cxx') diff --git a/bpkg/pkg-command.cxx b/bpkg/pkg-command.cxx index 980e593..0f54b95 100644 --- a/bpkg/pkg-command.cxx +++ b/bpkg/pkg-command.cxx @@ -18,6 +18,7 @@ namespace bpkg pkg_command (const string& cmd, const dir_path& c, const common_options& o, + const string& cmd_v, const strings& cvars, const vector& ps) { @@ -49,7 +50,17 @@ namespace bpkg run (); // Run previously collected packages. if (bspec.empty ()) - bspec = cmd + '('; + { + bspec = cmd; + + if (!cmd_v.empty ()) + { + bspec += "-for-"; + bspec += cmd_v; + } + + bspec += '('; + } const shared_ptr& p (pv.pkg); @@ -78,6 +89,7 @@ namespace bpkg int pkg_command (const string& cmd, const configuration_options& o, + const string& cmd_v, cli::scanner& args) { tracer trace ("pkg_command"); @@ -140,7 +152,7 @@ namespace bpkg t.commit (); } - pkg_command (cmd, c, o, cvars, ps); + pkg_command (cmd, c, o, cmd_v, cvars, ps); if (verb) { -- cgit v1.1