From 7144a1a73df5dd02d54f992dd957a10f7abec504 Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Tue, 31 Oct 2017 20:21:10 +0100 Subject: Start fixing small issues - A few variables had to be unquoted (in for loops). - ${#somevar} does not behave as expected. - Fix a typo. --- auria.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/auria.sh b/auria.sh index 714980e..fd90df5 100755 --- a/auria.sh +++ b/auria.sh @@ -485,7 +485,7 @@ function resolve_deps aur_deps["$pkg"]="$(printf " %s " "${deps[@]}" "${makedeps[@]}")" aur_deps_test["$pkg"]="${aur_deps["$pkg"]}" - if [ ${#dep} -eq 0 ] + if (( ${#deps} + ${#makedeps} == 0 )) then aur_pkgorder+=("$pkg") else @@ -506,16 +506,19 @@ function make_pkgorder { local pkg + test -n "${aur_pkgorder[$i]}" && return 0 + + ## Go up the reverse tree from bottom to top. local -i i=0 - while [ $i -lt ${#aur_pkgorder} ] + while test -n "${aur_pkgorder[$i]}" do pkg="${aur_pkgorder[$i]}" # Remove the resolved package off the dependency tree. # Note, that the reverse dependencies do not require removal. - for revdep in "${aur_revdeps["$pkg"]}" + for revdep in ${aur_revdeps["$pkg"]} do aur_deps["$revdep"]="${aur_deps["$revdep"]/ $pkg /}" if test -z "${aur_deps["$revdep"]}" @@ -523,6 +526,7 @@ function make_pkgorder aur_pkgorder+=("$revdep") fi done + i+=1 done if test -n "${aur_deps["$pkg"]}" @@ -548,7 +552,7 @@ function install_deptree # Remove the resolved package off the dependency tree. # Note, that the reverse dependencies do not require removal. - for revdep in "${aur_revdeps["$pkg"]}" + for revdep in ${aur_revdeps["$pkg"]} do aur_deps["$revdep"]="${aur_deps["$revdep"]/ $pkg /}" if test -z "${aur_deps["$revdep"]}" @@ -635,7 +639,7 @@ function guess_vcs # interactive (<- update). function update_all { - for pkg in "$(pacman -Qmq)" + for pkg in $(pacman -Qmq) do update "$pkg" done -- cgit v1.2.3