aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* emerge: add -W option short for --deselectGreg Kubaryk2021-03-272-1/+3
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Use atomic_ofstream as Context Manager i.e., with-statement contextsFlorian Schmaus2021-03-111-3/+3
| | | | | | | | | | | | | With [1: e93e6d65fa1c] atomic_ofstream became a Context Manager. This commit transforms three further call sites of atomic_ofstream() to use with-statement contexts for easier readability and increased robustness against resource leaks. 1: e93e6d65fa1ca75f676a227f7918f8b6d747425c Make atomic_ofstream a Context Manager Signed-off-by: Florian Schmaus <flo@geekplace.eu> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* EbuildPhase: Use async and await syntaxZac Medico2021-03-071-16/+12
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib: Remove outdated Python 2 commentsMatt Turner2021-03-064-15/+0
| | | | | | Fixes: 788c0e8bb ("Remove from __future__ import unicode_literals") Signed-off-by: Matt Turner <mattst88@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge: make --binpkg-respect-use=y imply --autounmask-use=nZac Medico2021-03-021-11/+11
| | | | | | | | | If --binpkg-respect-use=y is given explicitly, then it implies --autounmask-use=n, because these options naturally oppose eachother. Bug: https://bugs.gentoo.org/773469 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge: disable --autounmask-license by defaultZac Medico2021-02-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Disable --autounmask-license by default, in order to limit user exposure to risks associated with package.license changes. The changes that this option suggests are only intended to be accepted when a user has made a conscious decision to accept the corresponding license(s). Creation of package.license changes introduces a risk that users may erroneously accept the changes due to some kind of accident or misunderstanding, rather than due to conscious decisions about licenses. These risks provide motivation to disable --autounmask-license by default. The --autounmask-use option will remain as the only autounmask option that is still enabled by default. The unit tests demonstrate interactions between --autounmask and --autounmask-license options. The --autounmask option enables --autounmask-license unless --autounmask-license=n has been specified. If --autounmask=n is used to disable autounmask, then --autounmask-license=y has no effect. Bug: https://bugs.gentoo.org/766773 Reviewed-by: Brian Dolbec <dolsen@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* check_reverse_dependencies: dereference virtual expansions (bug 764764)Zac Medico2021-01-101-0/+22
| | | | | | | | | | | | | If an atom is the result of virtual expansion, then derefrence it to _orig_atom in check_reverse_dependencies so that it will be correctly handled as a built slot operator dependency when appropriate. This solves a case triggered in bug 764764 where a virtual expansion from virtual/dist-kernel:0/5.10.5= to =virtual/dist-kernel-5.10.5 prevented the atom from being handled as a built slot operator dependency, which prevented rebuilds from being triggered. Bug: https://bugs.gentoo.org/764764 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* depgraph._add_pkg: fix AttributeError when myparent is not a PackageZac Medico2020-12-031-1/+1
| | | | | | Fixes: b991f23ad915 ("Allow a package to replace its own buildtime dependency") Bug: https://bugs.gentoo.org/757741 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* find_smallest_cycle: don't merge satisfied PDEPEND too earlyZac Medico2020-12-022-4/+5
| | | | | | | | | | | | | | After PDEPENDs have been neglected by the find_smallest_cycle function, do not try to merge them too early if they are already satisfied by an installed package. This fixes incorrect merge order for PDEPEND cycles involving xorg-server and xorg-drivers, which was triggered by commit 5095c2023595a75e2848f1ad3dbe25b5fb451a44 because it gave PDEPEND higher priority than satisfied buildtime dependencies. Fixes: 5095c2023595 ("find_smallest_cycle: enhance search prioritization") Reported-by: josef64 in #gentoo-portage Bug: https://bugs.gentoo.org/754903 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Allow a package to replace its own buildtime dependencyZac Medico2020-11-281-13/+55
| | | | | | | | | | | | | | | | | If a package has a buildtime dependency on a previous version that it will replace, then do not treat it as a slot conflict. This solves inappropriate behavior for dev-lang/rust[system-bootstrap]. This requires adjustments to package selection logic in several locations, in order to ensure that an installed package instance will be selected to satisfy a buildtime dependency when appropriate. Dependencies of the installed package will be entirely ignored, but that has already been the case when using installed package to break cycles, as discussed in bug 199856. Bug: https://bugs.gentoo.org/756793 Bug: https://bugs.gentoo.org/756961 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* find_smallest_cycle: enhance search prioritizationZac Medico2020-11-213-38/+60
| | | | | | | | | | | | | | | | | | | | | | | | | Enhance the find_smallest_cycle function to prioritize its search so that it will minimize the use of installed packages to break cycles. When installed packages must be used to break cycles, it will now prefer to do this for runtime dependencies over buildtime dependencies, since it's preferable to build against latest versions of buildtime dependencies whenever possible. This should solve some cases of bug 199856 which have been triggered by unsafe reliance on installed packages to break cycles. The included unit test case demonstrates correct merge order for a dependency calculation involving 6 independent cycles. This test case fails with the master branch, due to a buildtime dependency cycle of 3 packages being merged earlier than cycles of 2 packages. We can generalize this to say that the master branch may use an installed package to break an arbitrarily sized cycle in a somewhat random location, even though that cycle may be composed of smaller independent cycles which would be safer to break individually. Bug: https://bugs.gentoo.org/754903 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Typofix: Use just one definite articlePetr Šabata2020-11-211-1/+1
| | | | | | | | | I first noticed this in make.conf(5) but it turned out there were many more occurences of these; fixed with find & sed. Closes: https://github.com/gentoo/portage/pull/634 Signed-off-by: Petr Šabata <contyk@redhat.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge: add --quickpkg-direct-root optionZac Medico2020-11-013-5/+30
| | | | | | | | | Specify the root to use as the --quickpkg-direct package source. This root is assumed to be immutable during the entire emerge operation. The default is set to "/". Bug: https://bugs.gentoo.org/752066 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge: enable parallel-fetch during pkg_pretend (bug 710432)Zac Medico2020-09-201-43/+99
| | | | | | | | | | | | | | | | Execute pkg_pretend phases in a coroutine while parallel-fetch is running concurrently. When it's time to execute the pkg_pretend phase for a remote binary package, use a Scheduler _get_prefetcher method to get a running prefetcher if available, and otherwise start a new fetcher. Since pkg_pretend phases now run inside of the --keep-going retry loop, --keep-going is now able to recover from pkg_pretend failures, which fixes bug 404157. Bug: https://bugs.gentoo.org/404157 Bug: https://bugs.gentoo.org/710432 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _slot_confict_backtrack: group similar missed updates (bug 743115)Zac Medico2020-09-202-7/+25
| | | | | | | | | | | | When a slot conflict occurs due to a missed update, and some other similar update(s) are available, add the similar update(s) to the runtime package mask for the same backtracking choice. This reduces minimum number of backtrack tries required to solve the test case for bug 743115 from 7 to 4, where the difference of 3 corresponds to the number of other similar setuptools updates available. Bug: https://bugs.gentoo.org/743115 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _slot_confict_backtrack: minimize conflict atoms (bug 743631)Zac Medico2020-09-201-0/+6
| | | | | | | | | | | Prefer choices that minimize conflict atoms, so that choices which satisfy all parents are preferred. This reduces the minimum necessary backtrack tries from 21 to 7 for the unit test related to bug 743115. Bug: https://bugs.gentoo.org/743115 Bug: https://bugs.gentoo.org/743631 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* binrepos.conf: support fetchcommand customization (bug 668302)Zac Medico2020-09-071-10/+19
| | | | | | | | | Support customization of fetchcommand and resumecommand in binrepos.conf, allowing customized authentication mechanisms for each repository. Bug: https://bugs.gentoo.org/668302 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Add binrepos.conf to replace PORTAGE_BINHOST (bug 668334)Zac Medico2020-09-071-1/+12
| | | | | | | | | | | | | | | | | | Support /etc/portage/binrepos.conf as a replacement for the PORTAGE_BINHOST variable. Behavior is similar to repos.conf, initially supporting just the sync-uri attribute. Both binrepos.conf and PORTAGE_BINHOST can be used simultaneously, in the same way that repos.conf and PORTDIR_OVERLAY can be used simultaneously. The emerge --info output for binrepos.conf looks like this: Binary Repositories: example-binhost sync-uri: https://example.com/binhost Bug: https://bugs.gentoo.org/668334 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge --search: auto-detect regular expressions (bug 737480)Zac Medico2020-09-073-1/+18
| | | | | | | | | | | | | | | | | | | | | Automatically detect regular expressions when the search string contains any of these regular expression characters or character sequences: ^ $ * [ ] { } | ? .+ This simplifies usage, so that users no longer have to remember to prefix regular expressions with the % character. The new behavior can be disabled by --regex-search-auto=n, in case the regular expressions interpretation causes some kind of problem. Note that fuzzy search and regular expression search are mutually exclusive, and fuzzy search remains the default for search strings that do not contain any regular expression characters. Bug: https://bugs.gentoo.org/737480 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Use cached portage.getpid() function (bug 739540)Zac Medico2020-08-302-2/+4
| | | | | | | | | Use the cached portage.getpid() function to avoid unnecessary syscalls, and update the cache after each call to os.fork() where the fork may invoke portage APIs. Bug: https://bugs.gentoo.org/739540 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* dephgraph: Allow elimination of highest version after slot conflict (bug 439688)Zac Medico2020-08-301-9/+0
| | | | | | | | | | | | | | | | | After a slot conflict occurs, allow the highest version to be eliminated from the graph when appropriate. This is needed for correct behavior in cases the highest version cannot be installed because an older version is required by some package. This reverts a change related to bug 531656 from commit a9064d08ef4c92a5d0d1bfb3dc8a01b7850812b0, and that change no longer appears to be necessary, since the unit tests related to bug 531656 now pass without it. Due to this change in slot conflict handling, the --changed-slot test case related to bug 456208 will now fail unless we use an @world update to trigger rebuilds, therefore fix it to do so. Bug: https://bugs.gentoo.org/439688 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* coroutine: use explicit loop parameter (bug 737698)Zac Medico2020-08-185-18/+19
| | | | | | | | | | | In order to support local event loops within API functions like doebuild, use an explicit loop parameter when calling a coroutine. Internal code will now raise an AssertionError if the loop parameter is omitted for a coroutine, but API consumers may omit it. Bug: https://bugs.gentoo.org/737698 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge: Add short -l option for --load-average (bug 699256)Zac Medico2020-08-161-0/+2
| | | | | | | | | Add a short -l option for --load-average just like make(1) has. Bug: https://bugs.gentoo.org/699256 Reviewed-by: Brian Dolbec <dolsen@gentoo.org> Reviewed-by: Matt Turner <mattst88@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge: Remove deprecated --changelog option (bug 699256)Zac Medico2020-08-164-150/+3
| | | | | Bug: https://bugs.gentoo.org/699256 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SpawnProcess: fix _cancel to cleanup PipeLogger quicklyZac Medico2020-08-091-6/+16
| | | | | | | | Cleanup PipeLogger as quickly as possible, in order to prevent access to unclosed logs. Bug: https://bugs.gentoo.org/711174 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* BinpkgEnvExtractor: fix subprocess logfile usage (bug 711174)Zac Medico2020-08-081-1/+6
| | | | | | | | | | | Do not write to log file when in a MergeProcess subprocess, since stdout and stderr are already redirected to the log file by MergeProcess. This fixes log corruption when BinpkgEnvExtractor is use to extract environment.bz2 prior to pkg_prerm. Bug: https://bugs.gentoo.org/711174 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/*: Fix useless-returnAaron Bauman2020-08-072-6/+0
| | | | | | | * Python implies such things. Let's drop 'em and be consistent. Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* *: drop all import __future__ statementsAaron Bauman2020-08-0613-33/+10
| | | | | | | * We only support Py3 now. Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/*: Fix ungrouped-importsAaron Bauman2020-08-063-7/+9
| | | | | | | | | | | | * This fixes ungrouped imports for a portion of the repo. The remaining fixes will come in another batch of atomic commits as the imports are buried behind conditionals, are __futures__ that may be able to go away, etc * Per the above, check will not be enabled yet Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/*: fix superfluous-parens and enable checkAaron Bauman2020-08-054-12/+12
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/search.py: fix reimportedAaron Bauman2020-08-031-2/+2
| | | | | | | | * The bold module is imported twice. Once as 'bold' and again as 'white. Remove the duplication and fix the one reference to 'white' Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/search.py: fix whitespaceAaron Bauman2020-08-031-2/+2
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/BinpkgEnvExtractor.py: fix whitespaceAaron Bauman2020-08-031-2/+2
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/resolver/output_helpers.py: fix whitespaceAaron Bauman2020-08-031-1/+1
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/unmerge.py: fix whitespaceAaron Bauman2020-08-031-14/+14
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/resolver/circular_dependency.py: fix whitespaceAaron Bauman2020-08-031-3/+3
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/resolver/slot_collision.py: fix whitespaceAaron Bauman2020-08-031-31/+29
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/EbuildBuild.py: drop unused-importAaron Bauman2020-08-031-2/+2
| | | | | | | | * Drop unused-import * Update copyright Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/PollScheduler.py: drop unused-importAaron Bauman2020-08-031-3/+1
| | | | | | | | * Drop unused-import * Update copyright Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/resolver/slot_collision.py: drop unused-importAaron Bauman2020-08-031-2/+0
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/actions.py: drop unused-importAaron Bauman2020-08-031-12/+4
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/AbstractEbuildProcess.py: drop unused-importAaron Bauman2020-08-031-2/+1
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/UseFlagDisplay.py: drop unused-importAaron Bauman2020-08-031-1/+0
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/depgraph.py: drop unused-importAaron Bauman2020-08-031-2/+0
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/AbstractPollTask.py: drop unused-importAaron Bauman2020-08-031-2/+1
| | | | | | | | * Drop unused-import * Update copyright Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/Package.py: drop unused-importAaron Bauman2020-08-031-1/+0
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/resolver/output.py: fix unused-importAaron Bauman2020-08-031-2/+0
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/DependencyArg.py: fix unused-importAaron Bauman2020-08-031-3/+0
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/Scheduler.py: fix unused-importAaron Bauman2020-08-031-2/+0
| | | | | Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/_emerge/resolver/slot_collision.py: fix redefined-builtin W0622Aaron Bauman2020-08-021-37/+37
| | | | | | | | | * This fixes the referenced warning by renaming the 'id' variable to 'name' and the 'type' variable to 'atype' * Additional cosmetic/style changes found along the way. Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>