From a7f87097d5271ce9f1665a0f1a2d0021883b753d Mon Sep 17 00:00:00 2001 From: merakor Date: Sat, 9 May 2020 11:59:10 +0000 Subject: kiss: add download option This addition can be used to download the package sources. If no arguments are specified, it will run pkg_updates and download the sources of outdated packages. FossilOrigin-Name: 9dbf48e42eb029e8e337b6f59d9f8c6efc346f3a894598a2c51d1103ddcae803 --- kiss | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/kiss b/kiss index 5f62511..821291d 100755 --- a/kiss +++ b/kiss @@ -1277,6 +1277,16 @@ pkg_updates(){ set -f + # If the download option is specified only download the outdated packages + # and exit. + [ "$download" ] && { + for pkg in $outdated; do + pkg_sources "$pkg" + done + + exit 0 + } + contains "$outdated" kiss && { log "Detected package manager update" log "The package manager will be updated first" @@ -1481,18 +1491,28 @@ args() { done ;; - b|build) pkg_build "${@:?No packages installed}" ;; - l|list) pkg_list "$@" ;; - u|update) pkg_updates ;; - s|search) for pkg do pkg_find "$pkg" all; done ;; - v|version) log kiss 1.20.3 ;; + d|download) + # If no arguments are given, download the sources + # for outdated packages. + [ "$1" ] || { download=1; pkg_updates ;} + + # Acquire sources for all given packages. + for pkg do pkg_sources "$pkg"; done + ;; + + b|build) pkg_build "${@:?No packages installed}" ;; + l|list) pkg_list "$@" ;; + u|update) pkg_updates ;; + s|search) for pkg do pkg_find "$pkg" all; done ;; + v|version) log kiss 1.20.3 ;; h|help|-h|--help|'') exec 2>&1 - log 'kiss [a|b|c|e|f|i|l|r|s|u|v] [pkg] [pkg] [pkg]' + log 'kiss [a|b|c|d|e|f|i|l|r|s|u|v] [pkg] [pkg] [pkg]' log 'alternatives List and swap to alternatives' log 'build Build a package' log 'checksum Generate checksums' + log 'download Download sources for the given package' log 'extension List available kiss extensions (kiss-* in $PATH)' log 'fetch Fetch repositories' log 'install Install a package' -- cgit v1.2.3