Merged from trunk 11215:11223
authorFabian Groffen <grobian@gentoo.org>
Sun, 27 Jul 2008 14:43:00 +0000 (14:43 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 27 Jul 2008 14:43:00 +0000 (14:43 -0000)
   | 11216   | Fixes from Arfrever: * Highlight the "Files built without    |
   | zmedico | respecting LDFLAGS" QA Notice with red. * Remove             |
   |         | scanelf-ignored-LDFLAGS.log when empty.                      |

   | 11217   | Fix breakage from r11213 in INHERITED values returned from   |
   | zmedico | portdbapi.aux_get().                                         |

   | 11218   | Add support to elog_base() to split messages on newlines     |
   | zmedico | automatically. Thanks to Arfrever for the suggestion.        |

   | 11219   | Make all the elog functions split lines when displaying      |
   | zmedico | output, just like elog_base() does when saving it.           |

   | 11220   | Make elog_base() just use \n as the delimiter in the file    |
   | zmedico | since it's safe now that lines are always split.             |

   | 11221   | Use ${NORMAL} to properly restore color when necessary.      |
   | zmedico |                                                              |

   | 11222   | Update path to make.conf.example. Thanks to Arfrever.        |
   | zmedico |                                                              |

   | 11223   | Fix EbuildFetcher to pass all config variables to the        |
   | zmedico | fetcher so things like http_proxy are included.              |

svn path=/main/branches/prefix/; revision=11224

bin/ebuild.sh
bin/isolated-functions.sh
bin/misc-functions.sh
man/make.conf.5
pym/_emerge/__init__.py
pym/portage/__init__.py
pym/portage/dbapi/porttree.py
pym/portage/elog/messages.py

index f0b9312eb827d45258120c3c581081b806241cf4..1375823165358886223d2d860324449174d801a4 100755 (executable)
@@ -1184,7 +1184,7 @@ inherit() {
                        # false alarms due to INHERITED in /var/db/pkg being outdated
                        # in comparison the the eclasses from the portage tree.
                        if ! hasq $ECLASS $INHERITED; then
-                               eqawarn "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF"
+                               eqawarn "QA Notice: ECLASS '$ECLASS' inherited illegally in $CATEGORY/$PF $EBUILD_PHASE"
                        fi
                fi
 
index 1a7fa96dce1ee37328fc772bb9366158f45c2bb7..5b3027b4316e6a85b2f17a40dc50d0cc339c764c 100755 (executable)
@@ -165,7 +165,7 @@ vecho() {
 
 # Internal logging function, don't use this in ebuilds
 elog_base() {
-       local messagetype
+       local line messagetype
        [ -z "${1}" -o -z "${T}" -o ! -d "${T}/logging" ] && return 1
        case "${1}" in
                INFO|WARN|ERROR|LOG|QA)
@@ -177,14 +177,26 @@ elog_base() {
                        return 1
                        ;;
        esac
-       echo -ne "${messagetype} $*\n\0" >> "${T}/logging/${EBUILD_PHASE:-other}"
+       save_IFS
+       IFS=$'\n'
+       for line in $* ; do
+               echo -ne "${messagetype} ${line}\n" >> \
+                       "${T}/logging/${EBUILD_PHASE:-other}"
+       done
+       restore_IFS
        return 0
 }
 
 eqawarn() {
        elog_base QA "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       vecho -e " ${WARN}*${NORMAL} $*" >&2
+       save_IFS
+       IFS=$'\n'
+       local line
+       for line in $* ; do
+               vecho -e " ${WARN}*${NORMAL} ${line}" >&2
+       done
+       restore_IFS
        LAST_E_CMD="eqawarn"
        return 0
 }
@@ -192,7 +204,13 @@ eqawarn() {
 elog() {
        elog_base LOG "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e " ${GOOD}*${NORMAL} $*"
+       save_IFS
+       IFS=$'\n'
+       local line
+       for line in $* ; do
+               echo -e " ${GOOD}*${NORMAL} ${line}"
+       done
+       restore_IFS
        LAST_E_CMD="elog"
        return 0
 }
@@ -220,7 +238,13 @@ esyslog() {
 einfo() {
        elog_base INFO "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e " ${GOOD}*${NORMAL} $*"
+       save_IFS
+       IFS=$'\n'
+       local line
+       for line in $* ; do
+               echo -e " ${GOOD}*${NORMAL} ${line}"
+       done
+       restore_IFS
        LAST_E_CMD="einfo"
        return 0
 }
@@ -236,7 +260,13 @@ einfon() {
 ewarn() {
        elog_base WARN "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e " ${WARN}*${NORMAL} ${RC_INDENTATION}$*" >&2
+       save_IFS
+       IFS=$'\n'
+       local line
+       for line in $* ; do
+               echo -e " ${WARN}*${NORMAL} ${RC_INDENTATION}${line}" >&2
+       done
+       restore_IFS
        LAST_E_CMD="ewarn"
        return 0
 }
@@ -244,7 +274,13 @@ ewarn() {
 eerror() {
        elog_base ERROR "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
-       echo -e " ${BAD}*${NORMAL} ${RC_INDENTATION}$*" >&2
+       save_IFS
+       IFS=$'\n'
+       local line
+       for line in $* ; do
+               echo -e " ${BAD}*${NORMAL} ${RC_INDENTATION}${line}" >&2
+       done
+       restore_IFS
        LAST_E_CMD="eerror"
        return 0
 }
index 12cca1401009c8abe1b24aedfc1c10fe50cd1058..9ec255b8e09554f1f982666f4c395ab88ddc8cf0 100644 (file)
@@ -183,12 +183,14 @@ install_qa_check() {
                                f=$(<"${T}"/scanelf-ignored-LDFLAGS.log)
                                if [[ -n ${f} ]] ; then
                                        vecho -ne '\a\n'
-                                       eqawarn "QA Notice: Files built without respecting LDFLAGS have been detected"
+                                       eqawarn "${BAD}QA Notice: Files built without respecting LDFLAGS have been detected${NORMAL}"
                                        eqawarn " Please include this file in your report:"
                                        eqawarn " ${T}/scanelf-ignored-LDFLAGS.log"
                                        eqawarn "${f}"
                                        vecho -ne '\a\n'
                                        sleep 1
+                               else
+                                       rm -f "${T}"/scanelf-ignored-LDFLAGS.log
                                fi
                        fi
                fi
index b1e0693f55a890aa81e7241e8d6ba758492629b2..f6b4b85d5b11b9d2dba2f98a4a7b5ab2c918dc31 100644 (file)
@@ -446,7 +446,7 @@ This variable contains flags for the \fBPORTAGE_COMPRESS\fR command.
 .B PORTAGE_ELOG_MAILFROM
 .TP
 .B PORTAGE_ELOG_MAILSUBJECT
-Please see /etc/make.conf.example for elog documentation.
+Please see /usr/share/portage/config/make.conf.example for elog documentation.
 .TP
 \fBPORTAGE_FETCH_CHECKSUM_TRY_MIRRORS\fR = \fI5\fR
 Number of mirrors to try when a downloaded file has an incorrect checksum.
index e4d0b009af98839770acde2f873d22b63ee7b944..dfc0ffd00ba7ec5ccc7dd2ecb82655efb4133790 100644 (file)
@@ -2244,8 +2244,6 @@ class EbuildFetcher(SpawnProcess):
 
        __slots__ = ("fetchonly", "pkg",)
 
-       _env_vars = ("FETCHCOMMAND", "GENTOO_MIRRORS", "RESUMECOMMAND")
-
        def _start(self):
 
                root_config = self.pkg.root_config
@@ -2253,12 +2251,8 @@ class EbuildFetcher(SpawnProcess):
                ebuild_path = portdb.findname(self.pkg.cpv)
                settings = root_config.settings
 
-               fetch_env = settings.environ()
+               fetch_env = dict(settings.iteritems())
                fetch_env["PORTAGE_NICENESS"] = "0"
-               for k in self._env_vars:
-                       v = settings.get(k)
-                       if v is not None:
-                               fetch_env[k] = v
                if self.fetchonly:
                        fetch_env["PORTAGE_PARALLEL_FETCHONLY"] = "1"
 
index 4e97519ecfbc4d0edb67458c67b5da47ae77cb67..461a60301aea23c8be6e7399fbff453aab12de0e 100644 (file)
@@ -2818,6 +2818,13 @@ class config(object):
        def iterkeys(self):
                return iter(self)
 
+       def iteritems(self):
+               for k in self:
+                       yield (k, self[k])
+
+       def items(self):
+               return list(self.iteritems())
+
        def __setitem__(self,mykey,myvalue):
                "set a value; will be thrown away at reset() time"
                if not isinstance(myvalue, str):
index 7f40084324859b1790453c6cd6d73097d8373b68..2948ba6a446a3a8668dcb194fbd7f93517575dae 100644 (file)
@@ -432,15 +432,11 @@ class portdbapi(dbapi):
                mydata["repository"] = self._repository_map.get(
                        os.path.sep.join(myebuild.split(os.path.sep)[:-3]), "")
 
+               mydata["INHERITED"] = ' '.join(mydata.get("_eclasses_", []))
+               mydata["_mtime_"] = st.st_mtime
+
                #finally, we look at our internal cache entry and return the requested data.
-               returnme = []
-               for x in mylist:
-                       if x == "INHERITED":
-                               returnme.append(' '.join(mydata.get("_eclasses_", [])))
-                       elif x == "_mtime_":
-                               returnme.append(st.st_mtime)
-                       else:
-                               returnme.append(mydata.get(x,""))
+               returnme = [mydata.get(x, "") for x in mylist]
 
                if cache_me:
                        if self._aux_cache_slot_dict is None:
index 5455e17f4017bbc48394246bd7cfcda45af559a7..d9e26ce874d535af94812064d015ed380b3c98a9 100644 (file)
@@ -35,7 +35,7 @@ def collect_ebuild_messages(path):
                        logentries[msgfunction] = []
                lastmsgtype = None
                msgcontent = []
-               for l in open(filename, "r").read().split("\0"):
+               for l in open(filename, "r"):
                        if not l:
                                continue
                        try: