"EAPI.definition":"EAPI is defined after an inherit call (must be defined before)",
"EAPI.incompatible":"Ebuilds that use features that are only available with a different EAPI",
"EAPI.unsupported":"Ebuilds that have an unsupported EAPI version (you must upgrade portage)",
+ "SLOT.invalid":"Ebuilds that have an invalid SLOT variable value",
"SLOT.missing":"Ebuilds that have a missing or empty SLOT variable",
"HOMEPAGE.missing":"Ebuilds that have a missing or empty HOMEPAGE variable",
"DEPEND.bad":"User-visible ebuilds with bad DEPEND settings (matched against *visible* ebuilds)",
.TP
.B RESTRICT.syntax
Syntax error in RESTRICT (usually an extra/missing space/parenthesis)
+.B SLOT.invalid
+Ebuilds that have an invalid SLOT variable value
.TP
.B SLOT.missing
Ebuilds that have a missing or empty SLOT variable
import portage
from portage.cache.mappings import slot_dict_class
from portage.dep import paren_reduce, use_reduce, \
- paren_normalize, paren_enclose
+ paren_normalize, paren_enclose, _slot_re
from _emerge.Task import Task
if sys.hexversion >= 0x3000000:
self.metadata['CHOST'] = self.root_config.settings.get('CHOST', '')
self.cp = portage.cpv_getkey(self.cpv)
slot = self.slot
- if not slot:
+ if _slot_re.match(slot) is None:
+ self._invalid_metadata('SLOT.invalid',
+ "SLOT: invalid value: '%s'" % slot)
# Avoid an InvalidAtom exception when creating slot_atom.
# This package instance will be masked due to empty SLOT.
slot = '0'
Schedule a setup phase on the merge queue, in order to
serialize unsandboxed access to the live filesystem.
"""
- self._task_queues.merge.addFront(setup_phase)
+ self._task_queues.merge.add(setup_phase)
self._schedule()
def _schedule_unpack(self, unpack_phase):
myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
'PORTDIR_OVERLAY', 'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS',
- 'ACCEPT_KEYWORDS', 'SYNC', 'FEATURES', 'EMERGE_DEFAULT_OPTS']
+ 'ACCEPT_KEYWORDS', 'ACCEPT_LICENSE', 'SYNC', 'FEATURES',
+ 'EMERGE_DEFAULT_OPTS']
myvars.extend(portage.util.grabfile(settings["PORTDIR"]+"/profiles/info_vars"))
def output(self):
"""Outputs the results of the search."""
- print("\b\b \n[ Results for search key : "+white(self.searchkey)+" ]")
- print("[ Applications found : "+white(str(self.mlen))+" ]")
- print(" ")
+ msg = []
+ msg.append("\b\b \n[ Results for search key : " + \
+ bold(self.searchkey) + " ]\n")
+ msg.append("[ Applications found : " + \
+ bold(str(self.mlen)) + " ]\n\n")
vardb = self.vartree.dbapi
for mtype in self.matches:
for match,masked in self.matches[mtype]:
full_package = match
match = portage.cpv_getkey(match)
elif mtype == "set":
- msg = []
msg.append(green("*") + " " + bold(match) + "\n")
if self.verbose:
msg.append(" " + darkgreen("Description:") + \
desc, homepage, license = self.portdb.aux_get(
full_package, ["DESCRIPTION","HOMEPAGE","LICENSE"])
except KeyError:
- print("emerge: search: aux_get() failed, skipping")
+ msg.append("emerge: search: aux_get() failed, skipping\n")
continue
if masked:
- print(green("*")+" "+white(match)+" "+red("[ Masked ]"))
+ msg.append(green("*") + " " + \
+ white(match) + " " + red("[ Masked ]") + "\n")
else:
- print(green("*")+" "+white(match))
+ msg.append(green("*") + " " + bold(match) + "\n")
myversion = self.getVersion(full_package, search.VERSION_RELEASE)
mysum = [0,0]
file_size_str = mystr + " kB"
if self.verbose:
- msg = []
if available:
- print(" ", darkgreen("Latest version available:"),myversion)
- print(" ", self.getInstallationStatus(mycat+'/'+mypkg))
+ msg.append(" %s %s\n" % \
+ (darkgreen("Latest version available:"),
+ myversion))
+ msg.append(" %s\n" % \
+ self.getInstallationStatus(mycat+'/'+mypkg))
if myebuild:
- print(" %s %s" % \
+ msg.append(" %s %s\n" % \
(darkgreen("Size of files:"), file_size_str))
msg.append(" " + darkgreen("Homepage:") + \
" " + homepage + "\n")
+ " " + desc + "\n")
msg.append(" " + darkgreen("License:") + \
" " + license + "\n\n")
- writemsg_stdout(''.join(msg), noiselevel=-1)
+ writemsg_stdout(''.join(msg), noiselevel=-1)
#
# private interface
#
from portage.cache.mappings import slot_dict_class
import codecs
+from collections import deque
import re, shutil, stat, errno, copy, subprocess
import logging
import os as _os
base_names = self._vardb._aux_cache["owners"]["base_names"]
dblink_cache = {}
+ dblink_fifo = deque()
def dblink(cpv):
x = dblink_cache.get(cpv)
if x is None:
+ if len(dblink_fifo) >= 100:
+ # Ensure that we don't run out of memory.
+ del dblink_cache[dblink_fifo.popleft().mycpv]
x = self._vardb._dblink(cpv)
dblink_cache[cpv] = x
+ dblink_fifo.append(x)
return x
for path in path_iter:
self._contents_basenames = None
self._linkmap_broken = False
self._md5_merge_map = {}
+ self._hash_key = (self.myroot, self.mycpv)
+
+ def __hash__(self):
+ return hash(self._hash_key)
+
+ def __eq__(self, other):
+ return isinstance(other, dblink) and \
+ self._hash_key == other._hash_key
def lockdb(self):
if self._lock_vdb: