From 09e0710f8e06443615ecc216ec34ff8173ca51d4 Mon Sep 17 00:00:00 2001 From: merakor Date: Fri, 17 Jul 2020 10:24:34 +0000 Subject: kiss: change behaviour for downloading updates kiss update: add --download|-d flag for only downloading packages and exiting kiss download: if no arguments are given use the current directory for downloading FossilOrigin-Name: 8cb866afa98d7dff4e8c9b645698566d1fb4ce432aff869863282e57fe469e17 --- kiss | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/kiss b/kiss index 60ab7e0..82c1be1 100755 --- a/kiss +++ b/kiss @@ -1343,7 +1343,10 @@ pkg_updates(){ # If the download option is specified only download the outdated packages # and exit. - [ "$download" ] && { + [ "$download_only" = 1 ] && { + log "Only sources for the packages will be acquired" + prompt || exit 0 + for pkg in $outdated; do pkg_sources "$pkg" done @@ -1448,7 +1451,7 @@ args() { esac case $action in - b|build|c|checksum|i|install|r|remove) + b|build|c|checksum|d|download|i|install|r|remove) [ "$1" ] || { # We are exporting the KISS_PATH, so if another # instance of 'kiss' is spawned from the current @@ -1557,18 +1560,13 @@ args() { done ;; - 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 - ;; + u|update) + case "$1" in --download|-d) download_only=1; esac + pkg_updates ;; b|build) pkg_build "${@:?No packages installed}" ;; + d|download) for pkg do pkg_sources "$pkg"; done ;; l|list) pkg_list "$@" ;; - u|update) pkg_updates ;; s|search) for pkg do pkg_find "$pkg" all; done ;; v|version) log kiss 2.3.0 ;; -- cgit v1.2.3