feat(version upgrade): Add diff & confirmation for pkgctl version upgrade
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:
- Not confirming changes:
- Passing the
--noconfirm
flag:
- On multiple pkgbases / paths:
Closes #239