"PDEPEND.syntax":"Syntax error in PDEPEND (usually an extra/missing space/parenthesis)",
"LICENSE.syntax":"Syntax error in LICENSE (usually an extra/missing space/parenthesis)",
"PROVIDE.syntax":"Syntax error in PROVIDE (usually an extra/missing space/parenthesis)",
+ "RESTRICT.syntax":"Syntax error in RESTRICT (usually an extra/missing space/parenthesis)",
"SRC_URI.syntax":"Syntax error in SRC_URI (usually an extra/missing space/parenthesis)",
"ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error",
"ebuild.output":"A simple sourcing of the ebuild produces output; this breaks ebuild policy.",
"IUSE.invalid":"This ebuild has a variable in IUSE that is not in the use.desc or use.local.desc file",
"LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.",
"KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
+ "RESTRICT.invalid":"This ebuild contains invalid RESTRICT values.",
"ebuild.nostable":"There are no ebuilds that are marked as stable for your ARCH",
"ebuild.allmasked":"All ebuilds are masked for this package (Package level only)",
"ebuild.majorsyn":"This ebuild has a major syntax error that may cause the ebuild to fail partially or fully",
"IUSE.invalid",
"KEYWORDS.stupid",
"KEYWORDS.missing",
+"RESTRICT.invalid",
"ebuild.minorsyn",
"ebuild.badheader",
"file.size",
qacats.append(x)
qawarnings.append(x)
+valid_restrict = frozenset(["binchecks", "bindist", "fetch", "mirror",
+ "primaryuri", "strip", "test", "userpriv"])
verbose=0
quiet=0
stats["KEYWORDS.invalid"] += 1
fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s (profile invalid)" % mykey)
+ #restrict checks
+ myrestrict = None
+ try:
+ myrestrict = portage.dep.use_reduce(
+ portage.dep.paren_reduce(myaux["RESTRICT"]), matchall=1)
+ except portage.exception.InvalidDependString, e:
+ stats["RESTRICT.syntax"] = stats["RESTRICT.syntax"] + 1
+ fails["RESTRICT.syntax"].append(mykey+".ebuild RESTRICT: "+str(e))
+ del e
+ if myrestrict:
+ myrestrict = set(portage.flatten(myrestrict))
+ mybadrestrict = myrestrict.difference(valid_restrict)
+ if mybadrestrict:
+ stats["RESTRICT.invalid"] += len(mybadrestrict)
+ for mybad in mybadrestrict:
+ fails["RESTRICT.invalid"].append(x+"/"+y+".ebuild: %s" % mybad)
+
#syntax checks
myear = time.gmtime(os.stat(checkdir+"/"+y+".ebuild")[ST_MTIME])[0]
gentoo_copyright = re.compile(r'^# Copyright ((1999|200\d)-)?' + str(myear) + r' Gentoo Foundation')
# PORTDIR is the location of the portage tree. This is the repository
# for all profile information as well as all ebuilds. If you change
# this, you must update your /etc/make.profile symlink accordingly.
+# ***Warning***
+# Data stored inside PORTDIR is in peril of being overwritten or deleted by
+# the emerge --sync command. The default value of PORTAGE_RSYNC_OPTS
+# will protect the default locations of DISTDIR and PKGDIR, but users are
+# warned that any other locations inside PORTDIR are not necessarily safe
+# for data storage.
#PORTDIR=@DOMAIN_PREFIX@/usr/portage
#
# DISTDIR is where all of the source code tarballs will be placed for
# emerges. The source code is maintained here unless you delete
# it. The entire repository of tarballs for Gentoo is 9G. This is
# considerably more than any user will ever download. 2-3G is
-# a large DISTDIR.
+# a large DISTDIR. Note that locations under /usr/portage are not
+# necessarily safe for data storage. See the PORTDIR documentation
+# for more information.
#DISTDIR=@DOMAIN_PREFIX@/usr/portage/distfiles
#
# PKGDIR is the location of binary packages that you can have created
# with '--buildpkg' or '-b' while emerging a package. This can get
-# up to several hundred megs, or even a few gigs.
+# up to several hundred megs, or even a few gigs. Note that
+# locations under /usr/portage are not necessarily safe for data
+# storage. See the PORTDIR documentation for more information.
#PKGDIR=@DOMAIN_PREFIX@/usr/portage/packages
#
# PORT_LOGDIR is the location where portage will store all the logs it
--- /dev/null
+.TH "COLOR.MAP" "5" "Jun 2007" "Portage 2.1.3" "Portage"
+.SH "NAME"
+color.map \- custom color settings for Portage
+.SH "SYNOPSIS"
+.B /etc/portage/color.map
+.SH "DESCRIPTION"
+This file contains variables that define color classes used by Portage.
+Portage will check this file first for color classes settings. If no setting
+of given color class is found in /etc/portage/color.map, Portage uses default
+value defined internally.
+.SH "VARIABLES"
+.TP
+\fBBAD\fR = \fI"0xFF5555"\fR
+Defines color used for some words occuring in bad context.
+.TP
+\fBBRACKET\fR = \fI"0x5555FF"\fR
+Defines color used for brackets.
+.TP
+\fBGOOD\fR = \fI"0x55FF55"\fR
+Defines color used for some words occuring in good context.
+.TP
+\fBHILITE\fR = \fI"0x00AAAA"\fR
+Defines color used for highlighted words.
+.TP
+\fBINFORM\fR = \fI"0x00AA00"\fR
+Defines color used for informational words.
+.TP
+\fBMERGE_LIST_PROGRESS\fR = \fI"0xFFFF55"\fR
+Defines color used for numbers used in merge progress lists.
+.TP
+\fBPKG_MERGE\fR = \fI"0x00AA00"\fR
+Defines color used for packages planned to be merged.
+.TP
+\fBPKG_MERGE_ARG\fR = \fI"0x00AA00"\fR
+Defines color used for packages planned to be merged and given as command line
+arguments.
+.TP
+\fBPKG_MERGE_SYSTEM\fR = \fI"0x55FF55"\fR
+Defines color used for packages planned to be merged and belonging to
+system set.
+.TP
+\fBPKG_MERGE_WORLD\fR = \fI"0x55FF55"\fR
+Defines color used for packages planned to be merged and belonging to
+world set.
+.TP
+\fBPKG_NOMERGE\fR = \fI"0x0000AA"\fR
+Defines color used for packages not planned to be merged.
+.TP
+\fBPKG_NOMERGE_ARG\fR = \fI"0x0000AA"\fR
+Defines color used for packages not planned to be merged and given as command
+line arguments.
+.TP
+\fBPKG_NOMERGE_SYSTEM\fR = \fI"0x5555FF"\fR
+Defines color used for packages not planned to be merged and belonging to
+system set.
+.TP
+\fBPKG_NOMERGE_WORLD\fR = \fI"0x5555FF"\fR
+Defines color used for packages not planned to be merged and belonging to
+world set.
+.TP
+\fBSECURITY_WARN\fR = \fI"0xFF5555"\fR
+Defines color used for security warnings.
+.TP
+\fBUNMERGE_WARN\fR = \fI"0xFF5555"\fR
+Defines color used for unmerge warnings.
+.TP
+\fBWARN\fR = \fI"0xFFFF55"\fR
+Defines color used for warnings.
+.SH "REPORTING BUGS"
+Please report bugs via http://bugs.gentoo.org/
+.SH "AUTHORS"
+.nf
+Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@gmail.com>
+.fi
+.SH "FILES"
+.TP
+.B /etc/portage/color.map
+Contains variables customizing colors.
+.TP
+.B /etc/make.conf
+Contains other variables.
+.SH "SEE ALSO"
+.BR make.conf (5),
+.BR portage (5),
+.BR emerge (1),
+.BR ebuild (1),
+.BR ebuild (5)
+.TP
+The \fI/usr/lib/portage/pym/portage/output.py\fR Python module.
-.TH "EBUILD" "1" "Dec 2005" "Portage 2.1" "Portage"
+.TH "EBUILD" "1" "Jun 2007" "Portage 2.1.3" "Portage"
.SH "NAME"
ebuild \- a low level interface to the Portage system
.SH "SYNOPSIS"
.fi
.SH "FILES"
.TP
-\fB/etc/make.conf\fR
+.B /etc/make.conf
Contains variables for the build\-process and overwrites those
in make.globals.
+.TP
+.B /etc/portage/color.map
+Contains variables customizing colors.
.SH "SEE ALSO"
.BR emerge (1),
.BR ebuild (5),
-.BR make.conf (5)
+.BR make.conf (5),
+.BR color.map (5)
.TP
The \fI/usr/sbin/ebuild.sh\fR script.
.TP
-.TH "EBUILD" "5" "Jan 2007" "Portage 2.1.2" "Portage"
+.TH "EBUILD" "5" "Jun 2007" "Portage 2.1.3" "Portage"
.SH "NAME"
ebuild \- the internal format, variables, and functions in an ebuild script
.SH "DESCRIPTION"
Mark Guertin <gerk@gentoo.org>
Nicholas Jones <carpaski@gentoo.org>
Mike Frysinger <vapier@gentoo.org>
-Arfrever Frehtes Taifersar Arahesis <FFTA@WP.PL>
+Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@gmail.com>
.fi
.SH "FILES"
.TP
.TP
The helper apps in \fI@PORTAGE_BASE@/bin\fR.
.TP
-\fB/etc/make.conf\fR
+.B /etc/make.conf
Contains variables for the build\-process and overwrites those in make.defaults.
.TP
-\fB/etc/make.globals\fR
+.B /etc/make.globals
Contains the default variables for the build\-process, you should edit
\fI/etc/make.conf\fR instead.
+.TP
+.B /etc/portage/color.map
+Contains variables customizing colors.
.SH "SEE ALSO"
.BR ebuild (1),
-.BR make.conf (5)
+.BR make.conf (5),
+.BR color.map (5)
-.TH "EMERGE" "1" "Dec 2006" "Portage 2.1" "Portage"
+.TH "EMERGE" "1" "Jun 2007" "Portage 2.1.3" "Portage"
.SH "NAME"
emerge \- Command\-line interface to the Portage system
.SH "SYNOPSIS"
\fBmake.globals\fR. \fBYou should edit this file instead of the ones
listed below\fR.
.TP
+.B /etc/portage/color.map
+Contains variables customizing colors.
+.TP
.B /etc/dispatch\-conf.conf
Contains settings to handle automatic updates/backups of configuration
files.
.BR ebuild (1),
.BR ebuild (5),
.BR make.conf (5),
+.BR color.map (5),
.BR portage (5)
.LP
A number of helper applications reside in \fI@PORTAGE_BASE@bin\fR.
-.TH "MAKE.CONF" "5" "Jan 2007" "Portage 2.1.2" "Portage"
+.TH "MAKE.CONF" "5" "Jun 2007" "Portage 2.1.3" "Portage"
.SH "NAME"
make.conf \- custom settings for Portage
.SH "SYNOPSIS"
as \fI\-\-target=${CTARGET}\fR only if it is defined.
.TP
\fBDISTDIR\fR = \fI[path]\fR
-Defines the location of your local source file repository.
+Defines the location of your local source file repository. Note
+that locations under /usr/portage are not necessarily safe for data storage.
+See the \fBPORTDIR\fR documentation for more information.
.br
Defaults to /usr/portage/distfiles.
.TP
Defaults to false.
.TP
\fBPKGDIR\fR = \fI[path]\fR
-Defines the location where created .tbz2 binary packages will be stored.
+Defines the location where created .tbz2 binary packages will be stored. Note
+that locations under /usr/portage are not necessarily safe for data storage.
+See the \fBPORTDIR\fR documentation for more information.
.br
Defaults to /usr/portage/packages.
.TP
This variable controls permissions for \fIWORKDIR\fR (see \fBebuild\fR(5)).
.TP
\fBPORTDIR\fR = \fI[path]\fR
-Defines the location of your Portage tree.
+Defines the location of the Portage tree. This is the repository for all
+profile information as well as all ebuilds. If you change this, you must update
+your /etc/make.profile symlink accordingly.
.br
Defaults to /usr/portage.
.br
\fB***Warning***\fR
.br
-Storing data such as distfiles and binary packages in PORTDIR can
-be potentially dangerous. The default emerge configuration defaults to this
-behavior (which will work fine), however if you deviate from the default
-configuration by changing PKGDIR or DISTDIR, emerge \-\-sync may inadvertedly
-delete all your distfiles/binary packages. Please make sure to set
-\fBPORTAGE_EXTRA_RSYNC_OPTS\fR properly to insure the safety of files in PORTDIR.
+Data stored inside \fBPORTDIR\fR is in peril of being overwritten or deleted by
+the emerge \-\-sync command. The default value of
+\fBPORTAGE_RSYNC_OPTS\fR will protect the default locations of
+\fBDISTDIR\fR and \fBPKGDIR\fR, but users are warned that any other locations
+inside \fBPORTDIR\fR are not necessarily safe for data storage.
.TP
\fBPORTDIR_OVERLAY\fR = \fI"[path] [different\-path] [etc...]"\fR
Defines the directories in which user made ebuilds may be stored and not
.fi
.SH "FILES"
.TP
-\fB/etc/make.conf\fR
+.B /etc/make.conf
Contains variables for the build\-process and overwrites those in make.defaults.
.TP
-\fB/etc/make.globals\fR
+.B /etc/make.globals
Contains the default variables for the build\-process, you should edit \fI/etc/make.conf\fR instead.
.TP
-\fB/usr/portage/profiles/use.desc\fR
+.B /etc/portage/color.map
+Contains variables customizing colors.
+.TP
+.B /usr/portage/profiles/use.desc
Contains a list of all global USE flags.
.TP
-\fB/usr/portage/profiles/use.local.desc\fR
+.B /usr/portage/profiles/use.local.desc
Contains a list of all local USE variables.
.SH "SEE ALSO"
.BR emerge (1),
-.TH "PORTAGE" "5" "Dec 2005" "Portage 2.1" "Portage"
+.TH "PORTAGE" "5" "Jun 2007" "Portage 2.1.3" "Portage"
.SH NAME
portage \- the heart of Gentoo
.SH "DESCRIPTION"
.BR /etc/portage/
.nf
bashrc
+color.map
modules
package.keywords
package.mask
different from the standard root environment. The syntax is the same as for
any other bash script.
.TP
+.BR color.map
+Contains variables customizing colors. See \fBcolor.map\fR(5).
+.TP
.BR modules
This file can be used to override the metadata cache implementation. In
practice, portdbapi.auxdbmodule is the only variable that the user will want to
.BR emerge (1),
.BR ebuild (1),
.BR ebuild (5),
-.BR make.conf (5)
+.BR make.conf (5),
+.BR color.map (5)
levels:
MEDIUM The upper boundary for medium dependencies.
+ MEDIUM_SOFT The upper boundary for medium-soft dependencies.
SOFT The upper boundary for soft dependencies.
MIN The lower boundary for soft dependencies.
"""
- __slots__ = ("__weakref__", "satisfied", "buildtime", "runtime")
+ __slots__ = ("__weakref__", "satisfied", "buildtime", "runtime", "runtime_post")
MEDIUM = -1
- SOFT = -2
- MIN = -4
+ MEDIUM_SOFT = -2
+ SOFT = -3
+ MIN = -6
def __init__(self, **kwargs):
for myattr in self.__slots__:
if myattr == "__weakref__":
return 0
if self.runtime:
return -1
+ if self.runtime_post:
+ return -2
if self.buildtime:
- return -2
- if self.runtime:
return -3
- return -4
+ if self.runtime:
+ return -4
+ if self.runtime_post:
+ return -5
+ return -6
def __lt__(self, other):
return self.__int__() < other
def __le__(self, other):
myvalue = self.__int__()
if myvalue > self.MEDIUM:
return "hard"
- if myvalue > self.SOFT:
+ if myvalue > self.MEDIUM_SOFT:
return "medium"
+ if myvalue > self.SOFT:
+ return "medium-soft"
return "soft"
class FakeVartree(portage.vartree):
# Post Depend -- Add to the list without a parent, as it depends
# on a package being present AND must be built after that package.
if not self.select_dep(myroot, edepend["PDEPEND"], myparent=mp,
- myuse=myuse, priority=DepPriority(), rev_deps=True,
+ myuse=myuse, priority=DepPriority(runtime_post=True),
parent_arg=arg):
return 0
except ValueError, e:
# package will not be merged and a warning will be displayed.
cp = portage.dep_getkey(depstring)
if cp in self._args_atoms and depstring in self._args_atoms[cp]:
- self._pprovided_args.append(arg)
+ self._pprovided_args.append((arg, depstring))
if myparent:
# The parent is added after it's own dep_check call so that it
if "portage" == portage.catsplit(portage.dep_getkey(cpv))[-1]:
asap_nodes.append(node)
break
- ignore_priority_range = [None]
- ignore_priority_range.extend(
- xrange(DepPriority.MIN, DepPriority.MEDIUM + 1))
+ ignore_priority_soft_range = [None]
+ ignore_priority_soft_range.extend(
+ xrange(DepPriority.MIN, DepPriority.SOFT + 1))
tree_mode = "--tree" in self.myopts
+ # Tracks whether or not the current iteration should prefer asap_nodes
+ # if available. This is set to False when the previous iteration
+ # failed to select any nodes. It is reset whenever nodes are
+ # successfully selected.
+ prefer_asap = True
while not mygraph.empty():
- ignore_priority = None
- nodes = None
- if asap_nodes:
+ selected_nodes = None
+ if prefer_asap and asap_nodes:
"""ASAP nodes are merged before their soft deps."""
+ asap_nodes = [node for node in asap_nodes \
+ if mygraph.contains(node)]
for node in asap_nodes:
- if not mygraph.contains(node):
- asap_nodes.remove(node)
- continue
if not mygraph.child_nodes(node,
ignore_priority=DepPriority.SOFT):
- nodes = [node]
+ selected_nodes = [node]
asap_nodes.remove(node)
break
- if not nodes:
- for ignore_priority in ignore_priority_range:
+ if not selected_nodes and \
+ not (prefer_asap and asap_nodes):
+ for ignore_priority in ignore_priority_soft_range:
nodes = get_nodes(ignore_priority=ignore_priority)
if nodes:
break
- selected_nodes = None
- if nodes:
- if ignore_priority <= DepPriority.SOFT:
+ if nodes:
if ignore_priority is None and not tree_mode:
# Greedily pop all of these nodes since no relationship
# has been ignored. This optimization destroys --tree
if not selected_nodes:
# settle for a root node
selected_nodes = [nodes[0]]
- else:
+ if not selected_nodes:
+ nodes = get_nodes(ignore_priority=DepPriority.MEDIUM)
+ if nodes:
"""Recursively gather a group of nodes that RDEPEND on
eachother. This ensures that they are merged as a group
and get their RDEPENDs satisfied as soon as possible."""
- def gather_deps(mergeable_nodes, selected_nodes, node):
+ def gather_deps(ignore_priority,
+ mergeable_nodes, selected_nodes, node):
if node in selected_nodes:
return True
if node not in mergeable_nodes:
return False
selected_nodes.add(node)
for child in mygraph.child_nodes(node,
- ignore_priority=DepPriority.SOFT):
- if not gather_deps(
+ ignore_priority=ignore_priority):
+ if not gather_deps(ignore_priority,
mergeable_nodes, selected_nodes, child):
return False
return True
mergeable_nodes = set(nodes)
- for node in nodes:
- selected_nodes = set()
- if gather_deps(
- mergeable_nodes, selected_nodes, node):
+ if prefer_asap and asap_nodes:
+ nodes = asap_nodes
+ for ignore_priority in xrange(DepPriority.SOFT,
+ DepPriority.MEDIUM_SOFT + 1):
+ for node in nodes:
+ selected_nodes = set()
+ if gather_deps(ignore_priority,
+ mergeable_nodes, selected_nodes, node):
+ break
+ else:
+ selected_nodes = None
+ if selected_nodes:
break
- else:
- selected_nodes = None
+
+ if prefer_asap and asap_nodes and not selected_nodes:
+ # We failed to find any asap nodes to merge, so ignore
+ # them for the next iteration.
+ prefer_asap = False
+ continue
+
+ if selected_nodes and ignore_priority > DepPriority.SOFT:
+ # Try to merge ignored medium deps as soon as possible.
+ for node in selected_nodes:
+ children = set(mygraph.child_nodes(node))
+ soft = children.difference(
+ mygraph.child_nodes(node,
+ ignore_priority=DepPriority.SOFT))
+ medium_soft = children.difference(
+ mygraph.child_nodes(node,
+ ignore_priority=DepPriority.MEDIUM_SOFT))
+ medium_soft.difference_update(soft)
+ for child in medium_soft:
+ if child in selected_nodes:
+ continue
+ if child in asap_nodes:
+ continue
+ # TODO: Try harder to make these nodes get
+ # merged absolutely as soon as possible.
+ asap_nodes.append(child)
if not selected_nodes:
if not myblockers.is_empty():
print "!!! disabling USE flags that trigger optional dependencies."
sys.exit(1)
+ # At this point, we've succeeded in selecting one or more nodes, so
+ # it's now safe to reset the prefer_asap to it's default state.
+ prefer_asap = True
+
for node in selected_nodes:
retlist.append(list(node))
mygraph.remove(node)
sys.stdout.write(text)
if self._pprovided_args:
+ arg_refs = {}
+ for arg_atom in self._pprovided_args:
+ arg, atom = arg_atom
+ arg_refs[arg_atom] = []
+ cp = portage.dep_getkey(atom)
+ for set_name, pkg_set in self._sets.iteritems():
+ if cp in pkg_set and atom in pkg_set[cp]:
+ arg_refs[arg_atom].append(set_name)
msg = []
msg.append(bad("\nWARNING: "))
if len(self._pprovided_args) > 1:
else:
msg.append("A requested package will not be " + \
"merged because it is listed in\n")
- msg.append(" package.provided:\n\n")
- for arg in self._pprovided_args:
- msg.append(" " + arg + "\n")
+ msg.append("package.provided:\n\n")
+ problems_sets = set()
+ for (arg, atom), refs in arg_refs.iteritems():
+ ref_string = ""
+ if refs:
+ problems_sets.update(refs)
+ refs.sort()
+ ref_string = ", ".join(["'%s'" % name for name in refs])
+ ref_string = " pulled in by " + ref_string
+ msg.append(" %s%s\n" % (colorize("INFORM", arg), ref_string))
msg.append("\n")
+ if "world" in problems_sets:
+ msg.append("This problem can be solved in one of the following ways:\n\n")
+ msg.append(" A) Use emaint to clean offending packages from world (if not installed).\n")
+ msg.append(" B) Uninstall offending packages (cleans them from world).\n")
+ msg.append(" C) Remove offending entries from package.provided.\n\n")
+ msg.append("The best course of action depends on the reason that an offending\n")
+ msg.append("package.provided entry exists.\n\n")
sys.stderr.write("".join(msg))
def calc_changelog(self,ebuildpath,current,next):
# data.py -- Calculated/Discovered Data Values
# Copyright 1998-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Id:$
+# $Id: $
if not hasattr(__builtins__, "set"):
from sets import Set as set
import os, sys, pwd, grp
-from portage.const import wheelgid, rootuid, portageuser, portagegroup
from portage.util import writemsg
+from portage.const import rootuid, portageuser, portagegroup
from portage.output import green,red
from portage.output import create_color_func
bad = create_color_func("BAD")
secpass=0
uid=os.getuid()
-wheelgroup=grp.getgrgid(wheelgid)[0]
+wheelgid=0
-if uid==0 or uid==int(rootuid):
+if uid==int(rootuid):
secpass=2
try:
- if (not secpass) and (wheelgid in os.getgroups()):
- secpass=1
+ wheelgid=grp.getgrnam("wheel")[2]
except KeyError:
- writemsg("portage initialization: your system doesn't have a '%s' group.\n" % wheelgroup)
- writemsg("Please fix this as it is a normal system requirement. '%s' is GID %d\n" % (wheelgroup, wheelgid))
- writemsg("`emerge baselayout` and a config update with dispatch-conf, etc-update\n")
- writemsg("or cfg-update should remedy this problem.\n")
pass
#Discover the uid and gid of the portage user/group
secpass=1
except KeyError:
portage_uid=0
- portage_gid=wheelgid
- writemsg("\n")
- writemsg( red("portage: "+portageuser+" user or group missing. Please update baselayout\n"))
- writemsg( red(" and merge portage user(250) and group(250) into your passwd\n"))
- writemsg( red(" and group files. Non-root compilation is disabled until then.\n"))
- writemsg( " Also note that non-root/wheel users will need to be added to\n")
- writemsg( " the portage group to do portage commands.\n")
+ portage_gid=0
writemsg("\n")
- writemsg( " For the defaults, line 1 goes into passwd, and 2 into group.\n")
- writemsg(green(" portage:x:250:250:portage:/var/tmp/portage:/bin/false\n"))
- writemsg(green(" portage::250:portage\n"))
+ writemsg( red("portage: "+portageuser+" user or group missing.i\n"))
+ writemsg( red(" In Prefix Portage this is quite dramatic\n"))
+ writemsg( red(" since it means you have thrown away yourself.\n"))
+ writemsg( " Re-add yourself, or rebootstrap Gentoo Prefix.\n")
writemsg("\n")
portage_group_warning()
repo_name = open(repo_name_path, 'r').readline().strip()
self.treemap[repo_name] = path
except (OSError,IOError):
+ writemsg("Note: The repository at %s does not have a profiles/repo_name entry.\n" % path \
+ + " This can reduce the functionality of the repository in some cases.\n")
pass
self.auxdbmodule = self.mysettings.load_best_module("portdbapi.auxdbmodule")
doebuild_environment, doebuild, env_update, \
abssymlink, movefile, _movefile, bsd_chflags
+from portage.elog.messages import ewarn
+
import os, sys, stat, errno, commands, copy, time
from itertools import izip
# do we have a origin repository name for the current package
repopath = os.sep.join(self.settings["O"].split(os.sep)[:-2])
- if mydbapi != None:
+ # bindbapi has no getRepositories() method
+ if mydbapi and hasattr(mydbapi, "getRepositories"):
+ foundname = False
for reponame in mydbapi.getRepositories():
if mydbapi.getRepositoryPath(reponame) == repopath:
fd = open(os.path.join(self.dbtmpdir, "repository"), "w")
fd.write(reponame+"\n")
fd.close()
+ foundname = True
break
+ if not foundname:
+ ewarn("Could not determine name of source repository at %s" % repopath, phase="preinst", key=self.mycpv)
# write local package counter for recording
lcfile = open(os.path.join(self.dbtmpdir, "COUNTER"),"w")
return rValue
_elog_atexit_handlers = []
-def elog_process(cpv, mysettings):
+_preserve_logentries = {}
+def elog_process(cpv, mysettings, phasefilter=None):
ebuild_logentries = collect_ebuild_messages(os.path.join(mysettings["T"], "logging"))
all_logentries = collect_messages()
if all_logentries.has_key(cpv):
else:
all_logentries[cpv] = ebuild_logentries
- my_elog_classes = set(mysettings.get("PORTAGE_ELOG_CLASSES", "").split())
+ for key in _preserve_logentries.keys():
+ if all_logentries.has_key(key):
+ all_logentries[key] = _merge_logentries(_preserve_logentries[key], all_logentries[key])
+ else:
+ all_logentries[key] = _preserve_logentries[key]
+ del _preserve_logentries[key]
+
+ if phasefilter != None:
+ for key in all_logentries:
+ all_logentries[key], _preserve_logentries[key] = phasefilter(all_logentries[key])
+ my_elog_classes = set(mysettings.get("PORTAGE_ELOG_CLASSES", "").split())
for key in all_logentries:
default_logentries = filter_loglevels(all_logentries[key], my_elog_classes)
# Distributed under the terms of the GNU General Public License v2
# $Id: __init__.py 6458 2007-04-30 02:31:30Z genone $
+from portage.const import EBUILD_PHASES
+
def filter_loglevels(logentries, loglevels):
# remove unwanted entries from all logentries
rValue = {}
rValue[phase].append((msgtype, msgcontent))
return rValue
+def filter_phases(logentries, phases):
+ rValue1 = {}
+ rValue2 = {}
+ phases = map(str.lower, phases)
+ for phase in logentries:
+ if phase in phases:
+ rValue1[phase] = logentries[phase]
+ else:
+ rValue2[phase] = logentries[phase]
+ return (rValue1, rValue2)
+
+def filter_mergephases(logentries):
+ myphases = EBUILD_PHASES[:]
+ myphases.remove("prerm")
+ myphases.remove("postrm")
+ return filter_phases(logentries, myphases)
+
+def filter_unmergephases(logentries):
+ return filter_phases(logentries, ["prerm", "postrm", "other"])
codes["lightgray"] = codes["0xAAAAAA"]
codes["darkteal"] = codes["turquoise"]
-codes["darkyellow"] = codes["brown"]
+# Some terminals have darkyellow instead of brown.
+codes["0xAAAA00"] = codes["brown"]
+codes["darkyellow"] = codes["0xAAAA00"]
codes["fuscia"] = codes["fuchsia"]
codes["white"] = codes["bold"]