aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Bersenev <bay@hackerdom.ru>2014-02-17 17:55:51 +0600
committerAlexander Bersenev <bay@hackerdom.ru>2014-02-17 17:55:51 +0600
commit5a3f506c9ef1cfd78940b0509f10ef94b4434e29 (patch)
tree147c35a17a8bcd8ff467bb3063adab623da51fac /portage_with_autodep/pym/_emerge/resolver
parentfixed a deadlock (diff)
downloadautodep-5a3f506c9ef1cfd78940b0509f10ef94b4434e29.tar.gz
autodep-5a3f506c9ef1cfd78940b0509f10ef94b4434e29.tar.bz2
autodep-5a3f506c9ef1cfd78940b0509f10ef94b4434e29.zip
updated portage to 2.2.8-r1
Diffstat (limited to 'portage_with_autodep/pym/_emerge/resolver')
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/__init__.pyobin0 -> 138 bytes
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/backtracking.py27
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/backtracking.pyobin0 -> 7838 bytes
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/circular_dependency.py5
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/circular_dependency.pyobin0 -> 7555 bytes
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/output.py235
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/output.pyobin0 -> 28079 bytes
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/output_helpers.py142
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/output_helpers.pyobin0 -> 18016 bytes
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/slot_collision.py22
-rw-r--r--portage_with_autodep/pym/_emerge/resolver/slot_collision.pyobin0 -> 23644 bytes
11 files changed, 278 insertions, 153 deletions
diff --git a/portage_with_autodep/pym/_emerge/resolver/__init__.pyo b/portage_with_autodep/pym/_emerge/resolver/__init__.pyo
new file mode 100644
index 0000000..5c1b374
--- /dev/null
+++ b/portage_with_autodep/pym/_emerge/resolver/__init__.pyo
Binary files differ
diff --git a/portage_with_autodep/pym/_emerge/resolver/backtracking.py b/portage_with_autodep/pym/_emerge/resolver/backtracking.py
index dcdaee0..f2857b0 100644
--- a/portage_with_autodep/pym/_emerge/resolver/backtracking.py
+++ b/portage_with_autodep/pym/_emerge/resolver/backtracking.py
@@ -47,7 +47,7 @@ class BacktrackParameter(object):
self.reinstall_list == other.reinstall_list
-class _BacktrackNode:
+class _BacktrackNode(object):
__slots__ = (
"parameter", "depth", "mask_steps", "terminal",
@@ -84,6 +84,9 @@ class Backtracker(object):
Adds a newly computed backtrack parameter. Makes sure that it doesn't already exist and
that we don't backtrack deeper than we are allowed by --backtrack.
"""
+ if not self._check_runtime_pkg_mask(node.parameter.runtime_pkg_mask):
+ return
+
if node.mask_steps <= self._max_depth and node not in self._nodes:
if explore:
self._unexplored_nodes.append(node)
@@ -105,6 +108,28 @@ class Backtracker(object):
def __len__(self):
return len(self._unexplored_nodes)
+ def _check_runtime_pkg_mask(self, runtime_pkg_mask):
+ """
+ If a package gets masked that caused other packages to be masked
+ before, we revert the mask for other packages (bug 375573).
+ """
+
+ for pkg in runtime_pkg_mask:
+
+ if "missing dependency" in runtime_pkg_mask[pkg]:
+ continue
+
+ entry_is_valid = False
+
+ for ppkg, patom in runtime_pkg_mask[pkg].get("slot conflict", set()):
+ if ppkg not in runtime_pkg_mask:
+ entry_is_valid = True
+ break
+
+ if not entry_is_valid:
+ return False
+
+ return True
def _feedback_slot_conflict(self, conflict_data):
for pkg, parent_atoms in conflict_data:
diff --git a/portage_with_autodep/pym/_emerge/resolver/backtracking.pyo b/portage_with_autodep/pym/_emerge/resolver/backtracking.pyo
new file mode 100644
index 0000000..d989c15
--- /dev/null
+++ b/portage_with_autodep/pym/_emerge/resolver/backtracking.pyo
Binary files differ
diff --git a/portage_with_autodep/pym/_emerge/resolver/circular_dependency.py b/portage_with_autodep/pym/_emerge/resolver/circular_dependency.py
index d113c5e..aca81fa 100644
--- a/portage_with_autodep/pym/_emerge/resolver/circular_dependency.py
+++ b/portage_with_autodep/pym/_emerge/resolver/circular_dependency.py
@@ -143,7 +143,8 @@ class circular_dependency_handler(object):
#If any of the flags we're going to touch is in REQUIRED_USE, add all
#other flags in REQUIRED_USE to affecting_use, to not lose any solution.
- required_use_flags = get_required_use_flags(parent.metadata["REQUIRED_USE"])
+ required_use_flags = get_required_use_flags(
+ parent.metadata.get("REQUIRED_USE", ""))
if affecting_use.intersection(required_use_flags):
# TODO: Find out exactly which REQUIRED_USE flags are
@@ -185,7 +186,7 @@ class circular_dependency_handler(object):
parent_atom not in reduced_dep:
#We found an assignment that removes the atom from 'dep'.
#Make sure it doesn't conflict with REQUIRED_USE.
- required_use = parent.metadata["REQUIRED_USE"]
+ required_use = parent.metadata.get("REQUIRED_USE", "")
if check_required_use(required_use, current_use, parent.iuse.is_valid_flag):
use = self.depgraph._pkg_use_enabled(parent)
diff --git a/portage_with_autodep/pym/_emerge/resolver/circular_dependency.pyo b/portage_with_autodep/pym/_emerge/resolver/circular_dependency.pyo
new file mode 100644
index 0000000..c1f95dc
--- /dev/null
+++ b/portage_with_autodep/pym/_emerge/resolver/circular_dependency.pyo
Binary files differ
diff --git a/portage_with_autodep/pym/_emerge/resolver/output.py b/portage_with_autodep/pym/_emerge/resolver/output.py
index 05e316a..1208bf9 100644
--- a/portage_with_autodep/pym/_emerge/resolver/output.py
+++ b/portage_with_autodep/pym/_emerge/resolver/output.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
"""Resolver output display operation.
@@ -13,14 +13,14 @@ import sys
from portage import os
from portage import _unicode_decode
from portage.dbapi.dep_expand import dep_expand
-from portage.const import PORTAGE_PACKAGE_ATOM
-from portage.dep import cpvequal, match_from_list
-from portage.exception import InvalidDependString
-from portage.output import ( blue, bold, colorize, create_color_func,
+from portage.dep import cpvequal, _repo_separator
+from portage.exception import InvalidDependString, SignatureException
+from portage.package.ebuild._spawn_nofetch import spawn_nofetch
+from portage.output import ( blue, colorize, create_color_func,
darkblue, darkgreen, green, nc_len, red, teal, turquoise, yellow )
bad = create_color_func("BAD")
-from portage.util import writemsg_stdout, writemsg_level
-from portage.versions import best, catpkgsplit, cpv_getkey
+from portage.util import writemsg_stdout
+from portage.versions import best, catpkgsplit
from _emerge.Blocker import Blocker
from _emerge.create_world_atom import create_world_atom
@@ -72,7 +72,7 @@ class Display(object):
"""Processes pkg for blockers and adds colorized strings to
self.print_msg and self.blockers
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@param fetch_symbol: string
@rtype: bool
Modifies class globals: self.blocker_style, self.resolved,
@@ -121,7 +121,7 @@ class Display(object):
def _display_use(self, pkg, myoldbest, myinslotlist):
""" USE flag display
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@param myoldbest: list of installed versions
@param myinslotlist: list of installed slots
Modifies class globals: self.forced_flags, self.cur_iuse,
@@ -161,7 +161,7 @@ class Display(object):
def gen_mask_str(self, pkg):
"""
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
"""
hardmasked = pkg.isHardMasked()
mask_str = " "
@@ -223,7 +223,7 @@ class Display(object):
""" Prevent USE_EXPAND_HIDDEN flags from being hidden if they
are the only thing that triggered reinstallation.
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
Modifies self.use_expand_hidden, self.use_expand, self.verboseadd
"""
reinst_flags_map = {}
@@ -302,68 +302,78 @@ class Display(object):
def verbose_size(self, pkg, repoadd_set, pkg_info):
"""Determines the size of the downloads required
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@param repoadd_set: set of repos to add
@param pkg_info: dictionary
Modifies class globals: self.myfetchlist, self.counters.totalsize,
self.verboseadd, repoadd_set.
"""
mysize = 0
- if pkg.type_name == "ebuild" and pkg_info.merge:
+ if pkg.type_name in ("binary", "ebuild") and pkg_info.merge:
+ db = pkg.root_config.trees[
+ pkg.root_config.pkg_tree_map[pkg.type_name]].dbapi
+ kwargs = {}
+ if pkg.type_name == "ebuild":
+ kwargs["useflags"] = pkg_info.use
+ kwargs["myrepo"] = pkg.repo
+ myfilesdict = None
try:
- myfilesdict = self.portdb.getfetchsizes(pkg.cpv,
- useflags=pkg_info.use, myrepo=pkg.repo)
+ myfilesdict = db.getfetchsizes(pkg.cpv, **kwargs)
except InvalidDependString as e:
# FIXME: validate SRC_URI earlier
- depstr, = self.portdb.aux_get(pkg.cpv,
+ depstr, = db.aux_get(pkg.cpv,
["SRC_URI"], myrepo=pkg.repo)
show_invalid_depstring_notice(
pkg, depstr, str(e))
raise
+ except SignatureException:
+ # missing/invalid binary package SIZE signature
+ pass
if myfilesdict is None:
myfilesdict = "[empty/missing/bad digest]"
else:
for myfetchfile in myfilesdict:
if myfetchfile not in self.myfetchlist:
mysize += myfilesdict[myfetchfile]
- self.myfetchlist.append(myfetchfile)
+ self.myfetchlist.add(myfetchfile)
if pkg_info.ordered:
self.counters.totalsize += mysize
self.verboseadd += _format_size(mysize)
- # overlay verbose
- # assign index for a previous version in the same slot
- slot_matches = self.vardb.match(pkg.slot_atom)
- if slot_matches:
- repo_name_prev = self.vardb.aux_get(slot_matches[0],
- ["repository"])[0]
- else:
- repo_name_prev = None
+ if self.quiet_repo_display:
+ # overlay verbose
+ # assign index for a previous version in the same slot
+ slot_matches = self.vardb.match(pkg.slot_atom)
+ if slot_matches:
+ repo_name_prev = self.vardb.aux_get(slot_matches[0],
+ ["repository"])[0]
+ else:
+ repo_name_prev = None
- # now use the data to generate output
- if pkg.installed or not slot_matches:
- self.repoadd = self.conf.repo_display.repoStr(
- pkg_info.repo_path_real)
- else:
- repo_path_prev = None
- if repo_name_prev:
- repo_path_prev = self.portdb.getRepositoryPath(
- repo_name_prev)
- if repo_path_prev == pkg_info.repo_path_real:
+ # now use the data to generate output
+ if pkg.installed or not slot_matches:
self.repoadd = self.conf.repo_display.repoStr(
pkg_info.repo_path_real)
else:
- self.repoadd = "%s=>%s" % (
- self.conf.repo_display.repoStr(repo_path_prev),
- self.conf.repo_display.repoStr(pkg_info.repo_path_real))
- if self.repoadd:
- repoadd_set.add(self.repoadd)
+ repo_path_prev = None
+ if repo_name_prev:
+ repo_path_prev = self.portdb.getRepositoryPath(
+ repo_name_prev)
+ if repo_path_prev == pkg_info.repo_path_real:
+ self.repoadd = self.conf.repo_display.repoStr(
+ pkg_info.repo_path_real)
+ else:
+ self.repoadd = "%s=>%s" % (
+ self.conf.repo_display.repoStr(repo_path_prev),
+ self.conf.repo_display.repoStr(pkg_info.repo_path_real))
+ if self.repoadd:
+ repoadd_set.add(self.repoadd)
- @staticmethod
- def convert_myoldbest(myoldbest):
+ def convert_myoldbest(self, pkg, myoldbest):
"""converts and colorizes a version list to a string
+ @param pkg: _emerge.Package.Package instance
@param myoldbest: list
@rtype string.
"""
@@ -371,11 +381,13 @@ class Display(object):
myoldbest_str = ""
if myoldbest:
versions = []
- for pos, pkg in enumerate(myoldbest):
- key = catpkgsplit(pkg.cpv)[2] + \
- "-" + catpkgsplit(pkg.cpv)[3]
+ for pos, old_pkg in enumerate(myoldbest):
+ key = catpkgsplit(old_pkg.cpv)[2] + "-" + catpkgsplit(old_pkg.cpv)[3]
if key[-3:] == "-r0":
key = key[:-3]
+ if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])):
+ key += _repo_separator + old_pkg.repo
versions.append(key)
myoldbest_str = blue("["+", ".join(versions)+"]")
return myoldbest_str
@@ -385,7 +397,7 @@ class Display(object):
"""Increments counters.interactive if the pkg is to
be merged and it's metadata has interactive set True
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@param ordered: boolean
@param addl: already defined string to add to
"""
@@ -401,13 +413,17 @@ class Display(object):
@param addl: already defined string to add to
@param pkg_info: dictionary
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@rtype string
"""
+ ver_str = pkg_info.ver
+ if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ ver_str += _repo_separator + pkg.repo
if self.conf.quiet:
myprint = addl + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
- myprint = myprint+darkblue(" "+pkg_info.ver)+" "
+ myprint = myprint+darkblue(" "+ver_str)+" "
myprint = myprint+pkg_info.oldbest
myprint = myprint+darkgreen("to "+pkg.root)
self.verboseadd = None
@@ -422,7 +438,7 @@ class Display(object):
self.indent, self.pkgprint(pkg.cp, pkg_info))
if (self.newlp-nc_len(myprint)) > 0:
myprint = myprint+(" "*(self.newlp-nc_len(myprint)))
- myprint = myprint+"["+darkblue(pkg_info.ver)+"] "
+ myprint = myprint+" "+darkblue("["+ver_str+"]")+" "
if (self.oldlp-nc_len(myprint)) > 0:
myprint = myprint+" "*(self.oldlp-nc_len(myprint))
myprint = myprint+pkg_info.oldbest
@@ -435,14 +451,18 @@ class Display(object):
@param addl: already defined string to add to
@param pkg_info: dictionary
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@rtype string
Modifies self.verboseadd
"""
+ ver_str = pkg_info.ver
+ if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ ver_str += _repo_separator + pkg.repo
if self.conf.quiet:
myprint = addl + " " + self.indent + \
self.pkgprint(pkg_info.cp, pkg_info)
- myprint = myprint+" "+green(pkg_info.ver)+" "
+ myprint = myprint+" "+green(ver_str)+" "
myprint = myprint+pkg_info.oldbest
self.verboseadd = None
else:
@@ -457,7 +477,7 @@ class Display(object):
self.indent, self.pkgprint(pkg.cp, pkg_info))
if (self.newlp-nc_len(myprint)) > 0:
myprint = myprint+(" "*(self.newlp-nc_len(myprint)))
- myprint = myprint+green(" ["+pkg_info.ver+"] ")
+ myprint = myprint+" "+green("["+ver_str+"]")+" "
if (self.oldlp-nc_len(myprint)) > 0:
myprint = myprint+(" "*(self.oldlp-nc_len(myprint)))
myprint += pkg_info.oldbest
@@ -467,31 +487,35 @@ class Display(object):
def _set_no_columns(self, pkg, pkg_info, addl):
"""prints pkg info without column indentation.
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@param pkg_info: dictionary
@param addl: the current text to add for the next line to output
@rtype the updated addl
"""
+ pkg_str = pkg.cpv
+ if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ pkg_str += _repo_separator + pkg.repo
if not pkg_info.merge:
addl = self.empty_space_in_brackets()
myprint = "[%s%s] %s%s %s" % \
(self.pkgprint(pkg_info.operation.ljust(13),
pkg_info), addl,
- self.indent, self.pkgprint(pkg.cpv, pkg_info),
+ self.indent, self.pkgprint(pkg_str, pkg_info),
pkg_info.oldbest)
else:
myprint = "[%s %s] %s%s %s" % \
(self.pkgprint(pkg.type_name, pkg_info),
addl, self.indent,
- self.pkgprint(pkg.cpv, pkg_info), pkg_info.oldbest)
+ self.pkgprint(pkg_str, pkg_info), pkg_info.oldbest)
return myprint
def _insert_slot(self, pkg, pkg_info, myinslotlist):
"""Adds slot info to the message
- @returns addl: formatted slot info
- @returns myoldbest: installed version list
+ @return addl: formatted slot info
+ @return myoldbest: installed version list
Modifies self.counters.downgrades, self.counters.upgrades,
self.counters.binary
"""
@@ -517,8 +541,8 @@ class Display(object):
def _new_slot(self, pkg, pkg_info):
"""New slot, mark it new.
- @returns addl: formatted slot info
- @returns myoldbest: installed version list
+ @return addl: formatted slot info
+ @return myoldbest: installed version list
Modifies self.counters.newslot, self.counters.binary
"""
addl = " " + green("NS") + pkg_info.fetch_symbol + " "
@@ -574,11 +598,9 @@ class Display(object):
def print_changelog(self):
"""Prints the changelog text to std_out
"""
- writemsg_stdout('\n', noiselevel=-1)
- for revision, text in self.changelogs:
- writemsg_stdout(bold('*'+revision) + '\n' + text,
+ for chunk in self.changelogs:
+ writemsg_stdout(chunk,
noiselevel=-1)
- return
def get_display_list(self, mylist):
@@ -613,7 +635,7 @@ class Display(object):
def set_pkg_info(self, pkg, ordered):
"""Sets various pkg_info dictionary variables
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@param ordered: bool
@rtype pkg_info dictionary
Modifies self.counters.restrict_fetch,
@@ -643,7 +665,6 @@ class Display(object):
pkg_info.use = list(self.conf.pkg_use_enabled(pkg))
if not pkg.built and pkg.operation == 'merge' and \
'fetch' in pkg.metadata.restrict:
- pkg_info.fetch_symbol = red("F")
if pkg_info.ordered:
self.counters.restrict_fetch += 1
if not self.portdb.getfetchsizes(pkg.cpv,
@@ -651,13 +672,17 @@ class Display(object):
pkg_info.fetch_symbol = green("f")
if pkg_info.ordered:
self.counters.restrict_fetch_satisfied += 1
+ else:
+ pkg_info.fetch_symbol = red("F")
+ if pkg_info.ebuild_path is not None:
+ self.restrict_fetch_list[pkg] = pkg_info
return pkg_info
def do_changelog(self, pkg, pkg_info):
"""Processes and adds the changelog text to the master text for output
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@param pkg_info: dictionay
Modifies self.changelogs
"""
@@ -676,7 +701,7 @@ class Display(object):
def check_system_world(self, pkg):
"""Checks for any occurances of the package in the system or world sets
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@rtype system and world booleans
"""
root_config = self.conf.roots[pkg.root]
@@ -706,7 +731,7 @@ class Display(object):
@staticmethod
def get_ver_str(pkg):
"""Obtains the version string
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@rtype string
"""
ver_str = list(catpkgsplit(pkg.cpv)[2:])
@@ -723,7 +748,7 @@ class Display(object):
param is used for -u, where you still *do* want to see when
something is being upgraded.
- @param pkg: _emerge.Package instance
+ @param pkg: _emerge.Package.Package instance
@param pkg_info: dictionay
@rtype addl, myoldbest: list, myinslotlist: list
Modifies self.counters.reinst, self.counters.binary, self.counters.new
@@ -734,6 +759,9 @@ class Display(object):
installed_versions = self.vardb.match_pkgs(pkg.cp)
if self.vardb.cpv_exists(pkg.cpv):
addl = " "+yellow("R")+pkg_info.fetch_symbol+" "
+ installed_version = self.vardb.match_pkgs(pkg.cpv)[0]
+ if not self.quiet_repo_display and installed_version.repo != pkg.repo:
+ myoldbest = [installed_version]
if pkg_info.ordered:
if pkg_info.merge:
self.counters.reinst += 1
@@ -784,10 +812,16 @@ class Display(object):
mylist = self.get_display_list(self.conf.mylist)
# files to fetch list - avoids counting a same file twice
# in size display (verbose mode)
- self.myfetchlist = []
- # Use this set to detect when all the "repoadd" strings are "[0]"
- # and disable the entire repo display in this case.
- repoadd_set = set()
+ self.myfetchlist = set()
+
+ self.quiet_repo_display = "--quiet-repo-display" in depgraph._frozen_config.myopts
+ if self.quiet_repo_display:
+ # Use this set to detect when all the "repoadd" strings are "[0]"
+ # and disable the entire repo display in this case.
+ repoadd_set = set()
+
+ self.verbose_main_repo_display = "--verbose-main-repo-display" in depgraph._frozen_config.myopts
+ self.restrict_fetch_list = {}
for mylist_index in range(len(mylist)):
pkg, depth, ordered = mylist[mylist_index]
@@ -801,21 +835,25 @@ class Display(object):
continue
else:
pkg_info = self.set_pkg_info(pkg, ordered)
- addl, pkg_info.oldbest, myinslotlist = \
+ addl, pkg_info.oldbest_list, myinslotlist = \
self._get_installed_best(pkg, pkg_info)
self.verboseadd = ""
- self.repoadd = None
- self._display_use(pkg, pkg_info.oldbest, myinslotlist)
+ if self.quiet_repo_display:
+ self.repoadd = None
+ self._display_use(pkg, pkg_info.oldbest_list, myinslotlist)
self.recheck_hidden(pkg)
if self.conf.verbosity == 3:
- self.verbose_size(pkg, repoadd_set, pkg_info)
+ if self.quiet_repo_display:
+ self.verbose_size(pkg, repoadd_set, pkg_info)
+ else:
+ self.verbose_size(pkg, None, pkg_info)
pkg_info.cp = pkg.cp
pkg_info.ver = self.get_ver_str(pkg)
self.oldlp = self.conf.columnwidth - 30
self.newlp = self.oldlp - 30
- pkg_info.oldbest = self.convert_myoldbest(pkg_info.oldbest)
+ pkg_info.oldbest = self.convert_myoldbest(pkg, pkg_info.oldbest_list)
pkg_info.system, pkg_info.world = \
self.check_system_world(pkg)
addl = self.set_interactive(pkg, pkg_info.ordered, addl)
@@ -823,13 +861,17 @@ class Display(object):
if self.include_mask_str():
addl += self.gen_mask_str(pkg)
- if pkg.root != "/":
+ if pkg.root_config.settings["ROOT"] != "/":
if pkg_info.oldbest:
pkg_info.oldbest += " "
if self.conf.columns:
myprint = self._set_non_root_columns(
addl, pkg_info, pkg)
else:
+ pkg_str = pkg.cpv
+ if self.conf.verbosity == 3 and not self.quiet_repo_display and (self.verbose_main_repo_display or
+ any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+ pkg_str += _repo_separator + pkg.repo
if not pkg_info.merge:
addl = self.empty_space_in_brackets()
myprint = "[%s%s] " % (
@@ -840,7 +882,7 @@ class Display(object):
myprint = "[%s %s] " % (
self.pkgprint(pkg.type_name, pkg_info), addl)
myprint += self.indent + \
- self.pkgprint(pkg.cpv, pkg_info) + " " + \
+ self.pkgprint(pkg_str, pkg_info) + " " + \
pkg_info.oldbest + darkgreen("to " + pkg.root)
else:
if self.conf.columns:
@@ -852,36 +894,23 @@ class Display(object):
if self.conf.columns and pkg.operation == "uninstall":
continue
- self.print_msg.append((myprint, self.verboseadd, self.repoadd))
-
- if not self.conf.tree_display \
- and not self.conf.no_restart \
- and pkg.root == self.conf.running_root.root \
- and match_from_list(PORTAGE_PACKAGE_ATOM, [pkg]) \
- and not self.conf.quiet:
-
- if not self.vardb.cpv_exists(pkg.cpv) or \
- '9999' in pkg.cpv or \
- 'git' in pkg.inherited or \
- 'git-2' in pkg.inherited:
- if mylist_index < len(mylist) - 1:
- self.print_msg.append(
- colorize(
- "WARN", "*** Portage will stop merging "
- "at this point and reload itself,"
- )
- )
- self.print_msg.append(
- colorize("WARN", " then resume the merge.")
- )
+ if self.quiet_repo_display:
+ self.print_msg.append((myprint, self.verboseadd, self.repoadd))
+ else:
+ self.print_msg.append((myprint, self.verboseadd, None))
- show_repos = repoadd_set and repoadd_set != set(["0"])
+ show_repos = self.quiet_repo_display and repoadd_set and repoadd_set != set(["0"])
# now finally print out the messages
self.print_messages(show_repos)
self.print_blockers()
if self.conf.verbosity == 3:
self.print_verbose(show_repos)
+ for pkg, pkg_info in self.restrict_fetch_list.items():
+ writemsg_stdout("\nFetch instructions for %s:\n" % (pkg.cpv,),
+ noiselevel=-1)
+ spawn_nofetch(self.conf.trees[pkg.root]["porttree"].dbapi,
+ pkg_info.ebuild_path)
if self.conf.changelog:
self.print_changelog()
diff --git a/portage_with_autodep/pym/_emerge/resolver/output.pyo b/portage_with_autodep/pym/_emerge/resolver/output.pyo
new file mode 100644
index 0000000..bd2ae2f
--- /dev/null
+++ b/portage_with_autodep/pym/_emerge/resolver/output.pyo
Binary files differ
diff --git a/portage_with_autodep/pym/_emerge/resolver/output_helpers.py b/portage_with_autodep/pym/_emerge/resolver/output_helpers.py
index b7e7376..e751dd8 100644
--- a/portage_with_autodep/pym/_emerge/resolver/output_helpers.py
+++ b/portage_with_autodep/pym/_emerge/resolver/output_helpers.py
@@ -14,10 +14,10 @@ import sys
from portage import os
from portage import _encodings, _unicode_encode
from portage._sets.base import InternalPackageSet
-from portage.output import blue, colorize, create_color_func, green, red, \
- teal, yellow
+from portage.output import (blue, bold, colorize, create_color_func,
+ green, red, teal, yellow)
bad = create_color_func("BAD")
-from portage.util import writemsg
+from portage.util import shlex_split, writemsg
from portage.versions import catpkgsplit
from _emerge.Blocker import Blocker
@@ -39,7 +39,7 @@ class _RepoDisplay(object):
repo_paths.add(portdir)
overlays = root_config.settings.get("PORTDIR_OVERLAY")
if overlays:
- repo_paths.update(overlays.split())
+ repo_paths.update(shlex_split(overlays))
repo_paths = list(repo_paths)
self._repo_paths = repo_paths
self._repo_paths_real = [ os.path.realpath(repo_path) \
@@ -198,7 +198,6 @@ class _DisplayConfig(object):
self.print_use_string = self.verbosity != 1 or "--verbose" in frozen_config.myopts
self.changelog = "--changelog" in frozen_config.myopts
self.edebug = frozen_config.edebug
- self.no_restart = frozen_config._opts_no_restart.intersection(frozen_config.myopts)
self.unordered_display = "--unordered-display" in frozen_config.myopts
mywidth = 130
@@ -212,7 +211,8 @@ class _DisplayConfig(object):
del e
self.columnwidth = mywidth
- self.repo_display = _RepoDisplay(frozen_config.roots)
+ if "--quiet-repo-display" in frozen_config.myopts:
+ self.repo_display = _RepoDisplay(frozen_config.roots)
self.trees = frozen_config.trees
self.pkgsettings = frozen_config.pkgsettings
self.target_root = frozen_config.target_root
@@ -500,63 +500,120 @@ def _calc_changelog(ebuildpath,current,next):
next = '-'.join(catpkgsplit(next)[1:])
if next.endswith('-r0'):
next = next[:-3]
- changelogpath = os.path.join(os.path.split(ebuildpath)[0],'ChangeLog')
- try:
- changelog = io.open(_unicode_encode(changelogpath,
- encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['repo.content'], errors='replace'
- ).read()
- except SystemExit:
- raise # Needed else can't exit
- except:
+
+ changelogdir = os.path.dirname(ebuildpath)
+ changelogs = ['ChangeLog']
+ # ChangeLog-YYYY (see bug #389611)
+ changelogs.extend(sorted((fn for fn in os.listdir(changelogdir)
+ if fn.startswith('ChangeLog-')), reverse=True))
+
+ divisions = []
+ found_current = False
+ for fn in changelogs:
+ changelogpath = os.path.join(changelogdir, fn)
+ try:
+ with io.open(_unicode_encode(changelogpath,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'],
+ errors='replace') as f:
+ changelog = f.read()
+ except EnvironmentError:
+ return []
+ for node in _find_changelog_tags(changelog):
+ if node[0] == current:
+ found_current = True
+ break
+ else:
+ divisions.append(node)
+ if found_current:
+ break
+
+ if not found_current:
return []
- divisions = _find_changelog_tags(changelog)
+
#print 'XX from',current,'to',next
#for div,text in divisions: print 'XX',div
# skip entries for all revisions above the one we are about to emerge
- for i in range(len(divisions)):
- if divisions[i][0]==next:
- divisions = divisions[i:]
- break
- # find out how many entries we are going to display
- for i in range(len(divisions)):
- if divisions[i][0]==current:
- divisions = divisions[:i]
+ later_rev_index = None
+ for i, node in enumerate(divisions):
+ if node[0] == next:
+ if later_rev_index is not None:
+ first_node = divisions[later_rev_index]
+ # Discard the later revision and the first ChangeLog entry
+ # that follows it. We want to display all the entries after
+ # that first entry, as discussed in bug #373009.
+ trimmed_lines = []
+ iterator = iter(first_node[1])
+ for l in iterator:
+ if not l:
+ # end of the first entry that's discarded
+ break
+ first_node = (None, list(iterator))
+ divisions = [first_node] + divisions[later_rev_index+1:]
break
- else:
- # couldnt find the current revision in the list. display nothing
- return []
- return divisions
-
+ if node[0] is not None:
+ later_rev_index = i
+
+ output = []
+ prev_blank = False
+ prev_rev = False
+ for rev, lines in divisions:
+ if rev is not None:
+ if not (prev_blank or prev_rev):
+ output.append("\n")
+ output.append(bold('*' + rev) + '\n')
+ prev_rev = True
+ prev_blank = False
+ if lines:
+ prev_rev = False
+ if not prev_blank:
+ output.append("\n")
+ for l in lines:
+ output.append(l + "\n")
+ output.append("\n")
+ prev_blank = True
+ return output
+
+def _strip_header_comments(lines):
+ # strip leading and trailing blank or header/comment lines
+ i = 0
+ while i < len(lines) and (not lines[i] or lines[i][:1] == "#"):
+ i += 1
+ if i:
+ lines = lines[i:]
+ while lines and (not lines[-1] or lines[-1][:1] == "#"):
+ lines.pop()
+ return lines
def _find_changelog_tags(changelog):
divs = []
+ if not changelog:
+ return divs
release = None
- while 1:
- match = re.search(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?\n',changelog,re.M)
- if match is None:
- if release is not None:
- divs.append((release,changelog))
- return divs
- if release is not None:
- divs.append((release,changelog[:match.start()]))
- changelog = changelog[match.end():]
+ release_end = 0
+ for match in re.finditer(r'^\*\ ?([-a-zA-Z0-9_.+]*)(?:\ .*)?$',
+ changelog, re.M):
+ divs.append((release, _strip_header_comments(
+ changelog[release_end:match.start()].splitlines())))
+ release_end = match.end()
release = match.group(1)
if release.endswith('.ebuild'):
release = release[:-7]
if release.endswith('-r0'):
release = release[:-3]
+ divs.append((release,
+ _strip_header_comments(changelog[release_end:].splitlines())))
+ return divs
class PkgInfo(object):
"""Simple class to hold instance attributes for current
information about the pkg being printed.
"""
- __slots__ = ("ordered", "fetch_symbol", "operation", "merge",
- "built", "cp", "ebuild_path", "repo_name", "repo_path_real",
- "world", "system", "use", "oldbest", "ver"
- )
+ __slots__ = ("built", "cp", "ebuild_path", "fetch_symbol", "merge",
+ "oldbest", "oldbest_list", "operation", "ordered",
+ "repo_name", "repo_path_real", "system", "use", "ver", "world")
def __init__(self):
@@ -566,6 +623,7 @@ class PkgInfo(object):
self.fetch_symbol = ''
self.merge = ''
self.oldbest = ''
+ self.oldbest_list = []
self.operation = ''
self.ordered = False
self.repo_path_real = ''
diff --git a/portage_with_autodep/pym/_emerge/resolver/output_helpers.pyo b/portage_with_autodep/pym/_emerge/resolver/output_helpers.pyo
new file mode 100644
index 0000000..ae39dd4
--- /dev/null
+++ b/portage_with_autodep/pym/_emerge/resolver/output_helpers.pyo
Binary files differ
diff --git a/portage_with_autodep/pym/_emerge/resolver/slot_collision.py b/portage_with_autodep/pym/_emerge/resolver/slot_collision.py
index 0df8f20..a1c8714 100644
--- a/portage_with_autodep/pym/_emerge/resolver/slot_collision.py
+++ b/portage_with_autodep/pym/_emerge/resolver/slot_collision.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import print_function
@@ -80,6 +80,8 @@ class slot_conflict_handler(object):
the needed USE changes and prepare the message for the user.
"""
+ _check_configuration_max = 1024
+
def __init__(self, depgraph):
self.depgraph = depgraph
self.myopts = depgraph._frozen_config.myopts
@@ -244,7 +246,7 @@ class slot_conflict_handler(object):
for (slot_atom, root), pkgs \
in self.slot_collision_info.items():
msg.append(str(slot_atom))
- if root != '/':
+ if root != self.depgraph._frozen_config._running_root.root:
msg.append(" for %s" % (root,))
msg.append("\n\n")
@@ -663,14 +665,24 @@ class slot_conflict_handler(object):
solutions = []
sol_gen = _solution_candidate_generator(all_involved_flags)
- while(True):
+ checked = 0
+ while True:
candidate = sol_gen.get_candidate()
if not candidate:
break
solution = self._check_solution(config, candidate, all_conflict_atoms_by_slotatom)
+ checked += 1
if solution:
solutions.append(solution)
-
+
+ if checked >= self._check_configuration_max:
+ # TODO: Implement early elimination for candidates that would
+ # change forced or masked flags, and don't count them here.
+ if self.debug:
+ writemsg("\nAborting _check_configuration due to "
+ "excessive number of candidates.\n", noiselevel=-1)
+ break
+
if self.debug:
if not solutions:
writemsg("No viable solutions. Rejecting configuration.\n", noiselevel=-1)
@@ -843,7 +855,7 @@ class slot_conflict_handler(object):
#Make sure the changes don't violate REQUIRED_USE
for pkg in required_changes:
- required_use = pkg.metadata["REQUIRED_USE"]
+ required_use = pkg.metadata.get("REQUIRED_USE")
if not required_use:
continue
diff --git a/portage_with_autodep/pym/_emerge/resolver/slot_collision.pyo b/portage_with_autodep/pym/_emerge/resolver/slot_collision.pyo
new file mode 100644
index 0000000..1fc3a13
--- /dev/null
+++ b/portage_with_autodep/pym/_emerge/resolver/slot_collision.pyo
Binary files differ