Merged from trunk -r13580:13589
authorFabian Groffen <grobian@gentoo.org>
Sat, 2 May 2009 09:31:29 +0000 (09:31 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 2 May 2009 09:31:29 +0000 (09:31 -0000)
   | 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 <darkside@g.o> 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

bin/isolated-functions.sh
bin/misc-functions.sh
pym/_emerge/__init__.py

index a8d05c91295ab342252db23f227e1327cb028907..b6044b26bf5c51ca89cab0049833a595ba34e54a 100755 (executable)
@@ -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
index 6670bc4cd333ae95083b266180223874beb48c32..2c0dedf3546fbef410e0adcbede1b83d6c8157d1 100644 (file)
@@ -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
index d7738ba90e7ef4c486512a07b91052d3b4fc0143..5ad4842a8bafa3e3459c04c928315b844f87720a 100644 (file)
@@ -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):