Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/pkgctl.in
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@archlinux.org>2023-11-05 16:11:12 +0100
committerChristian Heusel <christian@heusel.eu>2024-01-10 19:44:15 +0100
commite6f7aa395fabc7eca1ee4d93e454d2551cea505c (patch)
tree57a604c65a7df94072518db91f95f53cd9bbd6b4 /src/pkgctl.in
parente413b65df3dcddeb94da2defb53ab17ef2a8558d (diff)
feat(version): introduce version check subcommand
The version subcommand handles pkgver related commands, the first subcommand being `check`. Check runs nvchecker if a `.nvchecker.toml` file exists and compares the current pkgver with the latest release. Introduces nvchecker as optional dependency which has to be installed in order to use this particular subcommand. BREAKING CHANGE: formerly pkgctl version would output the version of the pkgctl tool, now it is used as a version related subcommand. Fixes #140 Component: pkgctl version Component: pkgctl version check Co-authored-by: Christian Heusel <christian@heusel.eu>
Diffstat (limited to 'src/pkgctl.in')
-rw-r--r--src/pkgctl.in20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/pkgctl.in b/src/pkgctl.in
index 070e0cd..9deb4b2 100644
--- a/src/pkgctl.in
+++ b/src/pkgctl.in
@@ -27,7 +27,7 @@ usage() {
release Release step to commit, tag and upload build artifacts
repo Manage Git packaging repositories and their configuration
search Search for an expression across the GitLab packaging group
- version Show pkgctl version information
+ version Package version related commands
OPTIONS
-h, --help Show this help text
@@ -39,6 +39,12 @@ if (( $# < 1 )); then
exit 1
fi
+pkgctl_version_print() {
+ cat <<- _EOF_
+ pkgctl @buildtoolver@
+_EOF_
+}
+
export _DEVTOOLS_COMMAND='pkgctl'
setup_workdir
@@ -114,14 +120,20 @@ while (( $# )); do
pkgctl_search "$@"
exit 0
;;
- version|--version|-V)
+ version)
_DEVTOOLS_COMMAND+=" $1"
shift
- # shellcheck source=src/lib/version/version.sh
- source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version/version.sh
+ # shellcheck source=src/lib/version.sh
+ source "${_DEVTOOLS_LIBRARY_DIR}"/lib/version.sh
pkgctl_version "$@"
exit 0
;;
+ --version|-V)
+ _DEVTOOLS_COMMAND+=" $1"
+ shift
+ pkgctl_version_print
+ exit 0
+ ;;
*)
die "invalid command: %s" "$1"
;;