diff options
author | davidovski <david@davidovski.xyz> | 2022-02-20 14:52:30 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-02-20 14:52:30 +0000 |
commit | ddc160469a6b870f225a78ce579029cf1ef90e03 (patch) | |
tree | 6e9799caf309353884372ade13c623211fd78cf2 /src/get.sh | |
parent | 5e64673025351660b27ad61e215ef38a8f033c85 (diff) |
added laoding bar for resolving deps
Diffstat (limited to 'src/get.sh')
-rwxr-xr-x | src/get.sh | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -15,16 +15,20 @@ list_deps() { # list all dependencies and sub dependencies of a package # resolve_deps () { + local out="${CACHE_DIR}/deps" local deps="" + local i=0 if ${RESOLVE_DEPS}; then while [ "$#" != "0" ]; do # pop a value from the args local package=$1 - shift #only add if not already added - echo ${deps} | grep -q "\b$package\b" || deps="$deps $package" + if ! echo ${deps} | grep -q "\b$package\b"; then + deps="$deps $package" + i=$((i+1)) + fi for dep in $(list_deps $package); do # if not already checked @@ -32,10 +36,13 @@ resolve_deps () { set -- $@ $dep fi done + shift + ${QUIET} || hbar -T "${CHECKMARK} resolving dependencies" $i $((i + $#)) done - echo ${deps} + ${QUIET} || hbar -t ${HBAR_COMPLETE} -T "${CHECKMARK} resolved dependencies" $i $((i + $#)) + echo ${deps} > $out else - echo $@ + echo $@ > $out fi } @@ -126,7 +133,11 @@ fetch () { local total_download=0 - for package in $(resolve_deps $@); do + local out="${CACHE_DIR}/deps" + touch $out + resolve_deps $@ + + for package in $(cat $out); do if package_exists $package; then set -- $(get_package_download_info $package) url=$1 |