From: Fabian Groffen Date: Sat, 2 May 2009 09:31:29 +0000 (-0000) Subject: Merged from trunk -r13580:13589 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=2846f01ed8442096865342d570bc79682b5e0e20;p=portage.git Merged from trunk -r13580:13589 | 13582 | Make elog functions use read -r when splitting lines, so | | zmedico | that backslashes intended for display will not be eaten. | | 13584 | Bug #267175 - Instead of "poor code kills airplanes", say | | zmedico | "install aborted due to poor programming practices shown | | | above" in order to help the user link the die message to the | | | related "poor programming practices" messages. Thanks to | | | Jeremy Olexa for the suggestion. | | 13589 | Fix DepPriority.__int__() to return distinguishable values, | | zmedico | for use when measuring hardness for the circular dependency | | | display. This fixes a problem visible in bug #268038, | | | comment #0, where buildtime dependencies are incorrectly | | | displayed as runtime dependencies. | svn path=/main/branches/prefix/; revision=13595 --- diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index a8d05c912..b6044b26b 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -176,7 +176,7 @@ elog_base() { return 1 ;; esac - echo -e "$@" | while read ; do + echo -e "$@" | while read -r ; do echo "$messagetype $REPLY" >> \ "${T}/logging/${EBUILD_PHASE:-other}" done @@ -186,8 +186,8 @@ elog_base() { eqawarn() { elog_base QA "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - vecho -e " $WARN*$NORMAL $REPLY" >&2 + echo -e "$@" | while read -r ; do + vecho " $WARN*$NORMAL $REPLY" >&2 done LAST_E_CMD="eqawarn" return 0 @@ -196,8 +196,8 @@ eqawarn() { elog() { elog_base LOG "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - echo -e " $GOOD*$NORMAL $REPLY" + echo -e "$@" | while read -r ; do + echo " $GOOD*$NORMAL $REPLY" done LAST_E_CMD="elog" return 0 @@ -226,8 +226,8 @@ esyslog() { einfo() { elog_base INFO "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - echo -e " $GOOD*$NORMAL $REPLY" + echo -e "$@" | while read -r ; do + echo " $GOOD*$NORMAL $REPLY" done LAST_E_CMD="einfo" return 0 @@ -244,8 +244,8 @@ einfon() { ewarn() { elog_base WARN "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - echo -e " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2 + echo -e "$@" | while read -r ; do + echo " $WARN*$NORMAL $RC_INDENTATION$REPLY" >&2 done LAST_E_CMD="ewarn" return 0 @@ -254,8 +254,8 @@ ewarn() { eerror() { elog_base ERROR "$*" [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo - echo -e "$@" | while read ; do - echo -e " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2 + echo -e "$@" | while read -r ; do + echo " $BAD*$NORMAL $RC_INDENTATION$REPLY" >&2 done LAST_E_CMD="eerror" return 0 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 6670bc4cd..2c0dedf35 100644 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -539,14 +539,16 @@ install_qa_check() { fi if [[ ${abort} == "yes" ]] ; then if [[ ${gentoo_bug} == "yes" ]] ; then - die "poor code kills airplanes" + die "install aborted due to" \ + "poor programming practices shown above" else echo "Please do not file a Gentoo bug and instead" \ "report the above QA issues directly to the upstream" \ "developers of this software." | fmt -w 70 | \ while read line ; do eqawarn "${line}" ; done eqawarn "Homepage: ${HOMEPAGE}" - hasq stricter ${FEATURES} && die "poor code kills airplanes" + hasq stricter ${FEATURES} && die "install aborted due to" \ + "poor programming practices shown above" fi fi fi diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index d7738ba90..5ad4842a8 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -951,6 +951,43 @@ class DepPriority(AbstractDepPriority): __slots__ = ("satisfied", "optional", "rebuild") def __int__(self): + """ + Note: These priorities are only used for measuring hardness + in the circular dependency display via digraph.debug_print(), + and nothing more. For actual merge order calculations, the + measures defined by the DepPriorityNormalRange and + DepPrioritySatisfiedRange classes are used. + + Attributes Hardness + + not satisfied and buildtime 8 + not satisfied and runtime 7 + not satisfied and runtime_post 6 + satisfied and buildtime and rebuild 5 + satisfied and buildtime 4 + satisfied and runtime 3 + satisfied and runtime_post 2 + optional 1 + (none of the above) 0 + + """ + if not self.satisfied: + if self.buildtime: + return 8 + if self.runtime: + return 7 + if self.runtime_post: + return 6 + if self.buildtime: + if self.rebuild: + return 5 + return 4 + if self.runtime: + return 3 + if self.runtime_post: + return 2 + if self.optional: + return 1 return 0 def __str__(self):