aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bpkg/cfg-create.cxx7
-rw-r--r--bpkg/utility.cxx11
2 files changed, 17 insertions, 1 deletions
diff --git a/bpkg/cfg-create.cxx b/bpkg/cfg-create.cxx
index 4fa5de3..1875c75 100644
--- a/bpkg/cfg-create.cxx
+++ b/bpkg/cfg-create.cxx
@@ -31,8 +31,12 @@ namespace bpkg
//
if (exists (d))
{
+ level5 ([&]{trace << "directory " << d << " exists";});
+
if (!empty (d))
{
+ level5 ([&]{trace << "directory " << d << " not empty";});
+
if (!o.wipe ())
fail << "directory " << d << " is not empty";
@@ -40,7 +44,10 @@ namespace bpkg
}
}
else
+ {
+ level5 ([&]{trace << "directory " << d << " does not exist";});
mk_p (d);
+ }
// Sort arguments into modules and configuration variables.
//
diff --git a/bpkg/utility.cxx b/bpkg/utility.cxx
index 1cd518b..f1e9a5a 100644
--- a/bpkg/utility.cxx
+++ b/bpkg/utility.cxx
@@ -36,7 +36,7 @@ namespace bpkg
{
try
{
- return file_exists (d);
+ return dir_exists (d);
}
catch (const system_error& e)
{
@@ -63,6 +63,9 @@ namespace bpkg
void
mk (const dir_path& d)
{
+ if (verb >= 3)
+ text << "mkdir " << d;
+
try
{
try_mkdir (d);
@@ -76,6 +79,9 @@ namespace bpkg
void
mk_p (const dir_path& d)
{
+ if (verb >= 3)
+ text << "mkdir -p " << d;
+
try
{
try_mkdir_p (d);
@@ -89,6 +95,9 @@ namespace bpkg
void
rm_r (const dir_path& d, bool dir)
{
+ if (verb >= 3)
+ text << "rmdir -r " << d << (dir ? "" : "*");
+
try
{
rmdir_r (d, dir);