Fix traversal of cascading profiles by euse (Bug 379559).
authorPaul Varner <fuzzyray@gentoo.org>
Wed, 24 Aug 2011 17:28:06 +0000 (12:28 -0500)
committerPaul Varner <fuzzyray@gentoo.org>
Wed, 24 Aug 2011 17:28:06 +0000 (12:28 -0500)
Thanks to Ian Abbot for the patch!

bin/euse

index be47cc93ed909b3e1f81aa17fcac6f0d7524b4b0..bedba35a29656dd83bb3a97af789aab475c705b2 100755 (executable)
--- a/bin/euse
+++ b/bin/euse
@@ -439,7 +439,6 @@ traverse_profile() {
        
        curdir="${2:-$(get_real_path ${MAKE_PROFILE_PATH})}"
        
-       [[ -f "${curdir}/${1}" ]] && rvalue="${curdir}/${1} ${rvalue}"
        if [[ -f "${curdir}/parent" ]]; then
                for parent in $(egrep -v '(^#|^ *$)' ${curdir}/parent); do
                        # Bug 231394, handle parent path being absolute
@@ -448,9 +447,10 @@ traverse_profile() {
                        else
                                pdir="$(get_real_path ${curdir}/${parent})"
                        fi
-                       rvalue="$(traverse_profile ${1} ${pdir}) ${rvalue}"
+                       rvalue="${rvalue} $(traverse_profile ${1} ${pdir})"
                done
        fi
+       [[ -f "${curdir}/${1}" ]] && rvalue="${rvalue} ${curdir}/${1}"
 
        echo "${rvalue}"
 } # }}}