Skip to content

feat(version upgrade): Add diff & confirmation for pkgctl version upgrade

Robin Candau requested to merge antiz/devtools:version_upgrade_confirm into master

pkgctl version upgrade now shows a diff of the changes that would be made to the PKGBUILD and asks for user's confirmation to apply them.

Changes are made to a temporary fresh copy of the PKGBUILD and are only applied to the actual PKGBUILD if the user gives confirmation to do so.
This ensures that no other potential untracked changes made prior to pkgctl version upgrade are lost or overwritten and it makes the overall process more "atomic" as the actual PKGBUILD is only modified once the whole upgrade process is over (and the associated changes acknowledged and verified by the user) on the temporary file; preventing eventual undesired "half-baked" changes (e.g. updated $pkgver but no updated checksums).

The --noconfirm flag can be passed to avoid being prompted for a confirmation. The applied changes are still shown however.

This new behavior addresses concerns about the new feature proposed in !261 (which could eventually lead to "yolo" upgrades / packaging). With this new feature, packagers will have to acknowledge & confirm changes before the build starts.

Screenshots:

  • Confirming changes:

2024-10-09_22-43

  • Not confirming changes:

2024-10-09_22-42

  • Passing the --noconfirm flag:

2024-10-09_22-45

  • On multiple pkgbases / paths:

2024-10-09_22-46

Closes #239

Edited by Robin Candau

Merge request reports

Loading