summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* make.conf.5: Suggest PORTAGE_LOG_FILTER_FILE_CMD supervisor for cat fallback ↵Zac Medico2021-05-231-1/+12
| | | | | | | | | | | (bug 781854) If PORTAGE_LOG_FILTER_FILE_CMD fails after exec, then output will be lost. Therefore, suggest to use bash as a supervisor, with fallback to cat. Bug: https://bugs.gentoo.org/781854 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* lib/portage/_sets/dbapi.py: add glob support to exclude-files parameter ↵Dave Hughes2021-05-232-0/+7
| | | | | | | | cnf/sets/portage.conf: add exclude-files=/usr/src/linux* in module-rebuild set Closes: https://github.com/gentoo/portage/pull/694 Signed-off-by: Dave Hughes <davidhughes205@gmail.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* unmerge: Remove vartree aliasFelix Bier2021-05-231-5/+4
| | | | | | | | | This commit removes the variable localtree, which is assigned once to point to vartree and then never modified. Closes: https://github.com/gentoo/portage/pull/705 Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* unmerge: Reuse helper variable quietFelix Bier2021-05-231-3/+2
| | | | | | | | This commit reuses the already existing helper variable quiet to avoid rechecking if --quiet is contained in myopts. Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* unmerge: Add tests for unmerge orderFelix Bier2021-05-231-0/+179
| | | | | | | | This commit adds unit tests for verifying the unmerge order that is calculated by unmerge_display(). Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Sort emerge --unmerge order for determinismFelix Bier2021-05-232-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the order in which packages are uninstalled with --unmerge to be deterministic. Before this commit, when an atom specified with --unmerge matches multiple versions, these versions were uninstalled in a random order. For example, when some-pkg-1.0.0 and some-pkg-2.0.0 are installed, then running emerge --unmerge some-pkg will unmerge 1.0.0 and 2.0.0 in a random order. With this commit, when an atom matches multiple versions, they are uninstalled in a sorted order. So in the above example, 1.0.0 will be unmerged before 2.0.0. This does not affect the order specified on the command-line, for example when running: emerge --unmerge =some-pkg-2.0.0 =some-pkg-1.0.0 that order is respected, as before this commit. Similarly, when uninstalling multiple different packages, e.g.: emerge --unmerge some-pkg some-other-pkg the sorting only applies to the versions matching each atom, so the versions matching some-pkg are sorted separately from the versions matching some-other-pkg, and since some-pkg is specified before some-other-pkg, its versions will be uninstalled first. Motivation: When a package has a custom pkg_postrm hook, uninstalling multiple versions in a random order can leave the filesystem in a different state depending on which version is uninstalled last. When running emerge as part of a larger build system such as catalyst, this is an obstacle towards reproducible builds. Bug: https://bugs.gentoo.org/782724 Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Change _shell_quote to handle more special charactersFelix Bier2021-05-232-1/+48
| | | | | | | | | | | | | | | | | | | | | | | This commit changes the function _shell_quote to ensure more special characters are quoted correctly. Without this commit, the following error message occurs when attempting to merge an ebuild that inherits from an eclass contained in a repository located in a filesystem path containing special characters: .../ebuild.sh: eval: line 604: syntax error near unexpected token `(' .../ebuild.sh: eval: line 604: `PORTAGE_ECLASS_LOCATIONS=(/var/db/repos/gentoo /home/user/test(v2)/test-overlay)' The paths that are handled in that line were sanitized with _shell_quote beforehand, but the list of special characters handled by _shell_quote did not include (). For this reason, the list has been extended to handle the following special characters that were not handled before: ;&|(){}[]#!~? Closes: https://github.com/gentoo/portage/pull/719 Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Add unit tests for _shell_quoteFelix Bier2021-05-231-0/+79
| | | | | | | | | This commit adds unit tests that cover the existing functionality of _shell_quote, by checking that various special characters are escaped/quoted correctly. Signed-off-by: Felix Bier <felix.bier@rohde-schwarz.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* env-update: skip PATH in systemd user environment definitionFlorian Schmaus2021-05-231-0/+5
| | | | | | | | | | | | | Having PATH in the systemd user environment created by env-update makes it impossible to use "systemctl --user import-environment PATH" to set PATH in systemd user units according to the current value of PATH. Using "systemctl --user import-environment PATH" is a well known idiom, and hence should work. Therefore, we skip the creation of the PATH entry by env-update. Closes: https://github.com/gentoo/portage/pull/701 Signed-off-by: Florian Schmaus <flo@geekplace.eu> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Enable EAPI 8Michał Górny2021-05-231-1/+1
| | | | | | Closes: https://github.com/gentoo/portage/pull/718 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* dosym: Implement -r option for EAPI 8.Ulrich Müller2021-05-232-1/+70
| | | | | | | | | | | | | | | | | | | "dosym -r <target> <link>" will expand the (apparent) path of <target> relative to the (apparent) path of the directory containing <link>. The main aim of this is to allow for an absolute path to be specified as the link target, and the function will count path components and convert it into a relative path. Since we're inside ED at this point but the image will finally be installed in EROOT, we don't try to resolve any pre-existing symlinks in <target> or <link>. In other words, path expansion only looks at the specified apparent paths, without touching any actual files in ED or EROOT. Bug: https://bugs.gentoo.org/708360 Signed-off-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Initial IDEPEND support (for EAPI 8)Michał Górny2021-05-2315-25/+60
| | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Support selective fetch restriction in emirrordistMichał Górny2021-05-231-29/+39
| | | | | Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Support selective fetch/mirror restriction for EAPI 8Michał Górny2021-05-233-4/+26
| | | | | | Bug: https://bugs.gentoo.org/371413 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Refactor fetch() for selective restrictionsMichał Górny2021-05-231-28/+26
| | | | | | | | | Refactor the fetch() function so that fetch/mirror restrictions only affect the code per-URI rather than globally. This will make it easier to apply restrictions selectively in EAPI 8. Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Make doconf, doenvd, doheader & doinitd ignore ins/exeopts in EAPI 8Michał Górny2021-05-235-4/+45
| | | | | | Bug: https://bugs.gentoo.org/657580 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Disallow options in PATCHES in EAPI 8Michał Górny2021-05-232-0/+17
| | | | | | Bug: https://bugs.gentoo.org/752486 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Relax update filenames as permitted for EAPI 8Michał Górny2021-05-231-11/+6
| | | | | | Bug: https://bugs.gentoo.org/692774 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Support second usev arg in EAPI 8Michał Górny2021-05-232-1/+9
| | | | | | Bug: https://bugs.gentoo.org/744868 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Require bash-5.0 in EAPI 8Michał Górny2021-05-232-1/+7
| | | | | | Bug: https://bugs.gentoo.org/636652 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Remove unpack support for 7z, lha and rar in EAPI 8Michał Górny2021-05-232-7/+31
| | | | | | Bug: https://bugs.gentoo.org/690968 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Ban hasq, hasv and useq in EAPI 8Michał Górny2021-05-233-3/+21
| | | | | | Bug: https://bugs.gentoo.org/199722 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge --fetch and regenworld: Respect EMERGE_LOG_DIR settingJames Stevenson2021-05-232-7/+27
| | | | | | | Closes: https://github.com/gentoo/portage/pull/720 Bug: https://bugs.gentoo.org/520378 Signed-off-by: James Stevenson <james.al.stevenson@gmail.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Implement PROPERTIES=test_network and ALLOW_TESTMichał Górny2021-05-197-17/+57
| | | | | | | | | | | | | | | | | | The 'test_network' property can be used to indicate that the test phase requires access to the Internet (but RESTRICT=test should still be used). If present, network-sandbox will be disabled throughout the test phase. This opens up the possibility of adding further 'test_*' properties. Additionally, ALLOW_TEST can be used to ignore RESTRICT=test in a subset of packages. When the value includes 'network' token, tests using 'test_network' property are reenabled. When the value includes 'all' token, all instances of RESTRICT=test are ignored. Bug: https://bugs.gentoo.org/553696 Reviewed-by: Zac Medico <zmedico@gentoo.org> Acked-by: Ulrich Müller <ulm@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* emerge --fetchonly --quiet: use emerge-fetch.log when writable (bug 285614)James Stevenson2021-05-162-6/+23
| | | | | | | Closes: https://github.com/gentoo/portage/pull/707 Bug: https://bugs.gentoo.org/285614 Signed-off-by: James Stevenson <james.al.stevenson@gmail.com> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Accumulated PROPERTIES and RESTRICT for EAPI 8Michał Górny2021-05-122-6/+50
| | | | | | Reviewed-by: Zac Medico <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/638 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Support new econf-passed parameters for EAPI 8Michał Górny2021-05-122-0/+21
| | | | | | Reviewed-by: Zac Medico <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/637 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* emerge: Fail with helpful message when --jobs=""Marco Sirabella2021-05-081-1/+1
| | | | | | | | Bug: https://bugs.gentoo.org/788967 Closes: https://github.com/gentoo/portage/pull/706 Reported-by: Christophe Lermytte <gentoo@lermytte.be> Signed-off-by: Marco Sirabella <marco@sirabella.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* PipeLogger: handle FileNotFoundError when cancelled during _startZac Medico2021-05-011-10/+25
| | | | | Bug: https://bugs.gentoo.org/787542 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ebuild-ipc: silently handle KeyboardInterruptZac Medico2021-05-011-3/+17
| | | | | Bug: https://bugs.gentoo.org/787563 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _run_pkg_pretend: Use async and await syntaxZac Medico2021-05-011-14/+12
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _run_pkg_pretend: raise asyncio.CancelledError when terminatedZac Medico2021-05-011-1/+5
| | | | | Bug: https://bugs.gentoo.org/787545 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ebuild.5: Add eapply documentationNekun2021-04-241-1/+21
| | | | | | Bug: https://bugs.gentoo.org/698244 Signed-off-by: Nekun <nekokun@firemail.cc> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* man/portage.5: Add userpatch documentationNekun2021-04-241-1/+32
| | | | | | Bug: https://bugs.gentoo.org/698244 Signed-off-by: Nekun <nekokun@firemail.cc> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* portage/tests: Be a bit more fancy with argparserMarco Sirabella2021-04-241-6/+9
| | | | | Signed-off-by: Marco Sirabella <marco@sirabella.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* portage/tests: Use pathlib for path handlingMarco Sirabella2021-04-241-26/+21
| | | | | | | | | | | | | This is mostly just a POC While we don't have tests for the testing harness, it does successfully test all the tests Used pathlib docs as a reference for translation: https://docs.python.org/3/library/pathlib.html#correspondence-to-tools-in-the-os-module Signed-off-by: Marco Sirabella <marco@sirabella.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* tests: Remove unused assertExists helperMarco Sirabella2021-04-242-33/+1
| | | | | Signed-off-by: Marco Sirabella <marco@sirabella.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge: use parse_intermixed_args when available (bug 784566)Zac Medico2021-04-202-2/+10
| | | | | | | | | The included unit test case previously failed with this error: emerge: error: unrecognized arguments: dev-libs/A Bug: https://bugs.gentoo.org/784566 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman/setup.py: update sdist for xz supportZac Medico2021-04-191-2/+5
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* tests: lazily evaluate cnf_* vars (bug 783957)Zac Medico2021-04-183-19/+83
| | | | | | | | | | Lazily evaluate cnf_* variables, allowing for mock portage.const settings created by ResolverPlayground. In ResolverPlayground, create symlinks for PORTAGE_BIN_PATH scripts inside the mock EPREFIX, and restore portage.const.EPREFIX in the cleanup method. Bug: https://bugs.gentoo.org/783957 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SimpleRepomanTestCase: update portage.const.EPREFIX after forkZac Medico2021-04-111-0/+1
| | | | | | | | | | Update portage.const.EPREFIX in each RepomanRun fork, since the portage.const PORTAGE_OVERRIDE_EPREFIX logic only executes when the module is first loaded in the parent process. Fixes: ba58bc1ae12a ("SimpleRepomanTestCase: collect results from subprocesses") Bug: https://bugs.gentoo.org/779508 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* man/emerge.1: fix typosThomas Deutschmann2021-04-051-1/+1
| | | | | | | Fixes: 3253686e9438 ("emerge: make --binpkg-respect-use=y imply --autounmask-use=n") Bug: https://bugs.gentoo.org/773469 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman: fix --version TypeErrorZac Medico2021-04-042-2/+3
| | | | | Bug: https://bugs.gentoo.org/779967 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SimpleRepomanTestCase: use -vvvv for debug modeZac Medico2021-03-311-0/+2
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman: fix ModuleConfig _not_installed path (bug 779055)Zac Medico2021-03-311-2/+2
| | | | | Bug: https://bugs.gentoo.org/779055 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman/lib/repoman/argparser.py: W0611: Unused import sys (unused-import)Zac Medico2021-03-301-1/+0
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman: correct parse_args local sys.argv referenceZac Medico2021-03-301-2/+2
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* repoman: Update for a repoman-3.0.3 releaserepoman-3.0.3Zac Medico2021-03-292-1/+7
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Updates for portage-3.0.18 releaseportage-3.0.18Zac Medico2021-03-293-1/+12
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* SyncRepos: suppress portage update message if PYTHON_TARGETS changedZac Medico2021-03-282-7/+48
| | | | | | | | When PYTHON_TARGETS changed, the emerge --oneshot portage suggestion a nuisance, therefore suppress it. Bug: https://bugs.gentoo.org/722748 Signed-off-by: Zac Medico <zmedico@gentoo.org>