diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-03 18:24:08 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-04 12:40:57 +0300 |
commit | 7bb44980ced46506c10bad333f526b7bc62ea1db (patch) | |
tree | 207a14ee727f7237e8fc2b08e47f4de8a97e0b99 /bpkg/pkg-checkout.cxx | |
parent | bd02eaa1298271ecf8365aa869e93fdcb04fdeb1 (diff) |
Add support for multiple temporary directories
Diffstat (limited to 'bpkg/pkg-checkout.cxx')
-rw-r--r-- | bpkg/pkg-checkout.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bpkg/pkg-checkout.cxx b/bpkg/pkg-checkout.cxx index d8c6819..49fc89f 100644 --- a/bpkg/pkg-checkout.cxx +++ b/bpkg/pkg-checkout.cxx @@ -191,6 +191,15 @@ namespace bpkg dir_path sd (repository_state (rl)); dir_path rd (rdb.config_orig / repos_dir / sd); + // Use the temporary directory from the repository information source + // configuration, so that we can always move the repository into and out + // of it (note that if they appear on different filesystems that won't + // be possible). + // + auto ti (temp_dir.find (rdb.config_orig)); + assert (ti != temp_dir.end ()); + const dir_path& tdir (ti->second); + // Try to reuse the cached repository (moved to the temporary directory // with some fragment checked out and fixed up). // @@ -214,7 +223,7 @@ namespace bpkg // The repository temporary directory. // - auto_rmdir rmt (temp_dir / sd); + auto_rmdir rmt (tdir / sd); // Move the repository to the temporary directory. // @@ -248,7 +257,7 @@ namespace bpkg // The temporary out of source directory that is required for the dist // meta-operation. // - auto_rmdir rmo (temp_dir / dir_path (n.string ())); + auto_rmdir rmo (tdir / dir_path (n.string ())); const dir_path& od (rmo.path); if (exists (od)) |