cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 6a31032c551ecc7b3c26efadf12789b90510a261
parent 04b15f2f2358c6d44da275579a17de38a76c2a3e
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat,  9 May 2020 14:59:11 +0300

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.

Diffstat:
Mkiss | 32++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)

diff --git 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'