Skip to content

Commit

Permalink
Fix bug with transitive dependency order
Browse files Browse the repository at this point in the history
We were recursing before prepending the dependency. This would add
transitive dependencies after of direct ones and fail on install.

Also add some debug statements to help track future problems.
  • Loading branch information
pbrisbin committed Feb 7, 2015
1 parent 875b373 commit f022d6c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions aurget
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,18 @@ resolve_dependencies() {
resolve() {
local name dep

debug "resolving dependencies for $colorG$*$nocolor..."

for name; do
if source_pkgbuild "$name"; then
if [[ " ${arguments[*]} " =~ " $name " ]]; then
debug "skipping (already in argument list)"
else
dependencies=( "$name" "${dependencies[@]}" )
debug "added dependency $colorG$name$nocolor"
debug "current set: $colorG${dependencies[*]}$nocolor"
fi

depends=($(pacman -T -- "${depends[@]}" "${makedepends[@]}"))
depends=("${depends[@]%>*}")
depends=("${depends[@]%=*}")
Expand All @@ -483,8 +493,6 @@ resolve() {
for dep in "${depends[@]}"; do
resolve "$dep"
done

[[ " ${arguments[*]} " =~ " $name " ]] || dependencies=( "$name" "${dependencies[@]}" )
fi
done
}
Expand Down

0 comments on commit f022d6c

Please sign in to comment.