Skip to content

Conversation

@evadot
Copy link
Contributor

@evadot evadot commented Dec 2, 2025

The goal of unregister is to remove the record from the database that a package is install but to no touch the files (or even run the scripts as we want to keep the generated data for example). This will allow people to migrate from a pkgbase to a non-pkgbase install.

Sponsored by: Beckhoff Automation GmbH & Co. KG

.Os
.Sh NAME
.Nm "pkg unregister"
.Nd deletes packages from the database
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"deletes package records from the database" maybe to make it very clear it's not touching the content

with unfulfilled dependencies,
.Nm
will add the packages with unfulfilled dependencies to the list of
packages to be deleted, unless forced to proceed without deleting any
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we delete those or unregister them?

@emaste
Copy link
Member

emaste commented Dec 2, 2025

CC @ifreund

#define PKG_DELETE_UPGRADE (1 << 1) /* delete as a split upgrade */
#define PKG_DELETE_NOSCRIPT (1 << 2) /* don't run delete scripts */
#define PKG_DELETE_NOEXEC (1 << 3) /* don't run delete scripts which execute things*/
#define PKG_DELETE_NOFILES (1 << 4) /* don't delete files */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PKG_DELETE_KEEPFILES ?

libpkg/pkg.h.in Outdated
PKG_FLAG_UPGRADE_VULNERABLE = (1U << 13),
PKG_FLAG_NOEXEC = (1U << 14)
PKG_FLAG_NOEXEC = (1U << 14),
PKG_FLAG_NODELETEFILES = (1U << 15)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PKG_FLAG_KEEPFILES?

src/main.c Outdated
{ "stats", "Displays package database statistics", exec_stats, usage_stats},
{ "triggers", "Execute deferred triggers", exec_triggers, usage_triggers},
{ "unlock", "Unlocks a package, allowing modification or deletion", exec_unlock, usage_lock},
{ "unregister", "Deletes packages from the database", exec_unregister, usage_unregister},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deletes packages entry from the database leaving the files on the filesystem ?

@bapt
Copy link
Member

bapt commented Dec 2, 2025

in general this looks good to me, mostly cosmetic and wording issues

The goal of unregister is to remove the record from the database that
a package is install but to no touch the files (or even run the scripts
as we want to keep the generated data for example).
This will allow people to migrate from a pkgbase to a non-pkgbase install.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
@evadot
Copy link
Contributor Author

evadot commented Dec 2, 2025

in general this looks good to me, mostly cosmetic and wording issues

It should be better now

@bapt bapt merged commit e133b21 into main Dec 4, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants