Merged from trunk 7534:7550
authorFabian Groffen <grobian@gentoo.org>
Fri, 3 Aug 2007 19:04:08 +0000 (19:04 -0000)
committerFabian Groffen <grobian@gentoo.org>
Fri, 3 Aug 2007 19:04:08 +0000 (19:04 -0000)
   +------------------------------------------------------------------------+
   | 7535    | For bug #187375, handle an ImportError when portage is       |
   | zmedico | downgraded to a version without mod_echo.                    |
   |---------+--------------------------------------------------------------|
   | 7537    | Like older versions of portage, don't show the repo display  |
   | zmedico | if [0] is all that will be shown.                            |
   |---------+--------------------------------------------------------------|
   | 7541    | For bug #187480, fix writemsg args in portdbapi.gvisible().  |
   | zmedico |                                                              |
   |---------+--------------------------------------------------------------|
   | 7544    | For bug #187518, handle EISDIR thrown from mkdir when the    |
   | zmedico | directory already exists on FreeBSD.                         |
   |---------+--------------------------------------------------------------|
   | 7547    | s/portage.eclass_cache/eclass_cache/ since eclass_cache is   |
   | zmedico | actually a local variable here.                              |
   |---------+--------------------------------------------------------------|
   | 7548    | In portage.spawn() logging, put the read end of the pipe in  |
   | zmedico | O_NONBLOCK mode just once at the beginning. This avoids      |
   |         | unnecessary fcntl calls and removes one more opportunity to  |
   |         | trigger EAGAIN errors on FreeBSD.                            |
   |---------+--------------------------------------------------------------|
   | 7550    | Generate a QA Notice and cd to ${WORKDIR} if the ${S}        |
   | zmedico | directory does not exist.                                    |
   +------------------------------------------------------------------------+

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

bin/ebuild.sh
pym/emerge/__init__.py
pym/portage/__init__.py
pym/portage/cache/util.py
pym/portage/dbapi/porttree.py
pym/portage/util.py

