aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* dep_check: use DNF to optimize overlapping virtual || deps (bug 632026)Zac Medico2017-11-132-7/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deps like these: || ( foo bar ) || ( bar baz ) Translate to disjunctive normal form (DNF): || ( ( foo bar ) ( foo baz ) ( bar bar ) ( bar baz ) ) Using DNF, if none of the packages are currently installed, then the ( bar bar ) choice will be automatically preferred since it is satisfied by the fewest number of packages. If the ( foo baz ) choice is already satisfied, then that choice will be preferred instead. Since DNF results in exponential explosion of the formula, only use DNF for the parts of the dependencies that have overlapping atoms. In order to simplify the implementation of the dnf_convert function, this patch also fixes _expand_new_virtuals to normalize results in the same way as use_reduce (with no redundant nested lists). Bug: https://bugs.gentoo.org/632026 Reviewed-by: Manuel Rüger <mrueg@gentoo.org> Reviewed-by: Alec Warner <antarus@gentoo.org>
* dep_zapdeps: install new package, avoid downgrade (bug 635540)Zac Medico2017-11-021-1/+10
| | | | | | | | | Prefer to install a new package rather than to downgrade an installed package. If the installed package should be downgraded due to it being masked, then allow the downgrade. Bug: https://bugs.gentoo.org/635540 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* portage/dep/depcheck.py: Whitespace, add indentation level after newlineSergei Trofimovich2017-07-021-3/+3
| | | | | Signed-off-by: Sergei Trofimovich <siarheit@google.com> Final commit adds line trim @line 340
* use_reduce: reserve missing_white_space_check for invalid tokens (bug 611838)Zac Medico2017-03-081-2/+2
| | | | | | | | | | | | Since it's possible for a URI to contain parenthesis, only call missing_white_space_check for tokens that fail to validate with token_class. The missing_white_space_check function only serves to clarify exception messages, so it must not be allowed to reject valid tokens. X-Gentoo-Bug: 611838 X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=611838 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* dep_zapdeps: make package selections internally consistent (bug 600346)Zac Medico2016-11-222-6/+38
| | | | | | | | | | | | | | | When selecting packages to determine which choices have upgrades or downgrades relative to other choices, make the package selections internally consistent by choosing a package that satisfies all atoms in the choice which match a package in the same slot. Also, fix the Atom.match() method to handle _pkg_str instances, since dep_zapdeps can pass in _pkg_str instances instead of Package instances. X-Gentoo-Bug: 600346 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=600346 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* _expand_new_virtuals: constrain output for dep_zapdeps (bug 597752)Zac Medico2016-11-031-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constrain _expand_new_virtuals output in order to avoid incorrect re-ordering of || deps in the dep_zapdeps function, as reported in bug 597752. The incorrect dep_zapdeps behavior involved a problem in the construction of the _dep_choice.cp_map dictionary inside the dep_zapdeps function, with this input: || ( dev-java/icedtea-bin:8 =virtual/jdk-1.8.0-r3 >=virtual/jdk-1.5 ) ( dev-java/icedtea-bin:7 =virtual/jdk-1.7.0-r2 >=virtual/jdk-1.5 ) The cp_map for virtual/jdk-1.7.0-r2 erroneously contained virtual/jdk-1.8.0-r3 because that was the highest virtual/jdk matched by the >=virtual/jdk-1.5 atom. This patch removes the >=virtual/jdk-1.5 atom from the _expand_new_virtuals output, in order to avoid triggering the erroneous dep_zapdeps behavior. The >=virtual/jdk-1.5 atom is not completely discarded, since the depgraph is able to access it via the virt_atom._orig_atom attribute. In order to demonstrate that this patch solves the problem, run the command `emerge ant-core` from inside a stage3 chroot, and see that virtual/jdk:1.8 is favored over virtual/jdk:1.7. X-Gentoo-Bug: 597752 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=597752 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* portage.package.ebuild.config.config.__getitem__(): Partially drop backward ↵Arfrever Frehtes Taifersar Arahesis2015-12-011-2/+4
| | | | | | | | compatibility for nonexistent keys. For nonexistent keys: - When called by Portage scripts, raise KeyError. - When called by third-party code, print deprecation warning and continue returning "".
* match_from_list: restrict =* to match only on version part boundaries (bug ↵Zac Medico2015-09-211-1/+6
| | | | | | | | | | | | 560466) Make the =* glob match only on boundaries between version parts, in order to eliminate ambiguity (so that 1* does not match version 10). Only break compatibility in cases where dependencies have been specified ambiguously. X-Gentoo-Bug: 560466 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=560466 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* multilib: use ia64 as ia64 multilib nameMike Frysinger2015-05-301-1/+1
| | | | | The short name "ia" is never used when referring to Itanium. It is always "ia64". Make the multilib category match.
* binpkg-multi-instance 7 of 7Zac Medico2015-03-041-6/+32
| | | | | | | | | | | | | | | | | | | | | | Support "profile-formats = build-id" setting for layout.conf. When this is enabled in layout.conf of the containing repository, a dependency atom in the profile can refer to a specific build, using the build-id that is assigned when FEATURES=binpkg-multi-instance is enabled. A build-id atom is identical to a version-specific atom, except that the version is followed by a hyphen and an integer build-id. With the build-id profile format, it is possible to assemble a system using specific builds of binary packages, as users of "binary" distros might be accustomed to. For example, an atom in the "packages" file can pull a specific build of a package into the @system set, and an atom in the "package.keywords" file can be used to modify the effective KEYWORDS of a specific build of a package. Refering to specific builds can be useful for a number of reasons. For example, if a particular build needs to undergo a large amount of testing in a complex environment in order to verify reliability, then it can be useful to lock a profile to a specific build that has been thoroughly tested.
* use_reduce: support non-string token_class (bug 541198)Zac Medico2015-02-241-2/+4
| | | | | | | | Do not assume that token_class returns a basestring. X-Gentoo-Bug: 541198 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=541198 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* depgraph: soname dependency resolution (bug 282639)Zac Medico2015-02-133-0/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Soname dependency resolution is disabled by default, since it will not work correctly unless all available installed and binary packages have been built by a version of portage which generates REQUIRES and PROVIDES metadata. Soname dependency resolution is enabled when --ignore-soname-deps=n is specified, and one of the following is true: * --usepkgonly option is enabled * removal actions (--depclean and --prune) Soname dependencies are automatically ignored for dependency calculations that can pull unbuilt ebuilds into the dependency graph, since unbuilt ebuilds do not have any soname dependency metadata, making it impossible to determine whether an unresolved soname dependency can be satisfied. Therefore, --usepkgonly must be used in order to enable soname depedency resolution when installing packages. A new soname.provided file is supported for profiles, making it possible to selectively ignore soname dependencies (see the portage(5) man page). When soname dependency resolution is enabled, the soname dependencies are represented as SonameAtom instances which expose an interface that is minimally compatible with Atom instances. This allows both types of atoms to be satisfied using mostly the same mechanisms, with minimal use of conditional logic to handle the differences. Both atom classes have "soname" and "package" attributes that make it convenient for conditional code to distinguish package atoms and soname atoms. Both classes also implement a match method, so that it is possible to match a Package instance using identical syntax for both types of atoms. Since soname dependencies and slot-operator := dependencies share many properties, the slot-operator rebuild code has been generalized to handle both types of dependencies. Many of the existing unit tests involving slot-operator dependencies have been copied and adapted to test soname dependencies (the new tests are located in the pym/portage/tests/resolver/soname/ directory). X-Gentoo-Bug: 282639 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=282639 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* Generate soname dependency metadata (bug 282639)Zac Medico2015-02-132-0/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate soname dependency metadata for binary and installed packages, in the form of PROVIDES and REQUIRES metadata. It is useful to generate PROVIDES and REQUIRES metadata now, so that it will be available when dependency resolver support is added in the future. Note that slot-operator dependencies will not be able to serve as a substitute for soname dependencies for the forseeable future, because system dependencies are frequently unspecified (according to Gentoo policy). The PROVIDES/REQUIRES system is very similar to the automatic Requires and Provides system which is supported by RPM. The PROVIDES/REQUIRES metadata is generated automatically from the ELF files that are installed by a package. The PROVIDES/REQUIRES syntax is described in the /var/db/pkg section of the portage(5) man page. REQUIRES_EXCLUDE and PROVIDES_EXCLUDE ebuild variables allow for filtering of the sonames that are saved in REQUIRES and PROVIDES (see the ebuild(5) man page for details). The /var/db/pkg NEEDED.ELF.2 format now includes an additional field which indicates the multilib category, as discussed in bug #534206. The multilib category is used to categorize the sonames that are listed in PROVIDES/REQUIRES metadata, since sonames need to be resolved separately for each multilib category. The complete list of supported multilib categories is documented in the comments of the portage.dep.soname.multilib_category module. X-Gentoo-Bug: 282639 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=282639 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* emerge: add --changed-deps/--binpkg-changed-deps (282927)Zac Medico2015-01-121-0/+13
| | | | | | | | | | | | | | | | | | | | The @changed-deps set is useful, but it has limitations similar to the @installed set (see bug #387059), which can make it unsuitable for use when updating the whole system. Therefore, implement two new options that are analogous to --newuse and --binpkg-respect-use, called --changed-deps and --binpkg-changed-deps. The rationale for having a separate --binpkg-* option is the same in both cases: depending on the situation, people may want different behavior for binary packages. For example, just like ---binpkg-respect-use is automatically enabled if the user has not specified --usepkgonly, so is --binpkg-changed-deps (though the user can explicitly override the automatic behavior). In both cases, inconsistencies in dependencies are automatically avoided, increasing the probability of a successful dependency calculation. X-Gentoo-Bug: 282927 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=282927
* Solve more slot-operator conflicts (531656)Zac Medico2015-01-051-1/+15
| | | | | | | | | | | | | | | | Add some heuristics to handle slot conflicts triggered by interaction of slot-operator dependencies with dependencies like those of labgl: ocaml:= || ( labltk <ocaml-4.02 ) The new heuristics involve some behavior modifications in the depgraph _solve_non_slot_operator_slot_conflicts method and in dep_zapdeps. The dep_zapdeps changes affect the behavior of _select_atoms_probe calls in the depgraph _slot_operator_update_probe method. X-Gentoo-Bug: 531656 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=531656 Acked-by: Alexander Berntsen <bernalex@gentoo.org>
* dep_zapdeps: avoid use.mask/force changes (515584)Zac Medico2014-11-171-2/+34
| | | | | | | | | | This patch causes dep_zapdeps to check which USE flags cause a match to fail, and uses that information to prioritize choices that do not require changes to use.mask or use.force. X-Gentoo-Bug: 515584 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=515584 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* _dep_check_composite_db: fix bug #526160Zac Medico2014-11-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The fixes various forms of buggy behavior involving virtuals handling and EAPI 5 subslots. The code at fault is part of the support for bug #141118 (virtuals lookahead). This code was written long before subslots existed, and because of them it needs to be updated now. Previously, the relevant virtuals code would only select one virtual from each slot for lookahead. Now, it needs to select one from each slot/subslot pair. The buggy forms of behavior fixed by this change can be difficult to reproduce, since they only express themselves under some rare circumstances. In addition to the _dep_check_composite_db fixes, there is also a related fix inside _expand_new_virtuals, which is required so that _slot_operator_update_probe can reliably check whether or not a particular input atom was selected. Without this change, the _dep_check_composite_db changes will cause the test from commit d3be49fe6827aa1974856dffe6d5a1aca80a7bed to fail in a way that is very similar to the failure reported in bug #526160. Fixes: d3be49fe6827 ("depgraph: fix bug #526160") X-Gentoo-Bug: 526160 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=526160 Acked-by: Brian Dolbec <dolsen@gentoo.org>
* dep_zapdeps: handle circular deps with --onlydepsZac Medico2014-10-281-5/+4
| | | | | | | | | | | This fixes a case with --onlydeps were dep_zapdeps would pull in an avoidable direct circular dependency on an onlydeps node. The logic changes only apply to --onlydeps, so there's no chance of regressions for cases when --onlydeps is not enabled. X-Gentoo-Bug: 524916 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524916 Acked-by: Alexander Berntsen <bernalex@gentoo.org>
* dep_zapdeps: fix bug #522652Zac Medico2014-09-141-0/+10
| | | | | For cases such as || ( X <A-2 ), where X is unsatisfiable and A-1 is installed, fix dep_zapdeps to make the correct choice.
* dep_check: fix bug #515230Zac Medico2014-08-281-5/+5
| | | | | | | | | | | | | This fixes dep_check so that graph packages do not mask non-graph packages (in the same slot) unless the graph packages also match the dependency atom being satisfied. This requires logic changes in both _dep_check_composite_db._visible and dep_zapdeps. Also, fix _dep_check_composite_db match / _cpv_pkg_map interactions to ensure correct match results. X-Gentoo-Bug: 515230 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=515230
* vdb: Preserve := when storing uninstalled dependency atomsMichał Górny2014-08-281-9/+18
| | | | | | | | | | | | | | | | | Make the slot operator processing code not remove the := operator from vdb dependency entries when the underlying package is not installed. This fixes a bug where dependencies like || ( A:= B:= ) were stored as || ( A:0/1= B ) if B was not installed. This especially confused dependency comparisons in @changed-deps. With this patch, Portage stores the original := (or :slot=) atom in the vdb. This fixes the issue while preserving the same behavior in the current dependency resolver. Acked-by: Alexander Berntsen <bernalex@gentoo.org> Acked-by: Brian Dolbec <dolsen@gentoo.org> Reviewed-by: Zac Medico <zmedico@gentoo.org>
* Remove some broken old-style virtual codeSebastian Luther2014-03-301-14/+0
| | | | Fixes a crash reported on IRC
* Update dates in recently changed files.Arfrever Frehtes Taifersar Arahesis2014-02-051-1/+1
|
* various pylint clean upsMike Frysinger2014-02-031-0/+1
| | | | Hopefully should be no functional changes here.
* dep_zapdeps: fix all_available referenceZac Medico2013-08-211-1/+1
| | | | This broke in commit c08402d745eef26b99091f62556f48aa9b60345a.
* dep_zapdeps: prefer all_installed_slots choicesZac Medico2013-08-211-9/+20
| | | | | | This will fix bug #480736, by preferring libpostproc in deps like || ( ffmpeg:0 libpostproc ) where libpostproc is already installed and ffmpeg:0 is not.
* dep_zapdeps: skip want_update_pkg if pkg in graphv2.2.0_alpha191Zac Medico2013-07-291-0/+2
|
* Pull in new slots when appropriate, bug #478188.Zac Medico2013-07-291-5/+28
|
* dep_check: remove redundant list copyZac Medico2013-06-091-2/+2
| | | | | There's no need to copy the list before calling dep_wordreduce, since dep_wordreduce copies the list internally.
* match_from_list: =* op with revision, bug #467826Zac Medico2013-06-081-5/+27
|
* Atom: handle invalid */foo-version wildcardZac Medico2013-05-241-2/+4
| | | | | | | Before, a wildcard atom could be treated as valid even though it specified a version without an operator, as reported at here: https://forums.gentoo.org/viewtopic-p-7314746.html#7314746
* _get_slot_re: relocate due to circular importZac Medico2013-03-191-20/+1
|
* Fix default use match for implicit IUSE.v2.2.0_alpha159Zac Medico2013-01-211-3/+5
| | | | | | This will fix bug #453400, which was triggered by inconsistency between the enabled USE and the effective missing_disabled set used in matching logic, due to implicit IUSE.
* Use unicode_literals more.Zac Medico2013-01-183-6/+11
| | | | | This helps to ensure consistent results, regardless of whether we're using Python 2 or Python 3.
* test_paren_reduce: disable deprecation warningZac Medico2013-01-031-2/+2
|
* Add portage._internal_caller var, and use it.Zac Medico2013-01-031-6/+6
|
* Disallow SLOT="${slot}/${subslot}=" in ebuilds.Arfrever Frehtes Taifersar Arahesis2012-12-111-1/+1
|
* Rename Package.metadata to _metadata.Zac Medico2012-11-262-2/+2
| | | | | The raw metadata is considered a private low-level internal. This makes the Package class consistent with the _pkg_str class.
* Update doc string of portage.dep.extract_affecting_use().Arfrever Frehtes Taifersar Arahesis2012-11-251-5/+5
|
* EAPI="5-progress": Add automatic unpack dependencies.Arfrever Frehtes Taifersar Arahesis2012-11-241-0/+45
|
* Add Package.eapi property.Zac Medico2012-11-172-2/+2
|
* Atom.without_use: preserve blocker prefixZac Medico2012-11-141-3/+9
|
* Move portage.dep._internal_warnings to portage.v2.2.0_alpha139Zac Medico2012-10-161-10/+5
|
* match_from_list: rm redundant catpkgsplit(mycpv)Zac Medico2012-10-141-3/+2
|
* EAPI="5-progress": Add master_repositories(), repository_path(),Arfrever Frehtes Taifersar Arahesis2012-10-141-0/+1
| | | | available_eclasses(), eclass_path() and license_path() functions.
* Atom: support *_beta* wildcard, bug #437872Zac Medico2012-10-101-2/+2
|
* _slot_operator: EAPI 5-hdepend DEPEND target onlyZac Medico2012-09-271-5/+9
|
* evaluate_slot_operator_equal_deps: do HDEPENDZac Medico2012-09-251-0/+1
|
* Use constants for hardcoded *DEPEND lists.Zac Medico2012-09-251-6/+4
|
* Add experimental EAPI 5-hdepend support.Ambroz Bizjak2012-09-241-1/+1
|