Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Candau <robincandau@protonmail.com>2024-02-23 11:04:03 +0100
committerLevente Polyak <anthraxx@archlinux.org>2024-04-23 20:23:42 +0200
commit55c2ca1312e649916a9a4469b7e88464f2f20c38 (patch)
tree01e494934a38e835b75aeb77c6e0391a312f612d
parentccee85b2ab8131a1eb285a90bf4107ee638952a6 (diff)
feat(version): let upgrade subcommand also update checksums
This commit aims to make 'pkgctl version upgrade' also update checksums in addition of bumping the pkgver and reseting the pkgrel. Component: pkgctl version upgrade
-rw-r--r--README.md2
-rw-r--r--contrib/completion/bash/devtools.in1
-rw-r--r--contrib/completion/zsh/_devtools.in1
-rw-r--r--doc/man/pkgctl-version-upgrade.1.asciidoc6
-rw-r--r--src/lib/version/upgrade.sh17
5 files changed, 22 insertions, 5 deletions
diff --git a/README.md b/README.md
index 6b6b372..2682aa4 100644
--- a/README.md
+++ b/README.md
@@ -91,7 +91,7 @@ Component: pkgctl db remove
- bat (pretty printing)
- nvchecker (version checking)
-- pacman-contrib (--update-checksums options for pkgctl build)
+- pacman-contrib (--update-checksums and --pkgver=*PKGVER* options for pkgctl build, pkgctl version upgrade)
### Development Dependencies
diff --git a/contrib/completion/bash/devtools.in b/contrib/completion/bash/devtools.in
index 136c80f..6b88203 100644
--- a/contrib/completion/bash/devtools.in
+++ b/contrib/completion/bash/devtools.in
@@ -373,6 +373,7 @@ _pkgctl_version_setup_opts() { _filedir -d; }
_pkgctl_version_setup_args__url_opts() { :; }
_pkgctl_version_upgrade_args=(
+ --no-update-checksums
-v --verbose
-h --help
)
diff --git a/contrib/completion/zsh/_devtools.in b/contrib/completion/zsh/_devtools.in
index f430dae..7c0fe91 100644
--- a/contrib/completion/zsh/_devtools.in
+++ b/contrib/completion/zsh/_devtools.in
@@ -311,6 +311,7 @@ _pkgctl_version_setup_args=(
)
_pkgctl_version_upgrade_args=(
+ '--no-update-checksums[Disable computation and update of the checksums]'
'(-v --verbose)'{-v,--verbose}'[Display results including up-to-date versions]'
'(-h --help)'{-h,--help}'[Display usage]'
'*:git_dir:_files -/'
diff --git a/doc/man/pkgctl-version-upgrade.1.asciidoc b/doc/man/pkgctl-version-upgrade.1.asciidoc
index 044545d..02ceff9 100644
--- a/doc/man/pkgctl-version-upgrade.1.asciidoc
+++ b/doc/man/pkgctl-version-upgrade.1.asciidoc
@@ -18,7 +18,7 @@ upstream versions.
Upon execution, it automatically adjusts the PKGBUILD file, ensuring that the
pkgver field is set to match the latest version available from the upstream
source. In addition to updating the pkgver, this command also resets the pkgrel
-to 1.
+to 1 and updates checksums.
Outputs a summary of upgraded packages, up-to-date packages, and any check
failures.
@@ -35,6 +35,9 @@ PKGBUILD. Refer to the configuration section in pkgctl-version(1).
Options
-------
+*--no-update-checksums*::
+ Disable computation and update of the checksums
+
*-v, --verbose*::
Display results including up-to-date versions
@@ -46,5 +49,6 @@ See Also
pkgctl-version(1)
nvchecker(1)
+updpkgsums(8)
include::include/footer.asciidoc[]
diff --git a/src/lib/version/upgrade.sh b/src/lib/version/upgrade.sh
index df3b77d..2885182 100644
--- a/src/lib/version/upgrade.sh
+++ b/src/lib/version/upgrade.sh
@@ -30,14 +30,15 @@ pkgctl_version_upgrade_usage() {
Upon execution, it automatically adjusts the PKGBUILD file, ensuring that the
pkgver field is set to match the latest version available from the upstream
source. In addition to updating the pkgver, this command also resets the pkgrel
- to 1.
+ to 1 and updates checksums.
Outputs a summary of upgraded packages, up-to-date packages, and any check
failures.
OPTIONS
- -v, --verbose Display results including up-to-date versions
- -h, --help Show this help text
+ --no-update-checksums Disable computation and update of the checksums
+ -v, --verbose Display results including up-to-date versions
+ -h, --help Show this help text
EXAMPLES
$ ${COMMAND} neovim vim
@@ -50,6 +51,7 @@ pkgctl_version_upgrade() {
local verbose=0
local exit_code=0
local current_item=0
+ local update_checksums=1
while (( $# )); do
case $1 in
@@ -57,6 +59,10 @@ pkgctl_version_upgrade() {
pkgctl_version_upgrade_usage
exit 0
;;
+ --no-update-checksums)
+ update_checksums=0
+ shift
+ ;;
-v|--verbose)
verbose=1
shift
@@ -153,6 +159,11 @@ pkgctl_version_upgrade() {
# change the PKGBUILD
pkgbuild_set_pkgver "${upstream_version}"
pkgbuild_set_pkgrel 1
+
+ # download sources and update the checksums
+ if (( update_checksums )); then
+ updpkgsums
+ fi
fi
popd >/dev/null