aboutsummaryrefslogtreecommitdiff
path: root/bpkg/rep-info.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/rep-info.cxx')
-rw-r--r--bpkg/rep-info.cxx31
1 files changed, 25 insertions, 6 deletions
diff --git a/bpkg/rep-info.cxx b/bpkg/rep-info.cxx
index 1a23528..190a210 100644
--- a/bpkg/rep-info.cxx
+++ b/bpkg/rep-info.cxx
@@ -5,8 +5,7 @@
#include <iostream> // cout
-#include <libbutl/sha256.mxx> // sha256_to_fingerprint()
-#include <libbutl/manifest-serializer.mxx>
+#include <libbutl/manifest-serializer.hxx>
#include <libbpkg/manifest.hxx>
@@ -49,12 +48,33 @@ namespace bpkg
// unknown manifest entries unless we are dumping them.
//
dir_path d (o.directory ());
+
+ const dir_path* conf (o.directory_specified () && d.empty ()
+ ? nullptr
+ : &d);
+
+ // If --directory|-d is not specified and the current working directory is
+ // a configuration directory, then initialize the temporary directory
+ // inside it, so that we can always move a version control-based
+ // repository into and out of it (see pkg_checkout() for details).
+ //
+ if (conf != nullptr && conf->empty ())
+ conf = exists (bpkg_dir) ? &current_dir : nullptr;
+
+ assert (conf == nullptr || !conf->empty ());
+
+ init_tmp (conf != nullptr ? *conf : empty_dir_path);
+
+ bool ignore_unknown (!o.manifest () || o.ignore_unknown ());
+
rep_fetch_data rfd (
rep_fetch (o,
- o.directory_specified () && d.empty () ? nullptr : &d,
+ conf,
rl,
- !o.manifest () /* ignore_unknow */,
- o.deep () /* expand_values */));
+ ignore_unknown,
+ ignore_unknown /* ignore_toolchain */,
+ o.deep () /* expand_values */,
+ o.deep () /* load_buildfiles */));
// Now print.
//
@@ -328,7 +348,6 @@ namespace bpkg
}
else
serialize (cout, "stdout");
-
}
else
{