class DependencyArg(object):
- __slots__ = ('arg', 'root_config')
-
- def __init__(self, arg=None, root_config=None):
+ __slots__ = ('arg', 'force_reinstall', 'reset_depth', 'root_config')
+
+ def __init__(self, arg=None, force_reinstall=False,
+ reset_depth=True, root_config=None):
+ """
+ Use reset_depth=False for special arguments that should not interact
+ with depth calculations (see the emerge --deep=DEPTH option).
+ """
self.arg = arg
+ self.force_reinstall = force_reinstall
+ self.reset_depth = reset_depth
self.root_config = root_config
def __eq__(self, other):
# Installing package A, we need to make sure package A's deps are met.
# emerge --deep <pkgspec>; we need to recursively check dependencies of pkgspec
# If we are in --nodeps (no recursion) mode, we obviously only check 1 level of dependencies.
- if arg_atoms:
- depth = 0
+ if arg_atoms and depth > 0:
+ for parent, atom in arg_atoms:
+ if parent.reset_depth:
+ depth = 0
+ break
+
if previously_added and pkg.depth is not None:
depth = min(pkg.depth, depth)
pkg.depth = depth
args = revised_greedy_args
del revised_greedy_args
+ args.extend(self._gen_reinstall_sets())
self._set_args(args)
myfavorites = set(myfavorites)
for (root, set_name), atoms in set_dict.items():
yield SetArg(arg=(SETPREFIX + set_name),
+ # Set reset_depth=False here, since we don't want these
+ # special sets to interact with depth calculations (see
+ # the emerge --deep=DEPTH option), though we want them
+ # to behave like normal arguments in most other respects.
pset=InternalPackageSet(initial_atoms=atoms),
+ force_reinstall=True,
+ reset_depth=False,
root_config=self._frozen_config.roots[root])
def _resolve(self, myfavorites):
virtuals = pkgsettings.getvirtuals()
args = self._dynamic_config._initial_arg_list[:]
- args.extend(self._gen_reinstall_sets())
-
for arg in self._expand_set_args(args, add_to_digraph=True):
for atom in arg.pset.getAtoms():
self._spinner_update()
myarg = None
if root == self._frozen_config.target_root:
try:
- myarg = next(self._iter_atoms_for_pkg(pkg))
- except StopIteration:
- pass
+ for myarg, myarg_atom in self._iter_atoms_for_pkg(pkg):
+ if myarg.force_reinstall:
+ reinstall = True
+ break
except portage.exception.InvalidDependString:
if not installed:
# masked by corruption