diff options
author | Einhard Leichtfuß <alguien@respiranto.de> | 2017-10-31 20:21:10 +0100 |
---|---|---|
committer | Einhard Leichtfuß <alguien@respiranto.de> | 2017-10-31 20:28:03 +0100 |
commit | 7144a1a73df5dd02d54f992dd957a10f7abec504 (patch) | |
tree | eb500fb6de3460d54007566c7d73ad68ee044b4a | |
parent | 3e53ca05c03cb9d71fe753696e549836f19d4e59 (diff) |
Start fixing small issues
- A few variables had to be unquoted (in for loops).
- ${#somevar} does not behave as expected.
- Fix a typo.
-rwxr-xr-x | auria.sh | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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 |