index 6db4410ca1d59b64380a4159bd95800e543de3db..223bbd5e6b6080e3f2d6db339b5d13f58403381e 100755 (executable)
@@ -915,6 +915,9 @@ dyn_compile() {
        if [ -d "${S}" ]; then
                srcdir=${S}
                cd "${S}"
+       else
+               eqawarn "QA Notice: Directory does not exist: S=\"${S}\""
+               cd "${WORKDIR}"
        fi
        #our custom version of libtool uses $S and $ED to fix
        #invalid paths in .la files
@@ -973,6 +976,9 @@ dyn_test() {
        trap "abort_test" SIGINT SIGQUIT
        if [ -d "${S}" ]; then
                cd "${S}"
+       else
+               eqawarn "QA Notice: Directory does not exist: S=\"${S}\""
+               cd "${WORKDIR}"
        fi
        if ! hasq test $FEATURES && [ "${EBUILD_FORCE_TEST}" != "1" ]; then
                vecho ">>> Test phase [not enabled]: ${CATEGORY}/${PF}"
@@ -1009,6 +1015,9 @@ dyn_install() {
        mkdir "${PORTAGE_BUILDDIR}/image"
        if [ -d "${S}" ]; then
                cd "${S}"
+       else
+               eqawarn "QA Notice: Directory does not exist: S=\"${S}\""
+               cd "${WORKDIR}"
        fi
        vecho
        vecho ">>> Install ${PF} into ${ED} category ${CATEGORY}"
index 102752287953c169f31b07b16f2f7cf1285e146f..c7cbbf3fe23e99bd3f090eba1cc8203d33ae0b9e 100644 (file)
@@ -2599,6 +2599,7 @@ class depgraph(object):
                                return ret
 
                repo_display = RepoDisplay(self.roots)
+               show_repos = False
 
                tree_nodes = []
                display_list = []
@@ -2974,7 +2975,8 @@ class depgraph(object):
                                                        repoadd = "%s=>%s" % (
                                                                repo_display.repoStr(repo_path_prev),
                                                                repo_display.repoStr(repo_path_real))
-                                       if repoadd:
+                                       if repoadd and repoadd != "0":
+                                               show_repos = True
                                                verboseadd += teal("[%s]" % repoadd)
 
                                xs = list(portage.pkgsplit(x[2]))
@@ -3113,7 +3115,7 @@ class depgraph(object):
                if verbosity == 3:
                        print
                        print counters
-                       if p:
+                       if show_repos:
                                sys.stdout.write(str(repo_display))
 
                if "--changelog" in self.myopts:
@@ -4344,8 +4346,12 @@ def post_emerge(trees, mtimedb, retval):
        from portage.util import normalize_path
        # Dump the mod_echo output now so that our other notifications are shown
        # last.
-       from portage.elog import mod_echo
-       mod_echo.finalize()
+       try:
+               from portage.elog import mod_echo
+       except ImportError:
+               pass # happens during downgrade to a version without the module
+       else:
+               mod_echo.finalize()
 
        if "noinfo" not in settings.features:
                chk_updated_info_files(normalize_path(target_root + EPREFIX), infodirs, info_mtimes, retval)
index b2c23260923268a0ef9117b8ac1ed802a1dcb5e6..0e2a6470861d3858fa0e83fcb728d049e15e733e 100644 (file)
@@ -2474,32 +2474,28 @@ def spawn(mystring, mysettings, debug=0, free=0, droppriv=0, sesandbox=0, fakero
                        fd_flags[f] = fcntl.fcntl(f.fileno(), fcntl.F_GETFL)
                buffsize = 65536
                eof = False
+               # Use non-blocking mode to prevent read
+               # calls from blocking indefinitely.
+               try:
+                       fcntl.fcntl(master_file.fileno(), fcntl.F_SETFL,
+                               fd_flags[master_file] | os.O_NONBLOCK)
+               except EnvironmentError, e:
+                       if e.errno != errno.EAGAIN:
+                               raise
+                       del e
+                       # The EAGAIN error signals eof on FreeBSD.
+                       eof = True
                while not eof:
                        events = select.select(iwtd, owtd, ewtd)
                        for f in events[0]:
-                               # Use non-blocking mode to prevent read
-                               # calls from blocking indefinitely.
-                               try:
-                                       fcntl.fcntl(f.fileno(), fcntl.F_SETFL,
-                                               fd_flags[f] | os.O_NONBLOCK)
-                               except EnvironmentError, e:
-                                       if e.errno != errno.EAGAIN:
-                                               raise
-                                       del e
-                                       # The EAGAIN error signals eof on FreeBSD.
-                                       eof = True
-                                       break
                                buf = array.array('B')
                                try:
                                        buf.fromfile(f, buffsize)
                                except EOFError:
                                        pass
-                               fcntl.fcntl(f.fileno(), fcntl.F_SETFL, fd_flags[f])
                                if not buf:
                                        eof = True
                                        break
-                               # Use blocking mode for writes since we'd rather block than
-                               # trigger a EWOULDBLOCK error.
                                if f is master_file:
                                        buf.tofile(stdout_file)
                                        stdout_file.flush()
index d51270eaeaadbf220455ed91e6edba914659546f..99bf5e82a0e57b25440cc081f396abe71e4c3597 100644 (file)
@@ -61,11 +61,11 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None,
                                        if not "_eclasses_" in entry:
                                                noise.corruption(x,"missing _eclasses_ field")
                                                continue
-                                       if not portage.eclass_cache.is_eclass_data_valid(entry["_eclasses_"]):
+                                       if not eclass_cache.is_eclass_data_valid(entry["_eclasses_"]):
                                                noise.eclass_stale(x)
                                                continue
                                else:
-                                       entry["_eclasses_"] = portage.eclass_cache.get_eclass_data(entry["INHERITED"].split(), \
+                                       entry["_eclasses_"] = eclass_cache.get_eclass_data(entry["INHERITED"].split(), \
                                                from_master_only=True)
                                        if not entry["_eclasses_"]:
                                                noise.eclass_stale(x)
index 00d5b21121129e63e416b0bb886727840de23901..357b17232cf16b6ffbe105ffaef3fb5efe98b958 100644 (file)
@@ -658,7 +658,7 @@ class portdbapi(dbapi):
                                continue
                        except PortageException, e:
                                writemsg("!!! Error: aux_get('%s', %s)\n" % (mycpv, aux_keys),
-                                       mycpv, noiselevel=-1)
+                                       noiselevel=-1)
                                writemsg("!!! %s\n" % str(e), noiselevel=-1)
                                del e
                                continue
index ad6f39e822e962960951b1c0ba850d4078c764fe..6d8ad763a0ef5fee656a6ef18dc180d21e5312c1 100644 (file)
@@ -857,7 +857,7 @@ def ensure_dirs(dir_path, *args, **kwargs):
                created_dir = True
        except OSError, oe:
                func_call = "makedirs('%s')" % dir_path
-               if errno.EEXIST == oe.errno:
+               if oe.errno in (errno.EEXIST, errno.EISDIR):
                        pass
                elif oe.errno == errno.EPERM:
                        raise OperationNotPermitted(func_call)