diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-17 14:22:13 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-17 14:22:13 +0200 |
commit | 72baefb8e34102c7f54737bf36fcb10798cfda6b (patch) | |
tree | 36b11576324e8073de67e43d0a042acb38c6a507 | |
parent | 7221a63204a0b2a89e1c72fcbf9f2a7de0a575a3 (diff) |
Consistently use 'c' as configuration directory variable
-rw-r--r-- | bpkg/cfg-create.cxx | 37 | ||||
-rw-r--r-- | bpkg/pkg-configure.cxx | 2 | ||||
-rw-r--r-- | bpkg/pkg-disfigure.cxx | 2 | ||||
-rw-r--r-- | bpkg/pkg-fetch.cxx | 14 | ||||
-rw-r--r-- | bpkg/pkg-purge.cxx | 2 | ||||
-rw-r--r-- | 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<package> p = db.find<package> (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 ()) |