diff options
Diffstat (limited to 'bpkg/rep-info.cxx')
-rw-r--r-- | bpkg/rep-info.cxx | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/bpkg/rep-info.cxx b/bpkg/rep-info.cxx index b90ace8..190a210 100644 --- a/bpkg/rep-info.cxx +++ b/bpkg/rep-info.cxx @@ -1,14 +1,11 @@ // file : bpkg/rep-info.cxx -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #include <bpkg/rep-info.hxx> -#include <iostream> // cout -#include <algorithm> // find_if() +#include <iostream> // cout -#include <libbutl/sha256.mxx> // sha256_to_fingerprint() -#include <libbutl/manifest-serializer.mxx> +#include <libbutl/manifest-serializer.hxx> #include <libbpkg/manifest.hxx> @@ -51,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) ? ¤t_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. // @@ -330,7 +348,6 @@ namespace bpkg } else serialize (cout, "stdout"); - } else { |