From: Fabian Groffen Date: Fri, 3 Aug 2007 19:04:08 +0000 (-0000) Subject: Merged from trunk 7534:7550 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=97cfcceac4c37f4ab0e9a6df83c623b02e88145d;p=portage.git Merged from trunk 7534:7550 +------------------------------------------------------------------------+ | 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 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 6db4410ca..223bbd5e6 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -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}" diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py index 102752287..c7cbbf3fe 100644 --- a/pym/emerge/__init__.py +++ b/pym/emerge/__init__.py @@ -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) diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index b2c232609..0e2a64708 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -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() diff --git a/pym/portage/cache/util.py b/pym/portage/cache/util.py index d51270eae..99bf5e82a 100644 --- a/pym/portage/cache/util.py +++ b/pym/portage/cache/util.py @@ -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) diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 00d5b2112..357b17232 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -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 diff --git a/pym/portage/util.py b/pym/portage/util.py index ad6f39e82..6d8ad763a 100644 --- a/pym/portage/util.py +++ b/pym/portage/util.py @@ -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)