From 72baefb8e34102c7f54737bf36fcb10798cfda6b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 17 Sep 2015 14:22:13 +0200 Subject: Consistently use 'c' as configuration directory variable --- bpkg/cfg-create.cxx | 37 ++++++++++++++++++------------------- bpkg/pkg-configure.cxx | 2 +- bpkg/pkg-disfigure.cxx | 2 +- bpkg/pkg-fetch.cxx | 14 +++++++------- bpkg/pkg-purge.cxx | 2 +- bpkg/pkg-status.cxx | 2 +- 6 files changed, 29 insertions(+), 30 deletions(-) diff --git a/bpkg/cfg-create.cxx b/bpkg/cfg-create.cxx index f56754a..2f8fad9 100644 --- a/bpkg/cfg-create.cxx +++ b/bpkg/cfg-create.cxx @@ -23,30 +23,30 @@ namespace bpkg { tracer trace ("cfg_create"); - dir_path d (o.directory ()); - level4 ([&]{trace << "creating configuration in " << d;}); + dir_path c (o.directory ()); + level4 ([&]{trace << "creating configuration in " << c;}); // If the directory already exists, make sure it is empty. // Otherwise, create it. // - if (exists (d)) + if (exists (c)) { - level5 ([&]{trace << "directory " << d << " exists";}); + level5 ([&]{trace << "directory " << c << " exists";}); - if (!empty (d)) + if (!empty (c)) { - level5 ([&]{trace << "directory " << d << " not empty";}); + level5 ([&]{trace << "directory " << c << " not empty";}); if (!o.wipe ()) - fail << "directory " << d << " is not empty"; + fail << "directory " << c << " is not empty"; - rm_r (d, false); + rm_r (c, false); } } else { - level5 ([&]{trace << "directory " << d << " does not exist";}); - mk_p (d); + level5 ([&]{trace << "directory " << c << " does not exist";}); + mk_p (c); } // Sort arguments into modules and configuration variables. @@ -62,12 +62,12 @@ namespace bpkg // Create build/. // - dir_path bd (d / dir_path ("build")); - mk (bd); + dir_path b (c / dir_path ("build")); + mk (b); // Write build/bootstrap.build. // - path f (bd / path ("bootstrap.build")); + path f (b / path ("bootstrap.build")); try { ofstream ofs; @@ -94,7 +94,7 @@ namespace bpkg // Write root buildfile. // - f = path (d / path ("buildfile")); + f = path (c / path ("buildfile")); try { ofstream ofs; @@ -112,17 +112,16 @@ namespace bpkg // Configure. // - run_b ("configure(" + d.string () + "/)", vars); + run_b ("configure(" + c.string () + "/)", vars); // Create the database. // - open (d, true); + open (c, true); if (verb) { - d.complete (); - d.normalize (); - text << "created new configuration in " << d; + c.complete ().normalize (); + text << "created new configuration in " << c; } } } diff --git a/bpkg/pkg-configure.cxx b/bpkg/pkg-configure.cxx index e680b61..604b126 100644 --- a/bpkg/pkg-configure.cxx +++ b/bpkg/pkg-configure.cxx @@ -23,7 +23,7 @@ namespace bpkg { tracer trace ("pkg_configure"); - dir_path c (o.directory ()); + const dir_path& c (o.directory ()); level4 ([&]{trace << "configuration: " << c;}); // Sort arguments into the package name and configuration variables. diff --git a/bpkg/pkg-disfigure.cxx b/bpkg/pkg-disfigure.cxx index 7390e76..092555d 100644 --- a/bpkg/pkg-disfigure.cxx +++ b/bpkg/pkg-disfigure.cxx @@ -93,7 +93,7 @@ namespace bpkg { tracer trace ("pkg_disfigure"); - dir_path c (o.directory ()); + const dir_path& c (o.directory ()); level4 ([&]{trace << "configuration: " << c;}); if (!args.more ()) diff --git a/bpkg/pkg-fetch.cxx b/bpkg/pkg-fetch.cxx index 063f0d5..c7982e8 100644 --- a/bpkg/pkg-fetch.cxx +++ b/bpkg/pkg-fetch.cxx @@ -27,10 +27,10 @@ namespace bpkg { tracer trace ("pkg_fetch"); - dir_path d (o.directory ()); - level4 ([&]{trace << "configuration: " << d;}); + dir_path c (o.directory ()); + level4 ([&]{trace << "configuration: " << c;}); - database db (open (d)); + database db (open (c)); path a; bool purge; @@ -88,18 +88,18 @@ namespace bpkg // See if this package already exists in this configuration. // if (shared_ptr p = db.find (n)) - fail << "package " << n << " already exists in configuration " << d << + fail << "package " << n << " already exists in configuration " << c << info << "version: " << p->version << ", state: " << p->state; // Make the archive and configuration paths absolute and normalized. // If the archive is inside the configuration, use the relative path. // This way we can move the configuration around. // - d.complete ().normalize (); + c.complete ().normalize (); a.complete ().normalize (); - if (a.sub (d)) - a = a.leaf (d); + if (a.sub (c)) + a = a.leaf (c); // Add the package to the configuration. // diff --git a/bpkg/pkg-purge.cxx b/bpkg/pkg-purge.cxx index 319ec61..260b287 100644 --- a/bpkg/pkg-purge.cxx +++ b/bpkg/pkg-purge.cxx @@ -23,7 +23,7 @@ namespace bpkg { tracer trace ("pkg_purge"); - dir_path c (o.directory ()); + const dir_path& c (o.directory ()); level4 ([&]{trace << "configuration: " << c;}); if (!args.more ()) diff --git a/bpkg/pkg-status.cxx b/bpkg/pkg-status.cxx index 26267b6..27e9780 100644 --- a/bpkg/pkg-status.cxx +++ b/bpkg/pkg-status.cxx @@ -23,7 +23,7 @@ namespace bpkg { tracer trace ("pkg_status"); - dir_path c (o.directory ()); + const dir_path& c (o.directory ()); level4 ([&]{trace << "configuration: " << c;}); if (!args.more ()) -- cgit v1.1