aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-05-09 11:59:10 +0000
committermerakor <cem@ckyln.com>2020-05-09 11:59:10 +0000
commita7f87097d5271ce9f1665a0f1a2d0021883b753d (patch)
tree2cf5630a8ebb987288c784ec03fb3b3186af71ff
parent89433fe7759a8e9e2f5944d5dfa6517271a8a75a (diff)
downloadcpt-a7f87097d5271ce9f1665a0f1a2d0021883b753d.tar.gz
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
-rwxr-xr-xkiss32
1 files 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'