diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-14 14:20:00 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-02-14 14:20:00 +0200 |
commit | 0736a7b0cb90b83895af6a11ae0158f2adcce321 (patch) | |
tree | cfbba455a26e0970b1ec13d78f67ae2ac15eb72a /bpkg/pkg-build.cxx | |
parent | 2a1e0a68979db77b3c4951ac15d6abcf68d5780d (diff) |
Update all packages at once in pkg-build
Diffstat (limited to 'bpkg/pkg-build.cxx')
-rw-r--r-- | bpkg/pkg-build.cxx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx index 977c8d9..88d74cc 100644 --- a/bpkg/pkg-build.cxx +++ b/bpkg/pkg-build.cxx @@ -1348,19 +1348,27 @@ namespace bpkg // update // + // Here we want to update all the packages at once, to facilitate + // parallelism. + // + vector<pkg_command_vars> upkgs; + for (const build_package& p: reverse_iterate (pkgs)) { const shared_ptr<selected_package>& sp (p.selected); // Update the user selection only. // - if (find (names.begin (), names.end (), sp->name) == names.end ()) - continue; + if (find (names.begin (), names.end (), sp->name) != names.end ()) + upkgs.push_back (pkg_command_vars {sp, strings ()}); + } - pkg_update (c, o, sp); + pkg_update (c, o, strings (), upkgs); - if (verb) - text << "updated " << sp->name << " " << sp->version; + if (verb) + { + for (const pkg_command_vars& pv: upkgs) + text << "updated " << pv.pkg->name << " " << pv.pkg->version; } return 0; |