PROFILE_PATHS PWORKDIR QA_INTERCEPTORS \
RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL \
RC_INDENTATION READONLY_EBUILD_METADATA READONLY_PORTAGE_VARS \
+ REPLACING_VERSIONS REPLACED_BY_VERSION \
ROOT ROOTPATH RPMDIR TEMP TMP TMPDIR USE_EXPAND \
WARN XARGS _RC_GET_KV_CACHE
root_config = self.pkg.root_config
tree = self.tree
mydbapi = root_config.trees[tree].dbapi
+ vartree = root_config.trees["vartree"]
settings = self.settings
ebuild_path = settings["EBUILD"]
debug = settings.get("PORTAGE_DEBUG") == "1"
rval = doebuild(ebuild_path, self.phase,
root_config.root, settings, debug,
- mydbapi=mydbapi, tree=tree, **kwargs)
+ mydbapi=mydbapi, tree=tree, vartree=vartree, **kwargs)
return rval
if retval:
return retval
+ self.settings["REPLACING_VERSIONS"] = " ".join(
+ [portage.versions.cpv_getversion(other.mycpv) for other in others_in_slot] )
+ self.settings.backup_changes("REPLACING_VERSIONS")
+
if slot_matches:
# Used by self.isprotected().
max_dblnk = None
emerge_log(_(" === Unmerging... (%s)") % (dblnk.mycpv,))
others_in_slot.remove(dblnk) # dblnk will unmerge itself now
dblnk._linkmap_broken = self._linkmap_broken
+ dblnk.settings["REPLACED_BY_VERSION"] = portage.versions.cpv_getversion(self.mycpv)
+ dblnk.settings.backup_changes("REPLACED_BY_VERSION")
unmerge_rval = dblnk.unmerge(trimworld=0,
ldpath_mtimes=prev_mtimes, others_in_slot=others_in_slot)
"PORTAGE_TMPDIR", "PORTAGE_UPDATE_ENV",
"PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE",
"PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PROFILE_PATHS",
+ "REPLACING_VERSIONS", "REPLACED_BY_VERSION",
"ROOT", "ROOTPATH", "T", "TMP", "TMPDIR",
"USE_EXPAND", "USE_ORDER", "WORKDIR",
"XARGS",
if phase == 'depend':
mydict.pop('FILESDIR', None)
+ if phase not in ("pretend", "setup", "preinst", "postinst") or \
+ eapi in ("0", "1", "2", "3"):
+ mydict.pop("REPLACING_VERSIONS", None)
+
+ if phase not in ("prerm", "postrm") or \
+ eapi in ("0", "1", "2", "3"):
+ mydict.pop("REPLACED_BY_VERSION", None)
+
return mydict
def thirdpartymirrors(self):
tmpdir_orig = None
try:
+ if mydo in ("pretend", "setup"):
+ if not vartree:
+ writemsg("Warning: vartree not given to doebuild. " + \
+ "Cannot set REPLACING_VERSIONS in pkg_{pretend,setup}\n")
+ else:
+ vardb = vartree.dbapi
+ cpv = mysettings.mycpv
+ cp = portage.versions.cpv_getkey(cpv)
+ slot = mysettings.get("SLOT")
+ cpv_slot = cp + ":" + slot
+ mysettings["REPLACING_VERSIONS"] = " ".join(
+ set(portage.versions.cpv_getversion(match) \
+ for match in vardb.match(cpv_slot) + vardb.match(cpv)))
+ mysettings.backup_changes("REPLACING_VERSIONS")
+
if mydo in ("digest", "manifest", "help"):
# Temporarily exempt the depend phase from manifest checks, in case
# aux_get calls trigger cache generation.
else:
return mysplit[0]
+def cpv_getversion(mycpv):
+ """Returns the v (including revision) from an cpv."""
+ cp = cpv_getkey(mycpv)
+ return mycpv[len(cp+"-"):]
+
def catsplit(mydep):
return mydep.split("/", 1)