diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-14 00:54:05 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-03-16 13:45:18 +0300 |
commit | bc24eec7208187e171fd61ced7130fd8e2828257 (patch) | |
tree | 23e9076f0e06282001758ef5939db872eba214ff /bpkg/pkg-purge.cxx | |
parent | 5f75406495f06b75eb10b3456a1ca550f4e55b61 (diff) |
Add support for version iteration
Diffstat (limited to 'bpkg/pkg-purge.cxx')
-rw-r--r-- | bpkg/pkg-purge.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/bpkg/pkg-purge.cxx b/bpkg/pkg-purge.cxx index fa5ce01..e1cd113 100644 --- a/bpkg/pkg-purge.cxx +++ b/bpkg/pkg-purge.cxx @@ -37,19 +37,30 @@ namespace bpkg if (exists (d)) // Don't complain if someone did our job for us. rm_r (d); - p->src_root = nullopt; p->purge_src = false; } - if (p->purge_archive && archive) + // Let's forget about the possibly non-purged source directory, as the + // selected package may now be reused for unrelated package version. + // + p->src_root = nullopt; + p->manifest_checksum = nullopt; + + if (archive) { - path a (p->archive->absolute () ? *p->archive : c / *p->archive); + if (p->purge_archive) + { + path a (p->archive->absolute () ? *p->archive : c / *p->archive); - if (exists (a)) - rm (a); + if (exists (a)) + rm (a); + p->purge_archive = false; + } + + // Let's forget about the possibly non-purged archive (see above). + // p->archive = nullopt; - p->purge_archive = false; } } catch (const failed&) |