commit: e8b395c0fdfdf896fb6d3168dd1cf9a130b20796 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Tue Jun 2 18:54:23 2020 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Tue Jun 2 18:54:23 2020 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e8b395c0
Merge remote-tracking branch 'overlays-gentoo-org/master' into prefix Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> .travis.yml | 7 +- MANIFEST.in | 5 + NEWS | 17 + RELEASE-NOTES | 122 +++++ bin/ebuild-helpers/dosym | 13 +- bin/ecompress | 16 +- bin/isolated-functions.sh | 4 +- bin/misc-functions.sh | 12 +- bin/phase-functions.sh | 4 - bin/phase-helpers.sh | 10 +- bin/socks5-server.py | 36 +- cnf/make.globals | 9 +- doc/api/.gitignore | 1 + doc/api/Makefile | 32 ++ doc/api/conf.py | 66 +++ doc/api/index.rst | 18 + doc/qa.docbook | 98 ++++ lib/_emerge/AbstractEbuildProcess.py | 2 +- lib/_emerge/AbstractPollTask.py | 3 - lib/_emerge/AsynchronousTask.py | 75 +-- lib/_emerge/CompositeTask.py | 7 +- lib/_emerge/EbuildFetcher.py | 12 +- lib/_emerge/EbuildMetadataPhase.py | 3 +- lib/_emerge/EbuildPhase.py | 66 ++- lib/_emerge/FifoIpcDaemon.py | 3 - lib/_emerge/Scheduler.py | 43 +- lib/_emerge/SequentialTaskQueue.py | 19 +- lib/_emerge/SubProcess.py | 15 +- lib/_emerge/actions.py | 40 +- lib/_emerge/create_world_atom.py | 11 +- lib/_emerge/depgraph.py | 65 ++- lib/portage/_compat_upgrade/binpkg_compression.py | 40 ++ lib/portage/_emirrordist/FetchTask.py | 9 - lib/portage/_selinux.py | 9 +- lib/portage/cache/ebuild_xattr.py | 5 +- lib/portage/cache/template.py | 2 +- lib/portage/const.py | 1 + lib/portage/data.py | 10 - lib/portage/dbapi/cpv_expand.py | 4 +- lib/portage/dbapi/porttree.py | 9 +- lib/portage/dbapi/vartree.py | 9 +- lib/portage/dep/dep_check.py | 93 ++-- lib/portage/dep/soname/SonameAtom.py | 9 +- lib/portage/dispatch_conf.py | 9 - lib/portage/emaint/modules/sync/sync.py | 2 +- lib/portage/locks.py | 67 ++- .../package/ebuild/_config/KeywordsManager.py | 16 +- .../package/ebuild/_config/special_env_vars.py | 6 +- .../package/ebuild/deprecated_profile_check.py | 2 +- lib/portage/package/ebuild/doebuild.py | 41 +- lib/portage/package/ebuild/fetch.py | 148 ++++-- lib/portage/package/ebuild/prepare_build_dirs.py | 21 +- lib/portage/process.py | 29 +- lib/portage/tests/dbapi/test_auxdb.py | 77 +++ lib/portage/tests/dep/test_soname_atom_pickle.py | 26 + lib/portage/tests/ebuild/test_doebuild_spawn.py | 4 +- lib/portage/tests/emerge/test_simple.py | 69 ++- lib/portage/tests/locks/test_lock_nonblock.py | 16 +- lib/portage/tests/resolver/ResolverPlayground.py | 99 ++-- .../tests/resolver/test_circular_choices.py | 44 +- lib/portage/tests/resolver/test_depth.py | 18 +- lib/portage/tests/resolver/test_multirepo.py | 8 +- lib/portage/tests/resolver/test_or_choices.py | 572 +++++++++++++++++++-- .../tests/resolver/test_or_upgrade_installed.py | 70 +++ .../resolver/test_slot_operator_reverse_deps.py | 93 +++- .../tests/util/futures/test_compat_coroutine.py | 29 +- .../util/futures/test_done_callback_after_exit.py | 44 ++ lib/portage/util/__init__.py | 8 - lib/portage/util/_async/AsyncFunction.py | 5 +- lib/portage/util/_async/FileDigester.py | 5 +- lib/portage/util/_desktop_entry.py | 8 - lib/portage/util/_dyn_libs/LinkageMapELF.py | 84 ++- lib/portage/util/_dyn_libs/NeededEntry.py | 5 + lib/portage/util/_dyn_libs/soname_deps_qa.py | 98 ++++ lib/portage/util/_eventloop/asyncio_event_loop.py | 31 +- lib/portage/util/compression_probe.py | 10 +- lib/portage/util/futures/_asyncio/__init__.py | 8 +- lib/portage/util/futures/compat_coroutine.py | 19 +- lib/portage/xml/metadata.py | 22 +- lib/portage/xpak.py | 5 +- man/emerge.1 | 6 +- man/make.conf.5 | 8 +- repoman/RELEASE-NOTES | 11 + repoman/cnf/linechecks/linechecks.yaml | 1 - repoman/cnf/repository/repository.yaml | 1 - repoman/lib/repoman/_subprocess.py | 18 - repoman/lib/repoman/gpg.py | 9 - repoman/lib/repoman/metadata.py | 51 +- .../modules/linechecks/deprecated/inherit.py | 5 + .../modules/linechecks/workaround/__init__.py | 6 - .../modules/linechecks/workaround/workarounds.py | 7 - repoman/lib/repoman/modules/vcs/git/changes.py | 22 +- repoman/runtests | 8 +- repoman/setup.py | 2 +- runtests | 8 +- setup.py | 37 +- tox.ini | 4 +- 97 files changed, 2391 insertions(+), 665 deletions(-) diff --cc bin/ebuild-helpers/dosym index da15fe397,abd4da4f0..681e198c5 --- a/bin/ebuild-helpers/dosym +++ b/bin/ebuild-helpers/dosym @@@ -1,5 -1,5 +1,5 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2018 Gentoo Foundation + # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1 diff --cc bin/isolated-functions.sh index efc377575,fde684013..7840d6012 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@@ -1,5 -1,5 +1,5 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2019 Gentoo Authors + # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1 diff --cc bin/phase-helpers.sh index d0ab03712,9495465f9..c4ab51d78 --- a/bin/phase-helpers.sh +++ b/bin/phase-helpers.sh @@@ -1,5 -1,5 +1,5 @@@ -#!/bin/bash +#!@PORTAGE_BASH@ - # Copyright 1999-2019 Gentoo Authors + # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 if ___eapi_has_DESTTREE_INSDESTTREE; then diff --cc cnf/make.globals index 25678ee82,dd3f28f70..d3ba98513 --- a/cnf/make.globals +++ b/cnf/make.globals @@@ -27,13 -27,17 +27,17 @@@ ACCEPT_PROPERTIES="* ACCEPT_RESTRICT="*" # Miscellaneous paths -DISTDIR="/var/cache/distfiles" -PKGDIR="/var/cache/binpkgs" -RPMDIR="/var/cache/rpm" +DISTDIR="@PORTAGE_EPREFIX@/var/cache/distfiles" +PKGDIR="@PORTAGE_EPREFIX@/var/cache/binpkgs" +RPMDIR="@PORTAGE_EPREFIX@/var/cache/rpm" # Temporary build directory -PORTAGE_TMPDIR="/var/tmp" +PORTAGE_TMPDIR="@PORTAGE_EPREFIX@/var/tmp" + # The compression used for binary packages. Defaults to zstd except for + # existing installs where bzip2 is used for backward compatibility. + BINPKG_COMPRESS="zstd" + # Fetching command (3 tries, passive ftp for firewall compatibility) FETCHCOMMAND="wget -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" RESUMECOMMAND="wget -c -t 3 -T 60 --passive-ftp -O \"\${DISTDIR}/\${FILE}\" \"\${URI}\"" diff --cc lib/portage/package/ebuild/_config/special_env_vars.py index c8131f5b2,440dd00b2..12d701c9a --- a/lib/portage/package/ebuild/_config/special_env_vars.py +++ b/lib/portage/package/ebuild/_config/special_env_vars.py @@@ -78,12 -78,9 +78,12 @@@ environ_whitelist += "PORTAGE_VERBOSE", "PORTAGE_WORKDIR_MODE", "PORTAGE_XATTR_EXCLUDE", "PORTDIR", "PORTDIR_OVERLAY", "PREROOTPATH", "PYTHONDONTWRITEBYTECODE", "REPLACING_VERSIONS", "REPLACED_BY_VERSION", - "ROOT", "ROOTPATH", "SYSROOT", "T", "TMP", "TMPDIR", + "ROOT", "ROOTPATH", "SANDBOX_LOG", "SYSROOT", "T", "TMP", "TMPDIR", "USE_EXPAND", "USE_ORDER", "WORKDIR", "XARGS", "__PORTAGE_TEST_HARDLINK_LOCKS", + # PREFIX LOCAL + "EXTRA_PATH", "PORTAGE_GROUP", "PORTAGE_USER", + # END PREFIX LOCAL ] # user config variables diff --cc lib/portage/package/ebuild/fetch.py index 5f6c40146,9682fea89..11b13fe56 --- a/lib/portage/package/ebuild/fetch.py +++ b/lib/portage/package/ebuild/fetch.py @@@ -46,8 -51,7 +51,8 @@@ from portage.checksum import (get_valid checksum_str) from portage.const import BASH_BINARY, CUSTOM_MIRRORS_FILE, \ GLOBAL_CONFIG_PATH +from portage.const import rootgid - from portage.data import portage_gid, portage_uid, secpass, userpriv_groups + from portage.data import portage_gid, portage_uid, userpriv_groups from portage.exception import FileNotFound, OperationNotPermitted, \ PortageException, TryAgain from portage.localization import _ @@@ -153,6 -188,59 +189,59 @@@ def _userpriv_test_write_file(settings _userpriv_test_write_file_cache[file_path] = rval return rval + + def _ensure_distdir(settings, distdir): + """ + Ensure that DISTDIR exists with appropriate permissions. + + @param settings: portage config + @type settings: portage.package.ebuild.config.config + @param distdir: DISTDIR path + @type distdir: str + @raise PortageException: portage.exception wrapper exception + """ + global _userpriv_test_write_file_cache + dirmode = 0o070 + filemode = 0o60 + modemask = 0o2 + dir_gid = portage_gid + if "FAKED_MODE" in settings: + # When inside fakeroot, directories with portage's gid appear + # to have root's gid. Therefore, use root's gid instead of + # portage's gid to avoid spurrious permissions adjustments + # when inside fakeroot. - dir_gid = 0 ++ dir_gid = rootgid + + userfetch = portage.data.secpass >= 2 and "userfetch" in settings.features + userpriv = portage.data.secpass >= 2 and "userpriv" in settings.features + write_test_file = os.path.join(distdir, ".__portage_test_write__") + + try: + st = os.stat(distdir) + except OSError: + st = None + + if st is not None and stat.S_ISDIR(st.st_mode): + if not (userfetch or userpriv): + return + if _userpriv_test_write_file(settings, write_test_file): + return + + _userpriv_test_write_file_cache.pop(write_test_file, None) + if ensure_dirs(distdir, gid=dir_gid, mode=dirmode, mask=modemask): + if st is None: + # The directory has just been created + # and therefore it must be empty. + return + writemsg(_("Adjusting permissions recursively: '%s'\n") % distdir, + noiselevel=-1) + if not apply_recursive_permissions(distdir, + gid=dir_gid, dirmode=dirmode, dirmask=modemask, + filemode=filemode, filemask=modemask, onerror=_raise_exc): + raise OperationNotPermitted( + _("Failed to apply recursive permissions for the portage group.")) + + def _checksum_failure_temp_file(settings, distdir, basename): """ First try to find a duplicate temp file with the same checksum and return diff --cc man/make.conf.5 index 683ce26c2,a3bd662ae..ab00cb7d7 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@@ -610,11 -607,12 +610,15 @@@ If \fIcollision\-protect\fR is enabled Output a verbose trace of python execution to stderr when a command's \-\-debug option is enabled. .TP + .B qa\-unresolved\-soname\-deps + Trigger a QA warning when a package installs files with unresolved soname + dependencies. + .TP .B sandbox Enable sandbox\-ing when running \fBemerge\fR(1) and \fBebuild\fR(1). +On Mac OS X platforms that have /usr/bin/sandbox-exec available (10.5 +and later), this particular sandbox implementation is used instead of +sys-apps/sandbox. .TP .B sesandbox Enable SELinux sandbox\-ing. Do not toggle this \fBFEATURE\fR yourself.