From 0736a7b0cb90b83895af6a11ae0158f2adcce321 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 14 Feb 2016 14:20:00 +0200 Subject: Update all packages at once in pkg-build --- bpkg/pkg-build.cxx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'bpkg/pkg-build.cxx') 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 upkgs; + for (const build_package& p: reverse_iterate (pkgs)) { const shared_ptr& 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; -- cgit v1.1