summaryrefslogtreecommitdiffstats
path: root/bpkg/pkg-build.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/pkg-build.cxx')
-rw-r--r--bpkg/pkg-build.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/bpkg/pkg-build.cxx b/bpkg/pkg-build.cxx
index 80e14f0..27e509b 100644
--- a/bpkg/pkg-build.cxx
+++ b/bpkg/pkg-build.cxx
@@ -4260,13 +4260,20 @@ namespace bpkg
{
if (*p.action == build_package::drop)
{
- transaction t (db, !simulate /* start */);
- pkg_purge (c, t, sp, simulate); // Commits the transaction.
+ // Note that the selected system package has already gone being
+ // disfigured (see above).
+ //
+ if (sp != nullptr)
+ {
+ transaction t (db, !simulate /* start */);
+ pkg_purge (c, t, sp, simulate); // Commits the transaction.
- if (verbose && !o.no_result ())
- text << "purged " << *sp;
+ if (verbose && !o.no_result ())
+ text << "purged " << *sp;
+
+ sp = nullptr;
+ }
- sp = nullptr;
break;
}