versions of packages, you should update your
\fI/etc/portage/package.keywords\fR file to list the packages you want the
\'testing\' version. See \fBportage\fR(5) for more information.
+.TP
+.BR LICENSE
+The \fBLICENSE\fR variable in an \fBebuild\fR file can be used to mask
+packages based on licensing restrictions. \fBemerge\fR examines the
+\fBACCEPT_LICENSE\fR environment variable to allow or disallow the emerging
+of a package masked by \fBLICENSE\fR. See \fBmake.conf\fR(5) for information
+about \fBACCEPT_LICENSE\fR, and see \fBportage\fR(5) for information about
+\fI/etc/portage/package.license\fR.
+.TP
+.BR PROPERTIES
+The \fBPROPERTIES\fR variable in an \fBebuild\fR file can be used to mask
+packages based on properties restrictions. \fBemerge\fR examines the
+\fBACCEPT_PROPERTIES\fR environment variable to allow or disallow the emerging
+of a package masked by \fBPROPERTIES\fR. See \fBmake.conf\fR(5) for information
+about \fBACCEPT_PROPERTIES\fR, and see \fBportage\fR(5) for information about
+\fI/etc/portage/package.properties\fR.
.SH "CONFIGURATION FILES"
Portage has a special feature called "config file protection". The purpose of
this feature is to prevent new package installs from clobbering existing
.br
Defaults to the value of $ARCH.
.TP
+\fBACCEPT_LICENSE\fR = \fI[space delimited list of licenses or groups]\fR
+This variable is used to mask packages based on licensing restrictions.
+.br
+Defaults to the value of * -@EULA.
+.TP
+\fBACCEPT_PROPERTIES\fR = \fI[space delimited list of properties]\fR
+This variable is used to mask packages based on PROPERTIES restrictions.
+See \fBebuild\fR(5) for more information about PROPERTIES.
+.br
+Defaults to the value of *.
+.TP
.B CBUILD
This variable is passed by the \fIebuild scripts\fR to the \fIconfigure\fR
as \fI\-\-build=${CBUILD}\fR only if it is defined. Do not set this yourself
mirrors
modules
package.keywords
+package.license
package.mask
+package.properties
package.unmask
package.use
repos.conf
games-fps/quake3-demo x86
+.TP
+.BR package.license
+This will allow ACCEPT_LICENSE to be augmented for a single package.
+
+.I Format:
+.nf
+\- comment lines begin with # (no inline comments)
+\- one DEPEND atom per line followed by additional licenses or groups
+.fi
.TP
.BR package.mask
A list of package atoms to mask. Useful if specific versions of packages do
>=media\-video/nvidia\-glx\-1.0.4496
.fi
.TP
+.BR package.properties
+This will allow ACCEPT_PROPERTIES to be augmented for a single package.
+
+.I Format:
+.nf
+\- comment lines begin with # (no inline comments)
+\- one DEPEND atom per line followed by additional properties
+.fi
+.TP
.BR package.unmask
Just like package.mask above, except here you list packages you want to
unmask. Useful for overriding the global package.mask file (see
quiet_settings[myroot] = quiet_config
del quiet_config
+ failures = 0
+
for x in self._mergelist:
if not isinstance(x, Package) or \
x.type_name != "ebuild":
quiet_config = quiet_settings[root_config.root]
quiet_config["O"] = os.path.dirname(portdb.findname(x.cpv))
if not portage.digestcheck([], quiet_config, strict=True):
- return 1
+ failures |= 1
+ if failures:
+ return 1
return os.EX_OK
def _add_prefetchers(self):
__slots__ = ("_hash_key", "_hash_value")
def _get_hash_key(self):
- hash_key = getattr(self, "_hash_key", None)
- if hash_key is None:
+ try:
+ return self._hash_key
+ except AttributeError:
raise NotImplementedError(self)
- return hash_key
def __eq__(self, other):
return self._get_hash_key() == other
newsReaderDisplay = False
update = "--pretend" not in myopts
+ if not settings.treeVirtuals:
+ # Populate these using our existing vartree, to avoid
+ # having a temporary one instantiated.
+ settings.treeVirtuals = portage.util.map_dictlist_vals(
+ portage.getCPFromCPV, trees["vartree"].get_all_provides())
+
for repo in portdb.getRepositories():
unreadItems = checkUpdatedNewsItems(
portdb, vardb, NEWS_PATH, UNREAD_PATH, repo, update=update)
import platform
import portage
from portage import os
+from portage import _encodings
+from portage import _unicode_decode
import _emerge.help
import portage.xpak, commands, errno, re, time
from portage.output import colorize, xtermTitle, xtermTitleReset
_flush_elog_mod_echo()
- counter_hash = settings.get("PORTAGE_COUNTER_HASH")
- if "--pretend" in myopts or (counter_hash is not None and \
- counter_hash == vardbapi._counter_hash()):
+ if not vardbapi._pkgs_changed:
display_news_notification(root_config, myopts)
# If vdb state has not changed then there's nothing else to do.
sys.exit(retval)
mysettings = trees[myroot]["vartree"].settings
mysettings.unlock()
adjust_config(myopts, mysettings)
- if '--pretend' not in myopts and myaction in \
- (None, 'clean', 'depclean', 'prune', 'unmerge'):
- mysettings["PORTAGE_COUNTER_HASH"] = \
- trees[myroot]["vartree"].dbapi._counter_hash()
- mysettings.backup_changes("PORTAGE_COUNTER_HASH")
mysettings.lock()
del myroot, mysettings
if not "--pretend" in myopts:
emergelog(xterm_titles, "Started emerge on: "+\
- time.strftime("%b %d, %Y %H:%M:%S", time.localtime()))
+ _unicode_decode(
+ time.strftime("%b %d, %Y %H:%M:%S", time.localtime()),
+ encoding=_encodings['content'], errors='replace'))
myelogstr=""
if myopts:
myelogstr=" ".join(myopts)
"GENTOO_MIRRORS", "NOCONFMEM", "O",
"PORTAGE_BACKGROUND",
"PORTAGE_BINHOST_CHUNKSIZE", "PORTAGE_CALLER",
- "PORTAGE_COUNTER_HASH",
"PORTAGE_ELOG_CLASSES",
"PORTAGE_ELOG_MAILFROM", "PORTAGE_ELOG_MAILSUBJECT",
"PORTAGE_ELOG_MAILURI", "PORTAGE_ELOG_SYSTEM",
logid_path = os.path.join(mysettings["PORTAGE_BUILDDIR"], ".logid")
if not os.path.exists(logid_path):
open(_unicode_encode(logid_path), 'w')
- logid_time = time.strftime("%Y%m%d-%H%M%S",
- time.gmtime(os.stat(logid_path).st_mtime))
+ logid_time = _unicode_decode(time.strftime("%Y%m%d-%H%M%S",
+ time.gmtime(os.stat(logid_path).st_mtime)),
+ encoding=_encodings['content'], errors='replace')
mysettings["PORTAGE_LOG_FILE"] = os.path.join(
mysettings["PORT_LOGDIR"], "%s:%s:%s.log" % \
(mysettings["CATEGORY"], mysettings["PF"], logid_time))
self._pkgindex_use_evaluated_keys = \
("LICENSE", "RDEPEND", "DEPEND",
"PDEPEND", "PROPERTIES", "PROVIDE")
- self._pkgindex_header_keys = set(["ACCEPT_KEYWORDS", "CBUILD",
+ self._pkgindex_header_keys = set([
+ "ACCEPT_KEYWORDS", "ACCEPT_LICENSE",
+ "ACCEPT_PROPERTIES", "CBUILD",
"CHOST", "CONFIG_PROTECT", "CONFIG_PROTECT_MASK", "FEATURES",
"GENTOO_MIRRORS", "INSTALL_MASK", "SYNC", "USE", "EPREFIX"])
self._pkgindex_default_pkg_data = {
self.root = _unicode_decode(root,
encoding=_encodings['content'], errors='strict')
+ # Used by emerge to check whether any packages
+ # have been added or removed.
+ self._pkgs_changed = False
+
#cache for category directory mtimes
self.mtdircache = {}
level=logging.ERROR, noiselevel=-1)
return 0
- def _counter_hash(self):
- try:
- from hashlib import md5 as new_hash
- except ImportError:
- from md5 import new as new_hash
- h = new_hash()
- aux_keys = ["COUNTER"]
- cpv_list = self.cpv_all()
- cpv_list.sort()
- for cpv in cpv_list:
- try:
- counter, = self.aux_get(cpv, aux_keys)
- except KeyError:
- continue
- h.update(_unicode_encode(counter,
- encoding=_encodings['repo.content'],
- errors='backslashreplace'))
- return h.hexdigest()
-
def cpv_inject(self, mycpv):
"injects a real package into our on-disk database; assumes mycpv is valid and doesn't already exist"
os.makedirs(self.getpath(mycpv))
self._aux_cache_obj = None
def _add(self, pkg_dblink):
+ self._pkgs_changed = True
self._clear_pkg_cache(pkg_dblink)
def _remove(self, pkg_dblink):
+ self._pkgs_changed = True
self._clear_pkg_cache(pkg_dblink)
def _clear_pkg_cache(self, pkg_dblink):
from portage.localization import _
from portage.util import writemsg
from portage import os
+from portage import _encodings
+from portage import _unicode_decode
import socket
import time
_items = {}
def process(mysettings, key, logentries, fulltext):
global _items
+ time_str = _unicode_decode(
+ time.strftime("%Y%m%d-%H%M%S %Z", time.localtime(time.time())),
+ encoding=_encodings['content'], errors='replace')
header = _(">>> Messages generated for package %(pkg)s by process %(pid)d on %(time)s:\n\n") % \
- {"pkg": key, "pid": os.getpid(), "time": time.strftime("%Y%m%d-%H%M%S %Z", time.localtime(time.time()))}
+ {"pkg": key, "pid": os.getpid(), "time": time_str}
config_root = mysettings["PORTAGE_CONFIGROOT"]
mysettings, items = _items.setdefault(config_root, (mysettings, {}))
items[key] = header + fulltext
import time
from portage import os
from portage import _encodings
+from portage import _unicode_decode
from portage import _unicode_encode
from portage.data import portage_uid, portage_gid
from portage.util import ensure_dirs
elogdir = os.path.join(EPREFIX, "var", "log", "portage", "elog")
ensure_dirs(elogdir, uid=portage_uid, gid=portage_gid, mode=02770)
- elogfilename = elogdir+"/"+path+":"+time.strftime("%Y%m%d-%H%M%S", time.gmtime(time.time()))+".log"
+ elogfilename = os.path.join(elogdir, path + ":" + _unicode_decode(
+ time.strftime("%Y%m%d-%H%M%S", time.gmtime(time.time())),
+ encoding=_encodings['content'], errors='replace') + ".log")
elogfile = codecs.open(_unicode_encode(elogfilename,
encoding=_encodings['fs'], errors='strict'),
mode='w', encoding=_encodings['content'], errors='backslashreplace')
return datestr
# TODO We could format to local date format '%x' here?
- return d.strftime("%B %d, %Y")
+ return _unicode_decode(d.strftime("%B %d, %Y"),
+ encoding=_encodings['content'], errors='replace')
# simple Exception classes to catch specific errors
class GlsaTypeException(Exception):