diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2022-06-03 21:53:48 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-06-07 13:49:14 +0300 |
commit | 00cda575c97494d1b6caf2d05ea8a1f8e848cd8a (patch) | |
tree | 19adfe4823b460367b80630c2b43ed553fc391a0 /bpkg/bpkg.cxx | |
parent | deecf4971fbc90b472135e30387bc76e9788061b (diff) |
Add --keep-temp common option
Diffstat (limited to 'bpkg/bpkg.cxx')
-rw-r--r-- | bpkg/bpkg.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bpkg/bpkg.cxx b/bpkg/bpkg.cxx index e6ca4be..2a9fb6d 100644 --- a/bpkg/bpkg.cxx +++ b/bpkg/bpkg.cxx @@ -531,6 +531,8 @@ init (const common_options& co, if (tmp) init_tmp (dir_path (cfg_dir (&o))); + keep_tmp = o.keep_tmp (); + return o; } @@ -744,7 +746,20 @@ try if (build2_sched.started ()) build2_sched.shutdown (); - clean_tmp (true /* ignore_error */); + if (!keep_tmp) + { + clean_tmp (true /* ignore_error */); + } + else if (verb > 1) + { + for (const auto& d: tmp_dirs) + { + const dir_path& td (d.second); + + if (exists (td)) + info << "keeping temporary directory " << td; + } + } if (r != 0) return r; |