From: Fabian Groffen Date: Sat, 4 Nov 2006 18:18:02 +0000 (-0000) Subject: Merged from trunk 4915:4929 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=464ee263a3e2f85739e5f54f558016a91b2ca270;p=portage.git Merged from trunk 4915:4929 For bug #153951, fail with a simple "Permission denied" error if the merge phase doesn't have write access to $ROOT. Silently omit info_pkgs that aren't installed. Thanks to solar. When transferring cache after sync, compare all metadata to make sure it is identical (don't trust _mtime_ and _eclasses_ alone). Local tests show that this can add approximately 15% more time to the metadata update, but it's needed for things like bug #153591. Make sure trg is defined. Fix --ignore-default-opts for bug #153980. Revert implicit rdepend behavior back to the way it was in portage-2.0.51. Thanks to vapier for the patch. The original change seems to have been an accidentally hunk (referencing bug #58819) that was committed to cvs along with another patch in revision 1.201.2.32 of ebuild.sh. svn path=/main/branches/prefix/; revision=4939 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 072a7e169..03fa09cd7 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -1533,7 +1533,7 @@ if [[ ${EBUILD_SH_ARGS} != "depend" ]] && [[ ${EBUILD_SH_ARGS} != "clean" ]] && fi fi - if hasq ccache ${FEATURES} &>/dev/null; then + if hasq ccache ${FEATURES} ; then #We can enable compiler cache support if [ -z "${PATH/*ccache*/}" ]; then # Remove the other reference. @@ -1659,8 +1659,8 @@ export TMPDIR="${T}" #syntax from getting expanded :) #check eclass rdepends also. set -f -if [ "${RDEPEND-unset}" == "unset" ] && [ "${E_RDEPEND-unset}" == "unset" ] ; then - export RDEPEND="${DEPEND} ${E_DEPEND}" +if [ "${RDEPEND-unset}" == "unset" ] ; then + export RDEPEND=${DEPEND} debug-print "RDEPEND: not set... Setting to: ${DEPEND}" fi diff --git a/bin/emerge b/bin/emerge index 405b22ea0..f83f0f51e 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3598,11 +3598,9 @@ def action_info(settings, trees, myopts, myfiles): pkgs += [mycpv[2] + "-" + mycpv[3]] else: pkgs += [mycpv[2]] - if not pkgs: - pkgs = "[Not Present]" - else: + if pkgs: pkgs = ", ".join(sorted_versions(pkgs)) - print "%-20s %s" % (x+":", pkgs) + print "%-20s %s" % (x+":", pkgs) else: print "%-20s %s" % (x+":", "[NOT VALID]") @@ -4282,7 +4280,7 @@ def emerge_main(): nocolor() tmpcmdline = [] - if "--ignore-default-opts" not in tmpcmdline: + if "--ignore-default-opts" not in sys.argv: tmpcmdline.extend(settings["EMERGE_DEFAULT_OPTS"].split()) tmpcmdline.extend(sys.argv[1:]) myaction, myopts, myfiles = parse_opts(tmpcmdline) diff --git a/pym/cache/util.py b/pym/cache/util.py index fdd732fe0..df97bcfa5 100644 --- a/pym/cache/util.py +++ b/pym/cache/util.py @@ -3,6 +3,9 @@ # License: GPL2 # $Id: util.py 1911 2005-08-25 03:44:21Z ferringb $ +if not hasattr(__builtins__, "set"): + from sets import Set as set +from itertools import chain from cache import cache_errors def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, verbose_instance=None): @@ -33,6 +36,7 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, del e continue write_it = True + trg = None try: trg = trg_cache[x] if long(trg["_mtime_"]) == long(entry["_mtime_"]) and eclass_cache.is_eclass_data_valid(trg["_eclasses_"]): @@ -40,6 +44,19 @@ def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, except (cache_errors.CacheError, KeyError): pass + if trg and not write_it: + """ We don't want to skip the write unless we're really sure that + the existing cache is identical, so don't trust _mtime_ and + _eclasses_ alone.""" + for d in (entry, trg): + if "EAPI" in d and d["EAPI"] in ("", "0"): + del d["EAPI"] + for k in set(chain(entry, trg)).difference( + ("_mtime_", "_eclasses_")): + if trg.get(k, "") != entry.get(k, ""): + write_it = True + break + if write_it: if entry.get("INHERITED",""): if src_cache.complete_eclass_entries: diff --git a/pym/portage.py b/pym/portage.py index 48df18b57..01ad817b8 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -3416,6 +3416,10 @@ def movefile(src,dest,newmtime=None,sstat=None,mysettings=None): def merge(mycat, mypkg, pkgloc, infloc, myroot, mysettings, myebuild=None, mytree=None, mydbapi=None, vartree=None, prev_mtimes=None): + if not os.access(myroot, os.W_OK): + writemsg("Permission denied: access('%s', W_OK)\n" % myroot, + noiselevel=-1) + return errno.EACCES mylink = dblink(mycat, mypkg, myroot, mysettings, treetype=mytree, vartree=vartree) return mylink.merge(pkgloc, infloc, myroot, myebuild,