Lines 2743-2765
Link Here
|
2743 |
edepend["HDEPEND"] = "" |
2743 |
edepend["HDEPEND"] = "" |
2744 |
|
2744 |
|
2745 |
deps = ( |
2745 |
deps = ( |
2746 |
(depend_root, edepend["DEPEND"], |
2746 |
(depend_root, "DEPEND", |
2747 |
self._priority(buildtime=True, |
2747 |
self._priority(buildtime=True, |
2748 |
optional=(pkg.built or ignore_depend_deps), |
2748 |
optional=(pkg.built or ignore_depend_deps), |
2749 |
ignored=ignore_depend_deps)), |
2749 |
ignored=ignore_depend_deps)), |
2750 |
(self._frozen_config._running_root.root, edepend["HDEPEND"], |
2750 |
(self._frozen_config._running_root.root, "HDEPEND", |
2751 |
self._priority(buildtime=True, |
2751 |
self._priority(buildtime=True, |
2752 |
optional=(pkg.built or ignore_hdepend_deps), |
2752 |
optional=(pkg.built or ignore_hdepend_deps), |
2753 |
ignored=ignore_hdepend_deps)), |
2753 |
ignored=ignore_hdepend_deps)), |
2754 |
(myroot, edepend["RDEPEND"], |
2754 |
(myroot, "RDEPEND", |
2755 |
self._priority(runtime=True)), |
2755 |
self._priority(runtime=True)), |
2756 |
(myroot, edepend["PDEPEND"], |
2756 |
(myroot, "PDEPEND", |
2757 |
self._priority(runtime_post=True)) |
2757 |
self._priority(runtime_post=True)) |
2758 |
) |
2758 |
) |
2759 |
|
2759 |
|
2760 |
debug = "--debug" in self._frozen_config.myopts |
2760 |
debug = "--debug" in self._frozen_config.myopts |
2761 |
|
2761 |
|
2762 |
for dep_root, dep_string, dep_priority in deps: |
2762 |
for dep_root, dep_type, dep_priority in deps: |
|
|
2763 |
dep_string = edepend[dep_type] |
2763 |
if not dep_string: |
2764 |
if not dep_string: |
2764 |
continue |
2765 |
continue |
2765 |
if debug: |
2766 |
if debug: |
Lines 2797-2803
Link Here
|
2797 |
|
2798 |
|
2798 |
try: |
2799 |
try: |
2799 |
dep_string = list(self._queue_disjunctive_deps( |
2800 |
dep_string = list(self._queue_disjunctive_deps( |
2800 |
pkg, dep_root, dep_priority, dep_string)) |
2801 |
pkg, dep_root, dep_priority, dep_string, dep_type)) |
2801 |
except portage.exception.InvalidDependString as e: |
2802 |
except portage.exception.InvalidDependString as e: |
2802 |
if pkg.installed: |
2803 |
if pkg.installed: |
2803 |
self._dynamic_config._masked_installed.add(pkg) |
2804 |
self._dynamic_config._masked_installed.add(pkg) |
Lines 2812-2825
Link Here
|
2812 |
|
2813 |
|
2813 |
if not self._add_pkg_dep_string( |
2814 |
if not self._add_pkg_dep_string( |
2814 |
pkg, dep_root, dep_priority, dep_string, |
2815 |
pkg, dep_root, dep_priority, dep_string, |
2815 |
allow_unsatisfied): |
2816 |
allow_unsatisfied, dep_type): |
2816 |
return 0 |
2817 |
return 0 |
2817 |
|
2818 |
|
2818 |
self._dynamic_config._traversed_pkg_deps.add(pkg) |
2819 |
self._dynamic_config._traversed_pkg_deps.add(pkg) |
2819 |
return 1 |
2820 |
return 1 |
2820 |
|
2821 |
|
2821 |
def _add_pkg_dep_string(self, pkg, dep_root, dep_priority, dep_string, |
2822 |
def _add_pkg_dep_string(self, pkg, dep_root, dep_priority, dep_string, |
2822 |
allow_unsatisfied): |
2823 |
allow_unsatisfied, dep_type=None): |
2823 |
_autounmask_backup = self._dynamic_config._autounmask |
2824 |
_autounmask_backup = self._dynamic_config._autounmask |
2824 |
if dep_priority.optional or dep_priority.ignored: |
2825 |
if dep_priority.optional or dep_priority.ignored: |
2825 |
# Temporarily disable autounmask for deps that |
2826 |
# Temporarily disable autounmask for deps that |
Lines 2828-2834
Link Here
|
2828 |
try: |
2829 |
try: |
2829 |
return self._wrapped_add_pkg_dep_string( |
2830 |
return self._wrapped_add_pkg_dep_string( |
2830 |
pkg, dep_root, dep_priority, dep_string, |
2831 |
pkg, dep_root, dep_priority, dep_string, |
2831 |
allow_unsatisfied) |
2832 |
allow_unsatisfied, dep_type) |
2832 |
finally: |
2833 |
finally: |
2833 |
self._dynamic_config._autounmask = _autounmask_backup |
2834 |
self._dynamic_config._autounmask = _autounmask_backup |
2834 |
|
2835 |
|
Lines 2864-2870
Link Here
|
2864 |
not slot_operator_rebuild |
2865 |
not slot_operator_rebuild |
2865 |
|
2866 |
|
2866 |
def _wrapped_add_pkg_dep_string(self, pkg, dep_root, dep_priority, |
2867 |
def _wrapped_add_pkg_dep_string(self, pkg, dep_root, dep_priority, |
2867 |
dep_string, allow_unsatisfied): |
2868 |
dep_string, allow_unsatisfied, dep_type=None): |
2868 |
if isinstance(pkg.depth, int): |
2869 |
if isinstance(pkg.depth, int): |
2869 |
depth = pkg.depth + 1 |
2870 |
depth = pkg.depth + 1 |
2870 |
else: |
2871 |
else: |
Lines 2888-2894
Link Here
|
2888 |
try: |
2889 |
try: |
2889 |
selected_atoms = self._select_atoms(dep_root, |
2890 |
selected_atoms = self._select_atoms(dep_root, |
2890 |
dep_string, myuse=self._pkg_use_enabled(pkg), parent=pkg, |
2891 |
dep_string, myuse=self._pkg_use_enabled(pkg), parent=pkg, |
2891 |
strict=strict, priority=dep_priority) |
2892 |
strict=strict, priority=dep_priority, dep_type=dep_type) |
2892 |
except portage.exception.InvalidDependString: |
2893 |
except portage.exception.InvalidDependString: |
2893 |
if pkg.installed: |
2894 |
if pkg.installed: |
2894 |
self._dynamic_config._masked_installed.add(pkg) |
2895 |
self._dynamic_config._masked_installed.add(pkg) |
Lines 3186-3192
Link Here
|
3186 |
child_pkgs.sort() |
3187 |
child_pkgs.sort() |
3187 |
yield (atom, child_pkgs[-1]) |
3188 |
yield (atom, child_pkgs[-1]) |
3188 |
|
3189 |
|
3189 |
def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct): |
3190 |
def _queue_disjunctive_deps(self, pkg, dep_root, dep_priority, dep_struct, dep_type=None): |
3190 |
""" |
3191 |
""" |
3191 |
Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack. |
3192 |
Queue disjunctive (virtual and ||) deps in self._dynamic_config._dep_disjunctive_stack. |
3192 |
Yields non-disjunctive deps. Raises InvalidDependString when |
3193 |
Yields non-disjunctive deps. Raises InvalidDependString when |
Lines 3195-3227
Link Here
|
3195 |
for x in dep_struct: |
3196 |
for x in dep_struct: |
3196 |
if isinstance(x, list): |
3197 |
if isinstance(x, list): |
3197 |
if x and x[0] == "||": |
3198 |
if x and x[0] == "||": |
3198 |
self._queue_disjunction(pkg, dep_root, dep_priority, [x]) |
3199 |
self._queue_disjunction(pkg, dep_root, dep_priority, [x], dep_type) |
3199 |
else: |
3200 |
else: |
3200 |
for y in self._queue_disjunctive_deps( |
3201 |
for y in self._queue_disjunctive_deps( |
3201 |
pkg, dep_root, dep_priority, x): |
3202 |
pkg, dep_root, dep_priority, x, dep_type): |
3202 |
yield y |
3203 |
yield y |
3203 |
else: |
3204 |
else: |
3204 |
# Note: Eventually this will check for PROPERTIES=virtual |
3205 |
# Note: Eventually this will check for PROPERTIES=virtual |
3205 |
# or whatever other metadata gets implemented for this |
3206 |
# or whatever other metadata gets implemented for this |
3206 |
# purpose. |
3207 |
# purpose. |
3207 |
if x.cp.startswith('virtual/'): |
3208 |
if x.cp.startswith('virtual/'): |
3208 |
self._queue_disjunction(pkg, dep_root, dep_priority, [x]) |
3209 |
self._queue_disjunction(pkg, dep_root, dep_priority, [x], dep_type) |
3209 |
else: |
3210 |
else: |
3210 |
yield x |
3211 |
yield x |
3211 |
|
3212 |
|
3212 |
def _queue_disjunction(self, pkg, dep_root, dep_priority, dep_struct): |
3213 |
def _queue_disjunction(self, pkg, dep_root, dep_priority, dep_struct, dep_type=None): |
3213 |
self._dynamic_config._dep_disjunctive_stack.append( |
3214 |
self._dynamic_config._dep_disjunctive_stack.append( |
3214 |
(pkg, dep_root, dep_priority, dep_struct)) |
3215 |
(pkg, dep_root, dep_priority, dep_struct, dep_type)) |
3215 |
|
3216 |
|
3216 |
def _pop_disjunction(self, allow_unsatisfied): |
3217 |
def _pop_disjunction(self, allow_unsatisfied): |
3217 |
""" |
3218 |
""" |
3218 |
Pop one disjunctive dep from self._dynamic_config._dep_disjunctive_stack, and use it to |
3219 |
Pop one disjunctive dep from self._dynamic_config._dep_disjunctive_stack, and use it to |
3219 |
populate self._dynamic_config._dep_stack. |
3220 |
populate self._dynamic_config._dep_stack. |
3220 |
""" |
3221 |
""" |
3221 |
pkg, dep_root, dep_priority, dep_struct = \ |
3222 |
pkg, dep_root, dep_priority, dep_struct, dep_type = \ |
3222 |
self._dynamic_config._dep_disjunctive_stack.pop() |
3223 |
self._dynamic_config._dep_disjunctive_stack.pop() |
3223 |
if not self._add_pkg_dep_string( |
3224 |
if not self._add_pkg_dep_string( |
3224 |
pkg, dep_root, dep_priority, dep_struct, allow_unsatisfied): |
3225 |
pkg, dep_root, dep_priority, dep_struct, allow_unsatisfied, dep_type): |
3225 |
return 0 |
3226 |
return 0 |
3226 |
return 1 |
3227 |
return 1 |
3227 |
|
3228 |
|
Lines 4030-4036
Link Here
|
4030 |
**portage._native_kwargs(kwargs)) |
4031 |
**portage._native_kwargs(kwargs)) |
4031 |
|
4032 |
|
4032 |
def _select_atoms_highest_available(self, root, depstring, |
4033 |
def _select_atoms_highest_available(self, root, depstring, |
4033 |
myuse=None, parent=None, strict=True, trees=None, priority=None): |
4034 |
myuse=None, parent=None, strict=True, trees=None, priority=None, dep_type=None): |
4034 |
"""This will raise InvalidDependString if necessary. If trees is |
4035 |
"""This will raise InvalidDependString if necessary. If trees is |
4035 |
None then self._dynamic_config._filtered_trees is used.""" |
4036 |
None then self._dynamic_config._filtered_trees is used.""" |
4036 |
|
4037 |
|
Lines 4053-4058
Link Here
|
4053 |
pkgsettings = self._frozen_config.pkgsettings[root] |
4054 |
pkgsettings = self._frozen_config.pkgsettings[root] |
4054 |
if trees is None: |
4055 |
if trees is None: |
4055 |
trees = self._dynamic_config._filtered_trees |
4056 |
trees = self._dynamic_config._filtered_trees |
|
|
4057 |
|
4058 |
# this one is needed to guarantee good readonly root |
4059 |
# resolution display in the merge list. required since |
4060 |
# parent (below) can be None |
4061 |
trees[root]["disp_parent"] = parent |
4062 |
|
4063 |
|
4056 |
mytrees = trees[root] |
4064 |
mytrees = trees[root] |
4057 |
atom_graph = digraph() |
4065 |
atom_graph = digraph() |
4058 |
if True: |
4066 |
if True: |
Lines 4081-4087
Link Here
|
4081 |
|
4089 |
|
4082 |
mycheck = portage.dep_check(depstring, None, |
4090 |
mycheck = portage.dep_check(depstring, None, |
4083 |
pkgsettings, myuse=myuse, |
4091 |
pkgsettings, myuse=myuse, |
4084 |
myroot=root, trees=trees) |
4092 |
myroot=root, trees=trees, dep_type=dep_type) |
4085 |
finally: |
4093 |
finally: |
4086 |
# restore state |
4094 |
# restore state |
4087 |
self._dynamic_config._autounmask = _autounmask_backup |
4095 |
self._dynamic_config._autounmask = _autounmask_backup |
Lines 4152-4157
Link Here
|
4152 |
continue |
4160 |
continue |
4153 |
node_stack.append((child_node, node, child_atom)) |
4161 |
node_stack.append((child_node, node, child_atom)) |
4154 |
|
4162 |
|
|
|
4163 |
trees[root].pop("disp_parent") |
4155 |
return selected_atoms |
4164 |
return selected_atoms |
4156 |
|
4165 |
|
4157 |
def _expand_virt_from_graph(self, root, atom): |
4166 |
def _expand_virt_from_graph(self, root, atom): |