From 7acf8ce6111e3740decd39b92c3383fcbdd00e21 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Mar 2018 14:34:12 +0200 Subject: Implement fetch command --- bdep/init.cxx | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'bdep/init.cxx') diff --git a/bdep/init.cxx b/bdep/init.cxx index f41a62b..5fce13f 100644 --- a/bdep/init.cxx +++ b/bdep/init.cxx @@ -68,8 +68,20 @@ namespace bdep // We do each configuration in a separate transaction so that our state // reflects the bpkg configuration as closely as possible. // + bool first (true); for (const shared_ptr& c: cfgs) { + // If we are initializing in multiple configurations, separate them with + // a blank line and print the configuration name/directory. + // + if (verb && cfgs.size () > 1) + { + text << (first ? "" : "\n") + << "initializing in configuration " << *c; + + first = false; + } + transaction t (db.begin ()); // Add project repository to the configuration. Note that we don't fetch @@ -97,6 +109,11 @@ namespace bdep continue; } + // If we are initializing multiple packages, print their names. + // + if (verb && pkgs.size () > 1) + text << "initializing package " << p.name; + c->packages.push_back (package_state {p.name}); } @@ -119,9 +136,8 @@ namespace bdep const dir_path& prj (pp.project); - text << prj; - for (const package_location& pl: pp.packages) - text << " " << pl.name << " " << (prj / pl.path); + if (verb) + text << "initializing project " << prj; // Create .bdep/. // @@ -187,8 +203,6 @@ namespace bdep // cmd_init (o, prj, db, cfgs, pp.packages); - //@@ TODO: print project/package(s) being initialized? (analog to new?) - return 0; } } -- cgit v1.1