summaryrefslogtreecommitdiff
path: root/src/get.sh
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-04 23:59:42 +0100
committerdavidovski <david@davidovski.xyz>2022-05-04 23:59:42 +0100
commit8758658db49688b7cc7b55603db1b8438775ccc4 (patch)
tree276e74056ff20e3cc8de512c8c681821bedc0ecd /src/get.sh
parent0bc1eda0408ccf230e76928b0db350558bf5d0f4 (diff)
made help screen colorful
Diffstat (limited to 'src/get.sh')
-rwxr-xr-xsrc/get.sh24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/get.sh b/src/get.sh
index d4a70a0..0107897 100755
--- a/src/get.sh
+++ b/src/get.sh
@@ -120,16 +120,15 @@ download_packages () {
outputs="$outputs ${out_dir}/${checksum}.${package}.xipkg"
done
fetch_serial $total_download $outputs
-
- validate_downloads $outputs
+ ${UNSAFE} || validate_downloads $outputs
+ echo $outputs >> "${CACHE_DIR}/toinstall"
}
# validate signatures of downloaded packages
#
-# outputs: list of xipkg files to verify and install
validate_downloads () {
local i=0
- ${UNSAFE} || for pkg_file in $@; do
+ for pkg_file in $@; do
${QUIET} || hbar -T "${LARGE_CIRCLE} validating downloads..." $i $#
@@ -140,13 +139,12 @@ validate_downloads () {
else
i=$((i+1))
fi
- done &&
+ done
${QUIET} || hbar -t ${HBAR_COMPLETE} -T "${CHECKMARK} validated downloads" $i $#
-
- install $@
}
-# get and install requested packages
+# fetch requested packages
+# and ultimately write the list of package files to toinstall
#
get () {
local requested=$@
@@ -154,14 +152,18 @@ get () {
local total_download=0
local out="${CACHE_DIR}/deps"
+ [ "$#" = "0" ] && return 0
+
+ $DO_SYNC && sync
+
touch $out
resolve_deps $@
for package in $(cat $out); do
- if ! package_exists $package; then
- missing="$missing $package"
+ package_exists $package || {
+ missing="$missing $package"
continue
- fi
+ }
set -- $(get_package_download_info $package)
checksum=$2