aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Make portage.util.compression_probe work when ctypes is unavailableHEADmastermid-kid3 days1-2/+2
| | | | | | | | This is useful for bootstrapping purposes, as _ctypes requires a dynamic linker. Closes: https://github.com/gentoo/portage/pull/1363 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* ebuild.5: update QA variables affected by QA_PREBUILTLucio Sauer3 days1-22/+22
| | | | | | Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Closes: https://github.com/gentoo/portage/pull/1367 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* phase-functions: extend QA_PREBUILT handling to QA_SONAME_NO_SYMLINKLucio Sauer3 days1-1/+2
| | | | | | | | | | This behavior is implied by the ordering of QA variables in the man page since the introduction of QA_SONAME_NO_SYMLINK. Bug: https://bugs.gentoo.org/924953 Fixes: dcb42a417355510284a35c08a4bf849047122a5c Signed-off-by: Lucio Sauer <watermanpaint@posteo.net> Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* _EbuildFetcherProcess: Suppress asyncio.CancelledErrorZac Medico4 days1-1/+1
| | | | | | Fixes: 74e29110d86a ("_EbuildFetcherProcess: Suppress CancelledError") Bug: https://bugs.gentoo.org/937888 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* run_exitfuncs: Drop hooks inherited via forkZac Medico4 days1-2/+7
| | | | | | | | | Drop hooks inherited via fork because they can trigger redundant actions as shown in bug 937891. Note that atexit hooks only work after fork since issue 83856 was fixed in Python 3.13. Bug: https://bugs.gentoo.org/937891 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _EbuildFetcherProcess: Suppress CancelledErrorZac Medico4 days1-1/+1
| | | | | | | | | Suppress CancelledError when attempting to cache the result in the _async_uri_map method. The cancelled result is returned for the caller to handle. Bug: https://bugs.gentoo.org/937888 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* dispatch-conf: ignore SHELL in spawn_shellMike Gilbert4 days1-19/+11
| | | | | | | | | | There is no need to use SHELL here, and this can actually cause problems when SHELL is set to "nologin" or "false". Look for sh in PATH instead. Bug: https://bugs.gentoo.org/910560 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
* Support coroutine exitfuncs for non-main loopsZac Medico8 days4-29/+76
| | | | | | | | | | | | | | | | | | | | Since an API consumer can cause loops to be instantiated for non-main threads, support coroutine exitfuncs for each loop. The included Socks5ServerAtExitThreadedTestCase calls get_socks5_proxy from a non-main thread, and demonstrates that coroutine exitfuncs for the resulting non-main loop will reliably stop the socks5 proxy via atexit hook. The _thread_weakrefs_atexit function will now make a temporary adjustment to _thread_weakrefs.loops so that a loop is associated with the current thread when it is closing. Also, the _get_running_loop function will now store weak references to all _AsyncioEventLoop instances it creates, since each has a _coroutine_exithandlers attribute that can be modified by atexit_register calls. Bug: https://bugs.gentoo.org/937740 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* run_exitfuncs: Support loop close via hookZac Medico10 days5-21/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handle the case where the loop has not been explicitly closed before exit. In this case, run_exitfuncs previously tried to call coroutine functions as though they were normal functions, which obvously would not behave correctly. Solve this problem by storing the coroutine functions in a separate _coroutine_exithandlers list that belongs exclusively to the run_coroutine_exitfuncs function, so that it is safe to close the loop and call run_coroutine_exitfuncs from inside a run_exitfuncs hook. A _thread_weakrefs_atexit hook already exists that will close weakly referenced loops. The _thread_weakrefs_atexit hook is now fixed to release its lock when it closes a loop, since the same lock may need to be re-acquired when run_coroutine_exitfuncs runs. The included test case demonstrates that run_exitfuncs will run via an atexit hook and correctly terminate the socks5 proxy in a standalone program using the portage API (like eclean). Due to a deadlock that will occur if an _exit_function atexit hook from the multiprocessing module executes before run_exitfuncs, a portage.process._atexit_register_run_exitfuncs() function needs to be called in order to re-order the hooks after the first process has been started via the multiprocessing module. The natural place to call this is in the ForkProcess class, using a global variable to trigger the call just once. Fixes: c3ebdbb42e72 ("elog/mod_custom: Spawn processes in background") Bug: https://bugs.gentoo.org/937384 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* doebuild.spawn: Skip socks5 proxy for "depend" phaseZac Medico11 days1-1/+1
| | | | | | | | | | | | Skip the socks5 proxy for the "depend" phase. It should not be needed because we only allow bash builtin commands during this phase. Since the socks5 proxy requires portage's event loop to be explictly closed before exit, skipping it will allow programs like eclean-dist to avoid the need to explicitly close portage's event loop before exit. Bug: https://bugs.gentoo.org/937384 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ELF: add entries for BPFSam James11 days2-2/+5
| | | | | Bug: https://bugs.gentoo.org/937485 Signed-off-by: Sam James <sam@gentoo.org>
* NEWS: Fix FETCHCOMMAND spellingZac Medico2024-08-031-1/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _EbuildFetcherProcess: Handle SIGTERMZac Medico2024-08-035-32/+257
| | | | | | | | | | | | | | | | | | | | | Fix _EbuildFetcherProcess to handle SIGTERM, so that FETCHCOMMAND processes will not be left running in the background: * Convert the fetch function to an async_fetch coroutine function so that it can use asyncio.CancelledError handlers to terminate running processes. * Use multiprocessing.active_children() to detect and terminate any processes that asyncio.CancelledError handlers did not have an opportunity to terminate because the exception arrived too soon after fork/spawn. * Add unit test to verify that a child process is correctly killed when EbuildFetcher is cancelled, with short timeout in case it takes some time for the process to disappear. Bug: https://bugs.gentoo.org/936273 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* JobStatusDisplay: increase the default width to 100Florian Schmaus2024-08-021-1/+1
| | | | | | | | | | | | | | | | Conservatively modernize the default width value from 80 to 100. Usually, I do not care much about the width, but the job status display holds more information these days, compared to the times where this value was set. Plus, self._isatty has the tendency to return false, even though portage is actually run within a tty. The prime examples causing this are systemd-run (and run0). Therefore, a conservatively increasing the value is sensible. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1348 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* JobStatusDisplay: show length of merge-wait queueFlorian Schmaus2024-08-023-1/+13
| | | | | | | | | | Since FEATURES=merge-wait is now the default, the length of the merge-wait queue becomes more relevant. Hence show it as part of portage's job status display. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1347 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* emerge-webrsync: actually honour the sync-webrsync-verify-signature attributeKerin Millar2024-07-262-8/+10
| | | | | | | | | | | | | | | The repo_has_webrsync_verify variable was always being set as the empty string, despite later being compared to 1 in the arithmetic context. Have it work in the way that was originally intended. This also eliminates a superfluous use of the has() function, which was the reason for my inspecting the code in the first place. Also, apply the exact same fix to emerge-delta-webrsync. Fixes: b5cd549e07f3d835cbe04e5b718cdd47d7ee69f5 Fixes: 0347637fe5033d3d8eb4fdafa1e86de171934819 Signed-off-by: Kerin Millar <kfm@plushkava.net> Signed-off-by: Sam James <sam@gentoo.org>
* Check whether xtrace is enabled sensiblyKerin Millar2024-07-264-7/+7
| | | | | | | | To write [[ ${-/x/} != $- ]] is horribly backwards and comparatively expensive. Implement the test - and its inverse - in a sensible fashion. Signed-off-by: Kerin Millar <kfm@plushkava.net> Signed-off-by: Sam James <sam@gentoo.org>
* make.globals: add bcachefs_effective.* and bcachefs.* to PORTAGE_XATTR_EXCLUDEFlorian Schmaus2024-07-212-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Just like btrfs the bcachefs filesystem makes heaviy use of xattrs. In my case emerge --config gentoo-kernel failed with install-xattr: setxattr() failed: Operation not supported A strace revealed setxattr("/boot/efi/8410476acd4b1e12c678fc815c18f551/6.9.5-gentoo-dist/linux", "bcachefs_effective.background_co"..., "zstd", 4, 0) = -1 EOPNOTSUPP (Operation not supported) and indeed, the source file to the install operation was under /usr/src which had background compression enabled. As a result, install-xattr tried to copy the attribute over to the destination file and failed. Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1346 Signed-off-by: Sam James <sam@gentoo.org>
* convert f-strings to normal stringsMarkus Meier2024-07-195-7/+7
| | | | | | | | | that do not contain any {}. detected with ruff Signed-off-by: Markus Meier <maekke@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1355 Signed-off-by: Sam James <sam@gentoo.org>
* ebuild: try to make maintainer mode checks a bit less prone to FPEli Schwartz2024-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We sometimes get weird results. For example, in binutils/gdb, we get: ``` * QA Notice: Automake "maintainer mode" detected: * * checking for aclocal... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing aclocal-1.15 * checking for autoconf... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing autoconf * checking for autoheader... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing autoheader * checking for aclocal... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing aclocal-1.15 * checking for autoconf... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing autoconf * checking for autoheader... ${SHELL} /var/tmp/portage/dev-debug/gdb-15.1/work/gdb-15.1/missing autoheader ``` The current pattern looks for the definition of the "missing" script followed by known autotools commands. With a bit more effort, we can hopefully match the actual `make` commands that get produced as maintainer targets. As far as I can tell, they always include an attempt to cd to the project root and then run the maintainer target. Signed-off-by: Eli Schwartz <eschwartz@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1359 Signed-off-by: Sam James <sam@gentoo.org>
* binrepos.conf: Support custom download locationZac Medico2024-07-169-12/+106
| | | | | | | | | | | | | | | | | | | | | | | Download packages to a custom location if it is configured in binrepos.conf, instead of PKGDIR. If a custom download location is not configured then inject downloaded packages into PKGDIR as usual. The binarytree download_required method should now be used instead of the isremote method to check if download is required, since a remote package may or may not be cached in the custom location. The get_local_repo_location method should be used to check if there is a custom download location, and if there is then downloaded packages must not be injected into PKGDIR. If any packages from a repo with a custom download location were injected into PKGDIR in the past, their identity will be recognized and will not be re-downloaded to the custom location. Bug: https://bugs.gentoo.org/934784 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* config: Allow a repository to be configured using one of its aliasesJames Le Cuirot2024-07-102-4/+9
| | | | | | | | | | | | | | | | | | | Currently, the `[name]` in repos.conf can only match the primary name. This is inconvenient if a repository wants to change its name without breaking existing configurations. This raises the question of whether to then use the primary name or the alias in the UI and in the vardb. I went with the primary name because this is presumably the name that the repository actually wants you to use. If the configured name matches neither the primary name nor an alias, then emaint sync will simply claim that it is not found, but that behaviour is unchanged from before. Bug: https://bugs.gentoo.org/935830 Closes: https://github.com/gentoo/portage/pull/1358 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* Allow GIL to be disabled in whirlpool C extensionZac Medico2024-06-281-17/+29
| | | | | | | | | | | | | | | In 3.13 python extensions need to declare support for GIL features, for example if they don't declare Py_MOD_GIL_NOT_USED then it will cause the GIL to be enabled even when python was launched in free-threaded mode. This requires "multi-phase initialization" because Py_mod_create is incompatible with m_slots. There's a PyUnstable_Module_SetGIL() function that can be used with single-phase init, but it's an unstable API, so it's better to use multi-phase init. There's no need to use PyModule_GetState() because the whirlpool module has no mutable state. Bug: https://bugs.gentoo.org/934220 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* vartree, movefile: Warn when rewriting a symlinkUlrich Müller2024-06-193-0/+17
| | | | | | | | | | See PMS section 13.4.1 (Rewriting): Any absolute symlink whose link starts with D must be rewritten with the leading D removed. The package manager should issue a notice when doing this. Bug: https://bugs.gentoo.org/934514 Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* ebuild: fix typo in commentSam James2024-06-171-1/+1
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* ebuild: fix maintainer mode checks to work with modern autotoolsEli Schwartz2024-06-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modern autotools does not use the --run argument to "missing", so the check essentially never ever ever ever fired anywhere. The GNU "missing" script is actually allowed to be run by any software at all, so checking for "missing --run" was always wrong. Indeed, there are some packages which use it for their own purposes and added suppressions for this FP. The correct solution really is to check for *maintainer mode* by checking whether *maintainer* programs are run (via "missing"). This also means we get to check for specific programs which autotools.eclass would be capable of handling, and don't need to arbitrarily exclude stuff like help2man (???) which makes things somewhat simpler. It should be noted that I have observed 3 scenarios for the missing script to be run via: - the missing script is surrounded by single quotes, followed by the unquoted command - the missing script is unquoted, and is followed by the unquoted command - legacy: the missing script is unquoted and is followed by --run We have to handle all three cases via a regex group. Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
* bin/ebuild.sh: disable globskipdots too in Bash 5.2Sam James2024-06-132-4/+10
| | | | | | | | | | | | See 69cac73ba0a7bcf2e2cff88c60d389895a550623. globskipdots is a new option in bash-5.2 that is also default-on in that release. The default value is not gated by BASH_COMPAT (see bug #907061), hence we need to disable it for older Bashes to avoid behaviour changes in ebuilds and eclasses. Bug: https://bugs.gentoo.org/907061 Signed-off-by: Sam James <sam@gentoo.org>
* emerge: Make --root-deps install build deps to ROOT plus / for all EAPIsJames Le Cuirot2024-06-114-22/+36
| | | | | | | | | | | Rather than instead of / for EAPI 6 and below. This changes the behaviour, but it is arguably not a breaking change, as no installations are being dropped. The previous behaviour was highly likely to break anyway. Bug: https://bugs.gentoo.org/435066 Closes: https://github.com/gentoo/portage/pull/1319 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
* tar_safe_extract: Use tarfile.fully_trusted_filterZac Medico2024-06-091-0/+9
| | | | | | | | | | | This suppresses a DeprecationWarning triggered because the tarfile.data_filter will become the new default in python3.14. The fully_trusted filter should be suitable here because tar_safe_extract already performs security validation on tar members prior to extraction. Bug: https://bugs.gentoo.org/933433 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* sync/zipfile: Install zipfile sync methodAlexey Gladkov2024-06-042-0/+9
| | | | | | | | | | Add files that were accidentally forgotten when adding zipfile sync method. Fixes: 80445d9b0 ("sync: Add method to download zip archives") Signed-off-by: Alexey Gladkov <legion@kernel.org> Closes: https://github.com/gentoo/portage/pull/1340 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* NEWS, meson.build: prepare for portage-3.0.65portage-3.0.65Sam James2024-06-042-2/+2
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* NEWS: prepare forSam James2024-06-041-1/+63
| | | | Signed-off-by: Sam James <sam@gentoo.org>
* Add binpkgs info to mtimedb resume dataZac Medico2024-06-024-5/+66
| | | | | | | | | | | | | | | In order to fix emerge --resume and --keep-going to make appropriate binary package selections, store a list of binpkgs in the resume data. By adding the data as a new key which older versions of portage will ignore, the extension is backward compatible. Without this fix, emerge --resume and --keep-going make poor package selection choices which do not account for the --binpkg-respect-use option. Bug: https://bugs.gentoo.org/933442 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* tar_stream_writer: Add missing error attributeZac Medico2024-06-021-0/+1
| | | | | | | | | This attribute was previously initialized only in an exception handler. Fixes: b8c3f38ec5ee ("Add more error handling for binpkgs") Bug: https://bugs.gentoo.org/933385 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* MergeProcess: Pass bintree to subprocessZac Medico2024-06-011-2/+3
| | | | | | | | It's required for FEATURES=*-backup. Fixes: b9a85ff987ea ("MergeProcess: Support QueryCommand with spawn start method") Bug: https://bugs.gentoo.org/933297 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* eapi.sh: Drop ___eapi_has_dohtml_deprecated()Ulrich Müller2024-06-012-10/+2
| | | | | | | | | | This was added because of a council decision 10 years ago: https://projects.gentoo.org/council/meeting-logs/20140909-summary.txt It has outlived its usefulness since dohtml is banned in EAPI 7 and later. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* atomic_ofstream: fix follow_symlinks fallback and default file modeZac Medico2024-05-273-15/+116
| | | | | | | | | | | | | | | | Handle OSError from mkstemp for (default) follow_symlinks mode, not following the symlink if necessary (the target's parent may not exist or may be readonly). This restores the fallback behavior that existed before the introduction of mkstemp in commit de19f3a7215d. Handle missing _file and _tmp_name attributes during close. Also set the default file mode respecting umask if a previous file does not exist, which fixes the mode of CONTENTS files since mkstemp. Fixes: de19f3a7215d ("atomic_ofstream: Use mkstemp rather than getpid (pid namespace safety)") Signed-off-by: Zac Medico <zmedico@gentoo.org>
* atomic_ofstream: Use mkstemp rather than getpid (pid namespace safety)Zac Medico2024-05-271-19/+28
| | | | | Bug: https://bugs.gentoo.org/851015 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* binarytree: Rewrite remote index only on changeZac Medico2024-05-271-1/+3
| | | | | | | | I noticed that the remote index was rewritten with a new DOWNLOAD_TIMESTAMP even while frozen, and this patch fixed it. Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Scheduler: convert state_change to boolean in _schedule_tasks_imp()Florian Schmaus2024-05-271-5/+5
| | | | | | Signed-off-by: Florian Schmaus <flow@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1324 Signed-off-by: Sam James <sam@gentoo.org>
* Scheduler: drop unreachable return statement in _schedule_tasks_imp()Florian Schmaus2024-05-271-2/+0
| | | | | Signed-off-by: Florian Schmaus <flow@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* Scheduler: coalesce common code in _schedule_tasks_imp()Florian Schmaus2024-05-271-10/+5
| | | | | Signed-off-by: Florian Schmaus <flow@gentoo.org> Signed-off-by: Sam James <sam@gentoo.org>
* sync: don't use ipv6 for rsync when it's disabledPavel Balaev2024-05-271-4/+3
| | | | | | | | | | | | | | | | | | | | socket.has_ipv6 gives a false result: $ sysctl net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.all.disable_ipv6 = 1 $ python Python 3.11.8 (main, Feb 24 2024, 17:10:38) [GCC 13.2.1 20240210] on linux >>> import socket >>> socket.has_ipv6 True This patch uses the portage.process.has_ipv6() function, which returns the correct result. Bug: https://bugs.gentoo.org/927241 Signed-off-by: Pavel Balaev <mail@void.so> Closes: https://github.com/gentoo/portage/pull/1309 Signed-off-by: Sam James <sam@gentoo.org>
* process: make has_ipv6 a public functionPavel Balaev2024-05-272-5/+5
| | | | | Signed-off-by: Pavel Balaev <mail@void.so> Signed-off-by: Sam James <sam@gentoo.org>
* emerge.1: Fix /var/log/emerge.log descriptionWaldo Lemmer2024-05-261-3/+3
| | | | | | | | | | | | | | /var/log/emerge.log doesn't "[contain] a log of all emerge output". This commit changes this description to better reflect what emerge.log contains: - Packages that were built - emerge's invocation (i.e. its command-line arguments) Signed-off-by: Waldo Lemmer <waldolemmer1@gmail.com> Closes: https://github.com/gentoo/portage/pull/1331 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* test_tar_merge_order.py: Fix unused pytest unused-importZac Medico2024-05-261-1/+0
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Revert "find_smallest_cycle: Optimize to traverse fewer nodes"Zac Medico2024-05-264-40/+9
| | | | | | | | | This reverts commit 49e01d041c74680a81860b819daff812d83df02f in order to fix bug 922629. Later we can try to optimize it again but without breaking testTarMergeOrder. Bug: https://bugs.gentoo.org/922629 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* tests: add testcase for app-arch/tar merge order with binpkgsSam James2024-05-262-0/+496
| | | | | | | | | | | | | | | | | | | | | | | | | In the bug, dilfridge reports releng@ is hitting the following: ``` $ emerge -epvk world | grep -E "(app-arch/tar|sys-apps/acl)" [ebuild N ] sys-apps/acl-2.3.2-r1::gentoo USE="nls -static-libs" 363 KiB [binary R ] app-arch/tar-1.35-1::gentoo USE="acl* nls* xattr* -minimal (-selinux) -verify-sig" 0 KiB [...] ``` Test for bug #922629 where binary app-arch/tar[acl] was merged before its dependency sys-apps/acl (with virtual/acl merged but unsatisfied). It (appears to be) a bad interaction with @system containing app-alternatives/tar plus a circular dependency on app-arch/tar. The USE change is also important, as e.g. dropping "sys-apps/attr nls" from package.use makes things okay. XFAIL'd for now. Bug: https://bugs.gentoo.org/922629 Signed-off-by: Sam James <sam@gentoo.org> Closes: https://github.com/gentoo/portage/pull/1332 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Fix a depgraph crash with useoldpkg and subslot bumpsTatsuyuki Ishi2024-05-261-0/+1
| | | | | | | | | | | | | | | | | This resolves a "list index out of range" error that could happen with when a package's subslot is bumped and --useoldpkg is used. Due to the subslot bump, the code will filter matched_packages to only contain the latest version. However, this didn't update matched_oldpkg, which would now contain stale packages and cause logic errors. Fix this by filtering matched_oldpkg again before its use. Signed-off-by: Tatsuyuki Ishi <ishitatsuyuki@google.com> Bug: https://bugs.gentoo.org/932804 Closes: https://github.com/gentoo/portage/pull/1322 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* bintree: Add REPO_REVISIONS to package index headerZac Medico2024-05-252-14/+124
| | | | | | | | | | | | | As a means for binhost clients to select source repo revisions which are consistent with binhosts, inject REPO_REVISIONS from a package into the index header, using a history of synced revisions to guarantee forward progress. This queries the relevant repos to check if any new revisions have appeared in the absence of a proper sync operation. Bug: https://bugs.gentoo.org/924772 Signed-off-by: Zac Medico <zmedico@gentoo.org>