aboutsummaryrefslogtreecommitdiff
path: root/bpkg/pkg-purge.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'bpkg/pkg-purge.cxx')
-rw-r--r--bpkg/pkg-purge.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/bpkg/pkg-purge.cxx b/bpkg/pkg-purge.cxx
index 34ca7f8..c61658e 100644
--- a/bpkg/pkg-purge.cxx
+++ b/bpkg/pkg-purge.cxx
@@ -82,6 +82,8 @@ namespace bpkg
db.erase (p);
t.commit ();
+
+ p->state = package_state::transient;
}
int
@@ -190,16 +192,18 @@ namespace bpkg
{
p->state = package_state::fetched;
db.update (p);
+ t.commit ();
}
}
else
+ {
db.erase (p);
-
- t.commit ();
+ t.commit ();
+ p->state = package_state::transient;
+ }
if (verb)
- text << (o.keep () ? "keeping archive " : "purged ")
- << p->name << " " << p->version;
+ text << (o.keep () ? "keeping archive " : "purged ") << *p;
return 0;
}