|15351 |Evaluate conditional USE deps for *DEPEND atoms saved in vdb entries. |
|zmedico| |
|15352 |Bug #304981 - Truncate the build log after successful fetch, instead of removing it, so as|
|zmedico|not to interfere with tail -f. |
|15353 |Prevent CHOST vdb entries from being created for virtual packages. |
|zmedico| |
|15354 |Make sure that config._accept_chost() accepts empty CHOST. |
|zmedico| |
|15355 |Use config.environ() instead of config.items() when spawning FETCHCOMMAND. |
|zmedico| |
|15356 |Add a 'trees' parameter to portdbapi.cp_all(). Thanks to Brian Dolbec (dol-sen) for this |
|zmedico|patch. |
|15357 |Add a BUILD_TIME vdb entry containing the integer number of seconds since the unix Epoch. |
|zmedico|This will be useful for creating package sets that involve comparison of installed |
| |packages to binary packages, especially for binhost users. See discussion here: |
| |http://archives.gentoo.org/gentoo-portage-dev/msg_d068a8deefd179cc23808bc23f3de200.xml |
|15358 |Cache BUILD_TIME in vdb_metadata.pickle. |
|zmedico| |
|15359 |Cache BUILD_TIME in Package.metadata. |
|zmedico| |
|15360 |Cache BUILD_TIME in $PKGDIR/Packages and inside bindbapi. |
|zmedico| |
svn path=/main/branches/prefix/; revision=15385
def clean_log(self):
"""Discard existing log."""
settings = self.settings
-
- for x in ('.logid', 'temp/build.log'):
+ log_file = settings.get('PORTAGE_LOG_FILE')
+ if log_file is not None and os.path.isfile(log_file):
+ # Truncate rather than unlink, so tail -f still works.
try:
- os.unlink(os.path.join(settings["PORTAGE_BUILDDIR"], x))
+ open(log_file, 'wb')
except OSError:
pass
("_use",)
metadata_keys = [
- "CHOST", "COUNTER", "DEPEND", "EAPI",
+ "BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "EAPI",
"INHERITED", "IUSE", "KEYWORDS",
"LICENSE", "PDEPEND", "PROVIDE", "RDEPEND",
"repository", "PROPERTIES", "RESTRICT", "SLOT", "USE", "_mtime_",
(" ".join(accept_chost), e), noiselevel=-1)
self._accept_chost_re = re.compile("^$")
- return self._accept_chost_re.match(
- metadata.get('CHOST', '')) is not None
+ pkg_chost = metadata.get('CHOST', '')
+ return not pkg_chost or \
+ self._accept_chost_re.match(pkg_chost) is not None
def setinst(self,mycpv,mydbapi):
"""This updates the preferences for old-style virtuals,
if args[0] != BASH_BINARY:
args = [BASH_BINARY, "-c", "exec \"$@\"", args[0]] + args
- rval = spawn_func(args, env=dict(iter(settings.items())), **kwargs)
+ rval = spawn_func(args, env=settings.environ(), **kwargs)
return rval
CHOST variable, so revert it to the initial
setting.
"""
+ if settings.get('CATEGORY') == 'virtual':
+ return
+
chost = settings.get('CHOST')
if chost:
write_atomic(os.path.join(settings['PORTAGE_BUILDDIR'],
_vdb_use_conditional_keys = ('DEPEND', 'LICENSE', 'PDEPEND',
'PROPERTIES', 'PROVIDE', 'RDEPEND', 'RESTRICT',)
+_vdb_use_conditional_atoms = frozenset(['DEPEND', 'PDEPEND', 'RDEPEND'])
def _post_src_install_uid_fix(mysettings, out=None):
"""
'w', encoding=_encodings['repo.content'],
errors='strict').write(str(size) + '\n')
+ codecs.open(_unicode_encode(os.path.join(build_info_dir,
+ 'BUILD_TIME'), encoding=_encodings['fs'], errors='strict'),
+ 'w', encoding=_encodings['repo.content'],
+ errors='strict').write(str(int(time.time())) + '\n')
+
use = frozenset(mysettings['PORTAGE_USE'].split())
for k in _vdb_use_conditional_keys:
v = mysettings.configdict['pkg'].get(k)
v = dep.paren_enclose(v)
if not v:
continue
+ if v in _vdb_use_conditional_atoms:
+ v_split = []
+ for x in v.split():
+ try:
+ x = dep.Atom(x)
+ except exception.InvalidAtom:
+ v_split.append(x)
+ else:
+ v_split.append(str(x.evaluate_conditionals(use)))
+ v = ' '.join(v_split)
codecs.open(_unicode_encode(os.path.join(build_info_dir,
k), encoding=_encodings['fs'], errors='strict'),
mode='w', encoding=_encodings['repo.content'],
self.cpdict={}
# Selectively cache metadata in order to optimize dep matching.
self._aux_cache_keys = set(
- ["CHOST", "DEPEND", "EAPI", "IUSE", "KEYWORDS",
+ ["BUILD_TIME", "CHOST", "DEPEND", "EAPI", "IUSE", "KEYWORDS",
"LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE",
"RDEPEND", "repository", "RESTRICT", "SLOT", "USE",
"EPREFIX"])
self._pkgindex_keys = self.dbapi._aux_cache_keys.copy()
self._pkgindex_keys.update(["CPV", "MTIME", "SIZE"])
self._pkgindex_aux_keys = \
- ["CHOST", "DEPEND", "DESCRIPTION", "EAPI",
+ ["BUILD_TIME", "CHOST", "DEPEND", "DESCRIPTION", "EAPI",
"IUSE", "KEYWORDS", "LICENSE", "PDEPEND", "PROPERTIES",
"PROVIDE", "RDEPEND", "repository", "SLOT", "USE",
"EPREFIX"]
"CHOST", "CONFIG_PROTECT", "CONFIG_PROTECT_MASK", "FEATURES",
"GENTOO_MIRRORS", "INSTALL_MASK", "SYNC", "USE", "EPREFIX"])
self._pkgindex_default_pkg_data = {
+ "BUILD_TIME" : "",
"DEPEND" : "",
"EAPI" : "0",
"IUSE" : "",
writemsg("%s: %s\n" % (k, str(e)),
noiselevel=-1)
raise
+ if k in portage._vdb_use_conditional_atoms:
+ v_split = []
+ for x in deps.split():
+ try:
+ x = portage.dep.Atom(x)
+ except portage.exception.InvalidAtom:
+ v_split.append(x)
+ else:
+ v_split.append(str(x.evaluate_conditionals(raw_use)))
+ deps = ' '.join(v_split)
metadata[k] = deps
def exists_specific(self, cpv):
else:
return 0
- def cp_all(self, categories=None):
- "returns a list of all keys in our tree"
+ def cp_all(self, categories=None, trees=None):
+ """
+ This returns a list of all keys in our tree or trees
+ @param categories: optional list of categories to search or
+ defaults to self.settings.categories
+ @param trees: optional list of trees to search the categories in or
+ defaults to self.porttrees
+ @rtype list of [cat/pkg,...]
+ """
d = {}
if categories is None:
categories = self.settings.categories
+ if trees is None:
+ trees = self.porttrees
for x in categories:
- for oroot in self.porttrees:
+ for oroot in trees:
for y in listdir(oroot+"/"+x, EmptyOnError=1, ignorecvs=1, dirsonly=1):
if not self._pkg_dir_name_re.match(y) or \
y == "CVS":
vartree = db[root]["vartree"]
self.vartree = vartree
self._aux_cache_keys = set(
- ["CHOST", "COUNTER", "DEPEND", "DESCRIPTION",
+ ["BUILD_TIME", "CHOST", "COUNTER", "DEPEND", "DESCRIPTION",
"EAPI", "HOMEPAGE", "IUSE", "KEYWORDS",
"LICENSE", "PDEPEND", "PROPERTIES", "PROVIDE", "RDEPEND",
"repository", "RESTRICT" , "SLOT", "USE"])
slot = ''
for var_name in ('CHOST', 'SLOT'):
+ if var_name == 'CHOST' and self.cat == 'virtual':
+ try:
+ os.unlink(os.path.join(inforoot, var_name))
+ except OSError:
+ pass
+ continue
+
try:
val = codecs.open(_unicode_encode(
os.path.join(inforoot, var_name),