aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/cfg-add.cxx2
-rw-r--r--bpkg/cfg-create.cxx8
-rw-r--r--bpkg/cfg-fetch.cxx14
-rw-r--r--bpkg/diagnostics12
-rw-r--r--bpkg/fetch.cxx4
-rw-r--r--bpkg/pkg-build.cxx17
-rw-r--r--bpkg/pkg-command.cxx10
-rw-r--r--bpkg/pkg-configure.cxx10
-rw-r--r--bpkg/pkg-disfigure.cxx10
-rw-r--r--bpkg/pkg-drop.cxx4
-rw-r--r--bpkg/pkg-fetch.cxx6
-rw-r--r--bpkg/pkg-purge.cxx2
-rw-r--r--bpkg/pkg-status.cxx4
-rw-r--r--bpkg/pkg-unpack.cxx8
-rw-r--r--bpkg/pkg-verify.cxx2
-rw-r--r--bpkg/rep-create.cxx10
16 files changed, 61 insertions, 62 deletions
diff --git a/bpkg/cfg-add.cxx b/bpkg/cfg-add.cxx
index 13a306e..5386fff 100644
--- a/bpkg/cfg-add.cxx
+++ b/bpkg/cfg-add.cxx
@@ -21,7 +21,7 @@ namespace bpkg
tracer trace ("cfg_add");
dir_path c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
if (!args.more ())
fail << "repository location argument expected" <<
diff --git a/bpkg/cfg-create.cxx b/bpkg/cfg-create.cxx
index 760c644..0215e5d 100644
--- a/bpkg/cfg-create.cxx
+++ b/bpkg/cfg-create.cxx
@@ -25,18 +25,18 @@ namespace bpkg
fail << "--wipe requires explicit --directory|-d";
dir_path c (o.directory ());
- level4 ([&]{trace << "creating configuration in " << c;});
+ l4 ([&]{trace << "creating configuration in " << c;});
// If the directory already exists, make sure it is empty.
// Otherwise, create it.
//
if (exists (c))
{
- level5 ([&]{trace << "directory " << c << " exists";});
+ l5 ([&]{trace << "directory " << c << " exists";});
if (!empty (c))
{
- level5 ([&]{trace << "directory " << c << " not empty";});
+ l5 ([&]{trace << "directory " << c << " not empty";});
if (!o.wipe ())
fail << "directory " << c << " is not empty" <<
@@ -47,7 +47,7 @@ namespace bpkg
}
else
{
- level5 ([&]{trace << "directory " << c << " does not exist";});
+ l5 ([&]{trace << "directory " << c << " does not exist";});
mk_p (c);
}
diff --git a/bpkg/cfg-fetch.cxx b/bpkg/cfg-fetch.cxx
index f35d081..d311a21 100644
--- a/bpkg/cfg-fetch.cxx
+++ b/bpkg/cfg-fetch.cxx
@@ -32,7 +32,7 @@ namespace bpkg
tracer_guard tg (db, trace);
const repository_location& rl (r->location);
- level4 ([&]{trace << r->name << " " << rl;});
+ l4 ([&]{trace << r->name << " " << rl;});
assert (rl.absolute () || rl.remote ());
// The fetch_*() functions below will be quiet at level 1, which
@@ -148,13 +148,13 @@ namespace bpkg
{
case repository_role::complement:
{
- level4 ([&]{trace << pr->name << " complement of " << r->name;});
+ l4 ([&]{trace << pr->name << " complement of " << r->name;});
r->complements.insert (lazy_shared_ptr<repository> (db, pr));
break;
}
case repository_role::prerequisite:
{
- level4 ([&]{trace << pr->name << " prerequisite of " << r->name;});
+ l4 ([&]{trace << pr->name << " prerequisite of " << r->name;});
r->prerequisites.insert (lazy_weak_ptr<repository> (db, pr));
break;
}
@@ -233,7 +233,7 @@ namespace bpkg
tracer trace ("cfg_fetch");
dir_path c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
database db (open (c, trace));
transaction t (db.begin ());
@@ -256,11 +256,11 @@ namespace bpkg
{
if (r == root)
{
- level5 ([&]{trace << "skipping root";});
+ l5 ([&]{trace << "skipping root";});
}
else if (ua.find (lazy_shared_ptr<repository> (db, r)) != ua.end ())
{
- level4 ([&]{trace << "cleaning " << r->name;});
+ l4 ([&]{trace << "cleaning " << r->name;});
r->complements.clear ();
r->prerequisites.clear ();
@@ -269,7 +269,7 @@ namespace bpkg
}
else
{
- level4 ([&]{trace << "erasing " << r->name;});
+ l4 ([&]{trace << "erasing " << r->name;});
db.erase (r);
}
}
diff --git a/bpkg/diagnostics b/bpkg/diagnostics
index 9a2118f..cbf4509 100644
--- a/bpkg/diagnostics
+++ b/bpkg/diagnostics
@@ -63,12 +63,12 @@ namespace bpkg
//
extern uint16_t verb;
- template <typename F> inline void level1 (const F& f) {if (verb >= 1) f ();}
- template <typename F> inline void level2 (const F& f) {if (verb >= 2) f ();}
- template <typename F> inline void level3 (const F& f) {if (verb >= 3) f ();}
- template <typename F> inline void level4 (const F& f) {if (verb >= 4) f ();}
- template <typename F> inline void level5 (const F& f) {if (verb >= 5) f ();}
- template <typename F> inline void level6 (const F& f) {if (verb >= 6) f ();}
+ template <typename F> inline void l1 (const F& f) {if (verb >= 1) f ();}
+ template <typename F> inline void l2 (const F& f) {if (verb >= 2) f ();}
+ template <typename F> inline void l3 (const F& f) {if (verb >= 3) f ();}
+ template <typename F> inline void l4 (const F& f) {if (verb >= 4) f ();}
+ template <typename F> inline void l5 (const F& f) {if (verb >= 5) f ();}
+ template <typename F> inline void l6 (const F& f) {if (verb >= 6) f ();}
// Diagnostic facility, base infrastructure (potentially reusable).
//
diff --git a/bpkg/fetch.cxx b/bpkg/fetch.cxx
index 257d903..9a5c74a 100644
--- a/bpkg/fetch.cxx
+++ b/bpkg/fetch.cxx
@@ -64,14 +64,14 @@ namespace bpkg
if (p != s.size () && s[p] == '.')
wget_minor = static_cast<uint16_t> (stoul (string (s, p + 1)));
- level4 ([&]{trace << "version " << wget_major << '.' << wget_minor;});
+ l4 ([&]{trace << "version " << wget_major << '.' << wget_minor;});
}
catch (const std::exception&)
{
wget_major = 0;
wget_minor = 0;
- level4 ([&]{trace << "unable to extract version from '" << l << "'";});
+ l4 ([&]{trace << "unable to extract version from '" << l << "'";});
}
return pr.wait ();
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 88d74cc..d516441 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -334,8 +334,8 @@ namespace bpkg
swap (p1, p2);
}
- level4 ([&]{trace << "pick " << n << " " << p1->available->version
- << " over " << p2->available->version;});
+ l4 ([&]{trace << "pick " << n << " " << p1->available->version
+ << " over " << p2->available->version;});
}
// See if we are replacing the object. If not, then we don't
@@ -375,7 +375,7 @@ namespace bpkg
{
string n (pkg.available->id.name); // Note: copy; see emplace() below.
- level4 ([&]{trace << "add " << n << " " << pkg.available->version;});
+ l4 ([&]{trace << "add " << n << " " << pkg.available->version;});
// This is the first time we are adding this package name to the
// map. If it is already selected, then we need to make sure that
@@ -778,7 +778,7 @@ namespace bpkg
tracer trace ("pkg_build");
const dir_path& c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
if (!args.more ())
fail << "package name argument expected" <<
@@ -841,7 +841,7 @@ namespace bpkg
// This is a package archive (note that we shouldn't throw
// failed from here on).
//
- level4 ([&]{trace << "archive " << a;});
+ l4 ([&]{trace << "archive " << a;});
n = m.name;
v = m.version;
ar = root;
@@ -874,7 +874,7 @@ namespace bpkg
// This is a package directory (note that we shouldn't throw
// failed from here on).
//
- level4 ([&]{trace << "directory " << d;});
+ l4 ([&]{trace << "directory " << d;});
n = m.name;
v = m.version;
ap = make_shared<available_package> (move (m));
@@ -904,7 +904,7 @@ namespace bpkg
{
n = parse_package_name (s);
v = parse_package_version (s);
- level4 ([&]{trace << "package " << n << "; version " << v;});
+ l4 ([&]{trace << "package " << n << "; version " << v;});
// Either get the user-specified version or the latest.
//
@@ -1016,8 +1016,7 @@ namespace bpkg
// Finally add this package to the list.
//
- level4 ([&]{trace << "collect " << ap->id.name << " "
- << ap->version;});
+ l4 ([&]{trace << "collect " << ap->id.name << " " << ap->version;});
build_package p {
move (sp),
diff --git a/bpkg/pkg-command.cxx b/bpkg/pkg-command.cxx
index c225bc1..ef473f0 100644
--- a/bpkg/pkg-command.cxx
+++ b/bpkg/pkg-command.cxx
@@ -23,7 +23,7 @@ namespace bpkg
{
tracer trace ("pkg_command");
- level4 ([&]{trace << "command: " << cmd;});
+ l4 ([&]{trace << "command: " << cmd;});
// This one is a bit tricky: we can only update all the packages at once if
// they don't have any package-specific variables. But let's try to handle
@@ -36,7 +36,7 @@ namespace bpkg
if (!bspec.empty ())
{
bspec += ')';
- level4 ([&]{trace << "buildspec: " << bspec;});
+ l4 ([&]{trace << "buildspec: " << bspec;});
run_b (o, bspec, false, cvars, vars);
bspec.clear ();
}
@@ -56,7 +56,7 @@ namespace bpkg
assert (p->out_root); // Should be present since configured.
dir_path out_root (c / *p->out_root); // Always relative.
- level4 ([&]{trace << p->name << " out_root: " << out_root;});
+ l4 ([&]{trace << p->name << " out_root: " << out_root;});
if (bspec.back () != '(')
bspec += ' ';
@@ -78,7 +78,7 @@ namespace bpkg
tracer trace ("pkg_command");
const dir_path& c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
// First read the common variables.
//
@@ -119,7 +119,7 @@ namespace bpkg
fail << "package " << n << " is " << p->state <<
info << "expected it to be configured";
- level4 ([&]{trace << p->name << " " << p->version;});
+ l4 ([&]{trace << p->name << " " << p->version;});
// Read package-specific variables.
//
diff --git a/bpkg/pkg-configure.cxx b/bpkg/pkg-configure.cxx
index 8a4fd5f..4206992 100644
--- a/bpkg/pkg-configure.cxx
+++ b/bpkg/pkg-configure.cxx
@@ -40,8 +40,8 @@ namespace bpkg
: c / *p->src_root);
dir_path out_root (c / dir_path (p->name + "-" + p->version.string ()));
- level4 ([&]{trace << "src_root: " << src_root << ", "
- << "out_root: " << out_root;});
+ l4 ([&]{trace << "src_root: " << src_root << ", "
+ << "out_root: " << out_root;});
// Verify all our prerequisites are configured and populate the
// prerequisites list.
@@ -110,7 +110,7 @@ namespace bpkg
src_root.string () + "/@" +
out_root.string () + "/)";
- level4 ([&]{trace << "buildspec: " << bspec;});
+ l4 ([&]{trace << "buildspec: " << bspec;});
// Configure.
//
@@ -149,7 +149,7 @@ namespace bpkg
tracer trace ("pkg_configure");
const dir_path& c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
// Sort arguments into the package name and configuration variables.
//
@@ -185,7 +185,7 @@ namespace bpkg
fail << "package " << n << " is " << p->state <<
info << "expected it to be unpacked";
- level4 ([&]{trace << p->name << " " << p->version;});
+ l4 ([&]{trace << p->name << " " << p->version;});
pkg_configure (c, o, t, p, vars); // Commits the transaction.
diff --git a/bpkg/pkg-disfigure.cxx b/bpkg/pkg-disfigure.cxx
index 5fa9990..be2ed8b 100644
--- a/bpkg/pkg-disfigure.cxx
+++ b/bpkg/pkg-disfigure.cxx
@@ -65,8 +65,8 @@ namespace bpkg
: c / *p->src_root);
dir_path out_root (c / *p->out_root); // Always relative.
- level4 ([&]{trace << "src_root: " << src_root << ", "
- << "out_root: " << out_root;});
+ l4 ([&]{trace << "src_root: " << src_root << ", "
+ << "out_root: " << out_root;});
// Form the buildspec.
//
@@ -91,7 +91,7 @@ namespace bpkg
out_root.string () + "/)";
}
- level4 ([&]{trace << "buildspec: " << bspec;});
+ l4 ([&]{trace << "buildspec: " << bspec;});
// Disfigure.
//
@@ -132,7 +132,7 @@ namespace bpkg
tracer trace ("pkg_disfigure");
const dir_path& c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
if (!args.more ())
fail << "package name argument expected" <<
@@ -152,7 +152,7 @@ namespace bpkg
fail << "package " << n << " is " << p->state <<
info << "expected it to be configured";
- level4 ([&]{trace << p->name << " " << p->version;});
+ l4 ([&]{trace << p->name << " " << p->version;});
pkg_disfigure (c, o, t, p); // Commits the transaction.
diff --git a/bpkg/pkg-drop.cxx b/bpkg/pkg-drop.cxx
index 66b9382..07717ed 100644
--- a/bpkg/pkg-drop.cxx
+++ b/bpkg/pkg-drop.cxx
@@ -394,7 +394,7 @@ namespace bpkg
fail << "both --yes|-y and --no|-n specified";
const dir_path& c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
if (!args.more ())
fail << "package name argument expected" <<
@@ -424,7 +424,7 @@ namespace bpkg
while (args.more ())
{
string n (args.next ());
- level4 ([&]{trace << "package " << n;});
+ l4 ([&]{trace << "package " << n;});
shared_ptr<selected_package> p (db.find<selected_package> (n));
diff --git a/bpkg/pkg-fetch.cxx b/bpkg/pkg-fetch.cxx
index f677deb..8aba4be 100644
--- a/bpkg/pkg-fetch.cxx
+++ b/bpkg/pkg-fetch.cxx
@@ -136,12 +136,12 @@ namespace bpkg
if (!exists (a))
fail << "archive file '" << a << "' does not exist";
- level4 ([&]{trace << "archive: " << a << ", purge: " << purge;});
+ l4 ([&]{trace << "archive: " << a << ", purge: " << purge;});
// Verify archive is a package and get its manifest.
//
package_manifest m (pkg_verify (co, a, true));
- level4 ([&]{trace << m.name << " " << m.version;});
+ l4 ([&]{trace << m.name << " " << m.version;});
// Check/diagnose an already existing package.
//
@@ -249,7 +249,7 @@ namespace bpkg
tracer trace ("pkg_fetch");
dir_path c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
database db (open (c, trace));
transaction t (db.begin ());
diff --git a/bpkg/pkg-purge.cxx b/bpkg/pkg-purge.cxx
index 62bf982..34ca7f8 100644
--- a/bpkg/pkg-purge.cxx
+++ b/bpkg/pkg-purge.cxx
@@ -90,7 +90,7 @@ namespace bpkg
tracer trace ("pkg_purge");
const dir_path& c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
if (!args.more ())
fail << "package name argument expected" <<
diff --git a/bpkg/pkg-status.cxx b/bpkg/pkg-status.cxx
index a792e0c..1396b1a 100644
--- a/bpkg/pkg-status.cxx
+++ b/bpkg/pkg-status.cxx
@@ -23,7 +23,7 @@ namespace bpkg
tracer trace ("pkg_status");
const dir_path& c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
if (!args.more ())
fail << "package name argument expected" <<
@@ -41,7 +41,7 @@ namespace bpkg
string n (parse_package_name (arg));
version v (parse_package_version (arg));
- level4 ([&]{trace << "package " << n << "; version " << v;});
+ l4 ([&]{trace << "package " << n << "; version " << v;});
// First search in the packages that already exist in this configuration.
//
diff --git a/bpkg/pkg-unpack.cxx b/bpkg/pkg-unpack.cxx
index e3cc499..8eedb1c 100644
--- a/bpkg/pkg-unpack.cxx
+++ b/bpkg/pkg-unpack.cxx
@@ -39,7 +39,7 @@ namespace bpkg
// Verify the directory is a package and get its manifest.
//
package_manifest m (pkg_verify (d, true));
- level4 ([&]{trace << d << ": " << m.name << " " << m.version;});
+ l4 ([&]{trace << d << ": " << m.name << " " << m.version;});
// Make the package and configuration paths absolute and normalized.
// If the package is inside the configuration, use the relative path.
@@ -132,7 +132,7 @@ namespace bpkg
fail << "package " << name << " is " << p->state <<
info << "expected it to be fetched";
- level4 ([&]{trace << p->name << " " << p->version;});
+ l4 ([&]{trace << p->name << " " << p->version;});
assert (p->archive); // Should have archive in the fetched state.
@@ -141,7 +141,7 @@ namespace bpkg
//
path a (p->archive->absolute () ? *p->archive : c / *p->archive);
- level4 ([&]{trace << "archive: " << a;});
+ l4 ([&]{trace << "archive: " << a;});
// Extract the package directory. Currently we always extract it
// into the configuration directory. But once we support package
@@ -222,7 +222,7 @@ namespace bpkg
fail << "--replace|-r can only be specified with --existing|-e";
const dir_path& c (o.directory ());
- level4 ([&]{trace << "configuration: " << c;});
+ l4 ([&]{trace << "configuration: " << c;});
database db (open (c, trace));
transaction t (db.begin ());
diff --git a/bpkg/pkg-verify.cxx b/bpkg/pkg-verify.cxx
index 96caf28..292ea86 100644
--- a/bpkg/pkg-verify.cxx
+++ b/bpkg/pkg-verify.cxx
@@ -222,7 +222,7 @@ namespace bpkg
if (!exists (a))
fail << "archive file '" << a << "' does not exist";
- level4 ([&]{trace << "archive: " << a;});
+ l4 ([&]{trace << "archive: " << a;});
// If we were asked to run silent, don't yap about the reason
// why the package is invalid. Just return the error status.
diff --git a/bpkg/rep-create.cxx b/bpkg/rep-create.cxx
index 8c6d3df..c714445 100644
--- a/bpkg/rep-create.cxx
+++ b/bpkg/rep-create.cxx
@@ -69,7 +69,7 @@ namespace bpkg
//
if (p.string ().front () == '.')
{
- level4 ([&]{trace << "skipping '" << p << "' in " << d;});
+ l4 ([&]{trace << "skipping '" << p << "' in " << d;});
continue;
}
@@ -103,8 +103,8 @@ namespace bpkg
//
m.sha256sum = sha256 (o, a);
- level4 ([&]{trace << m.name << " " << m.version << " in " << a
- << " sha256sum " << *m.sha256sum;});
+ l4 ([&]{trace << m.name << " " << m.version << " in " << a
+ << " sha256sum " << *m.sha256sum;});
// Add package archive location relative to the repository root.
//
@@ -146,13 +146,13 @@ namespace bpkg
if (d.empty ())
throw invalid_path (d.string ());
- level4 ([&]{trace << "creating repository in " << d;});
+ l4 ([&]{trace << "creating repository in " << d;});
// Load the 'repositories' file to make sure it is there and
// is valid.
//
repository_manifests rms (fetch_repositories (d, o.ignore_unknown ()));
- level4 ([&]{trace << rms.size () - 1 << " prerequisite repository(s)";});
+ l4 ([&]{trace << rms.size () - 1 << " prerequisite repository(s)";});
// While we could have serialized as we go along, the order of
// packages will be pretty much random and not reproducible. By