From: genone Date: Mon, 16 Jun 2008 00:50:17 +0000 (-0000) Subject: add support for multi-parent profiles, account for missing newline in make.conf X-Git-Tag: gentoolkit-0.2.4.3~23 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4bb65f17f6ca409104a54e78ff7505e8b5bf35cd;p=gentoolkit.git add support for multi-parent profiles, account for missing newline in make.conf svn path=/; revision=490 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 9bad1fe..41844d9 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2008-06-16: Marius Mauch + * euse: Add support for multi-parent profiles, account for missing + final newline in make.conf + 2008-03-19: Paul Varner * glsa-check: Fix imports so mail functionality in glsa-check works with python versions less than 2.5 (Bug 211706) diff --git a/trunk/src/euse/euse b/trunk/src/euse/euse index 3b73ec0..ed70932 100755 --- a/trunk/src/euse/euse +++ b/trunk/src/euse/euse @@ -136,6 +136,9 @@ for x in sys.stdin.read().split(): elif x[0] != '-' and '-'+x in r: r.remove('-'+x) r.append(x) + elif x == '-*': + r = [] + r.append(x) elif x not in r: r.append(x) print ' '.join(r)" @@ -195,13 +198,15 @@ get_all_make_defaults() { local parent local rvalue - curdir="$(get_real_path ${MAKE_PROFILE_PATH})" + curdir="${1:-$(get_real_path ${MAKE_PROFILE_PATH})}" - while [ -f "${curdir}/parent" ]; do - [ -f "${curdir}/make.defaults" ] && rvalue="${curdir}/make.defaults ${rvalue}" - parent="$(egrep -v '(^#|^ *$)' ${curdir}/parent)" - curdir="$(get_real_path ${curdir}/${parent})" - done + [ -f "${curdir}/make.defaults" ] && rvalue="${curdir}/make.defaults ${rvalue}" + if [ -f "${curdir}/parent" ]; then + for parent in $(egrep -v '(^#|^ *$)' ${curdir}/parent); do + pdir="$(get_real_path ${curdir}/${parent})" + rvalue="$(get_all_make_defaults ${pdir}) ${rvalue}" + done + fi echo "${rvalue}" } @@ -211,12 +216,16 @@ get_make_defaults() { local curdir local parent - curdir="$(get_real_path ${MAKE_PROFILE_PATH})" + curdir="${1:-$(get_real_path ${MAKE_PROFILE_PATH})}" - while [ ! -f "${curdir}/make.defaults" -a -f "${curdir}/parent" ]; do - parent="$(egrep -v '(^#|^ *$)' ${curdir}/parent)" - curdir="$(get_real_path ${curdir}/${parent})" - done + if [ ! -f "${curdir}/make.defaults" -a -f "${curdir}/parent" ]; then + for parent in $(egrep -v '(^#|^ *$)' ${curdir}/parent); do + if [ -f "$(get_make_defaults ${curdir}/${parent})" ]; then + curdir="${curdir}/${parent}" + break + fi + done + fi echo "${curdir}/make.defaults" } @@ -501,7 +510,10 @@ modify() { # closing ", printing our new USE line there instead. inuse=0 had_use=0 - (while read -r line; do + x=0 + (while [ "$x" -eq "0" ]; do + read -r line + x="$?" [ "${line:0:4}" == "USE=" ] && inuse=1 [ "${inuse}" == "0" ] && echo -E "${line}" if [ "${inuse}" == "1" ] && echo "${line}" | egrep '" *(#.*)?$' > /dev/null; then