diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/README.md b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/README.md new file mode 100644 index 0000000000..66fc2ca13e --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/README.md @@ -0,0 +1,9 @@ +This is a fork of Gentoo's sys-apps/portage package. We make the +following changes: + +- Apply some patches that weren't yet merged by upstream. + +- Disable rsync_verify USE flag to avoid pulling more dependencies. + +- Overwrite the `cnf/repos.conf` file, so we do not use the gentoo + repo. diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0001-portage-repository-config.py-add-disabled-attribute-.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0001-portage-repository-config.py-add-disabled-attribute-.patch new file mode 100644 index 0000000000..953dc7163c --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0001-portage-repository-config.py-add-disabled-attribute-.patch @@ -0,0 +1,52 @@ +From eeb6911796e6d602cb12c91901fb4ab1f37dca65 Mon Sep 17 00:00:00 2001 +From: Alex Crawford +Date: Tue, 27 Oct 2020 19:43:48 +0100 +Subject: [PATCH 1/3] portage/repository/config.py: add disabled attribute to + repos.conf + +This flag allows a repos.conf file to disable a previously-defined repository. + +https://bugs.gentoo.org/507284 +--- + lib/portage/repository/config.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py +index f7c956d..28ec102 100644 +--- a/lib/portage/repository/config.py ++++ b/lib/portage/repository/config.py +@@ -77,6 +77,7 @@ class RepoConfig: + 'clone_depth', + 'create_manifest', + 'disable_manifest', ++ 'disabled', + 'eapi', + 'eclass_db', + 'eclass_locations', +@@ -275,6 +276,11 @@ class RepoConfig: + location = None + self.location = location + ++ disabled = repo_opts.get('disabled') ++ if disabled is not None: ++ disabled = disabled.strip().lower() == 'true' ++ self.disabled = disabled or False ++ + missing = True + self.name = name + if self.location is not None: +@@ -754,7 +760,10 @@ class RepoConfigLoader: + # Do this before expanding aliases, so that location_map and + # treemap consistently map unaliased names whenever available. + for repo_name, repo in list(prepos.items()): +- if repo.location is None: ++ if repo.disabled: ++ del prepos[repo_name] ++ continue ++ elif repo.location is None: + if repo_name != 'DEFAULT': + # Skip this warning for repoman (bug #474578). + if settings.local_config and paths: +-- +2.26.2 + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0002-environment-Filter-EROOT-for-all-EAPIs.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0002-environment-Filter-EROOT-for-all-EAPIs.patch new file mode 100644 index 0000000000..37900e1446 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0002-environment-Filter-EROOT-for-all-EAPIs.patch @@ -0,0 +1,38 @@ +From 9e7ba8e73d8e043a91d215af4b4fcdb8e37921f5 Mon Sep 17 00:00:00 2001 +From: Michael Marineau +Date: Tue, 27 Oct 2020 19:47:20 +0100 +Subject: [PATCH 2/3] environment: Filter EROOT for all EAPIs + +This variable is often defined in older EAPIs with "${EROOT:=$ROOT}" +but it should never be preserved since ROOT may change. Bug #490014 + +https://bugs.gentoo.org/490014 +--- + bin/phase-functions.sh | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh +index 90e622e..ec7b18b 100644 +--- a/bin/phase-functions.sh ++++ b/bin/phase-functions.sh +@@ -107,10 +107,14 @@ __filter_readonly_variables() { + if ___eapi_has_BROOT; then + filtered_vars+=" BROOT" + fi +- # Don't filter/interfere with prefix variables unless they are +- # supported by the current EAPI. ++ ++ # Always filter EROOT to ensure it is redefined based on ROOT ++ filtered_vars+=" EROOT" ++ ++ # Don't filter/interfere with the other prefix variables unless ++ # they are supported by the current EAPI. + if ___eapi_has_prefix_variables; then +- filtered_vars+=" ED EPREFIX EROOT" ++ filtered_vars+=" ED EPREFIX" + if ___eapi_has_SYSROOT; then + filtered_vars+=" ESYSROOT" + fi +-- +2.26.2 + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0003-depgraph-ensure-slot-rebuilds-happen-in-the-correct-.patch b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0003-depgraph-ensure-slot-rebuilds-happen-in-the-correct-.patch new file mode 100644 index 0000000000..a50529309d --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/files/0003-depgraph-ensure-slot-rebuilds-happen-in-the-correct-.patch @@ -0,0 +1,35 @@ +From 91f1cc6fa46e149094a7021f43b10bd13d39b7d9 Mon Sep 17 00:00:00 2001 +From: Michael Marineau +Date: Tue, 27 Oct 2020 19:50:07 +0100 +Subject: [PATCH 3/3] depgraph: ensure slot rebuilds happen in the correct root + +https://bugs.gentoo.org/520112 +--- + lib/_emerge/depgraph.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py +index 0bb0352..3d1cdbc 100644 +--- a/lib/_emerge/depgraph.py ++++ b/lib/_emerge/depgraph.py +@@ -4384,13 +4384,13 @@ class depgraph: + a favorite list.""" + debug = "--debug" in self._frozen_config.myopts + onlydeps = "--onlydeps" in self._frozen_config.myopts +- myroot = self._frozen_config.target_root +- pkgsettings = self._frozen_config.pkgsettings[myroot] +- pprovideddict = pkgsettings.pprovideddict +- virtuals = pkgsettings.getvirtuals() + args = self._dynamic_config._initial_arg_list[:] + + for arg in self._expand_set_args(args, add_to_digraph=True): ++ myroot = arg.root_config.root ++ pkgsettings = self._frozen_config.pkgsettings[myroot] ++ pprovideddict = pkgsettings.pprovideddict ++ virtuals = pkgsettings.getvirtuals() + for atom in sorted(arg.pset.getAtoms()): + self._spinner_update() + dep = Dependency(atom=atom, onlydeps=onlydeps, +-- +2.26.2 + diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/portage-3.0.28-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/portage-3.0.28-r1.ebuild index 5142ff74ce..f78e9c9a7c 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/portage-3.0.28-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/portage/portage-3.0.28-r1.ebuild @@ -1,6 +1,10 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 +# Flatcar: Based on portage-3.0.28-r1.ebuild from commit +# dd2855193d31d04b6dc25d7fddf381c6d61c0080 in Gentoo repo (see +# https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-apps/portage/portage-3.0.28-r1.ebuild?id=dd2855193d31d04b6dc25d7fddf381c6d61c0080). + EAPI=7 PYTHON_COMPAT=( pypy3 python3_{8..10} ) @@ -19,7 +23,7 @@ SRC_URI=" LICENSE="GPL-2" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" SLOT="0" -IUSE="apidoc build doc gentoo-dev +ipc +native-extensions +rsync-verify selinux test xattr" +IUSE="apidoc build doc gentoo-dev +ipc +native-extensions rsync-verify selinux test xattr" RESTRICT="!test? ( test )" BDEPEND=" @@ -76,6 +80,12 @@ PDEPEND=" # coreutils-6.4 rdep is for date format in emerge-webrsync #164532 # NOTE: FEATURES=installsources requires debugedit and rsync +PATCHES=( + "${FILESDIR}/0001-portage-repository-config.py-add-disabled-attribute-.patch" + "${FILESDIR}/0002-environment-Filter-EROOT-for-all-EAPIs.patch" + "${FILESDIR}/0003-depgraph-ensure-slot-rebuilds-happen-in-the-correct-.patch" +) + pkg_pretend() { local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS" @@ -89,6 +99,8 @@ python_prepare_all() { distutils-r1_python_prepare_all + echo "# no defaults, configuration is in /etc" > cnf/repos.conf + sed -e "s:^VERSION = \"HEAD\"$:VERSION = \"${PV}\":" -i lib/portage/__init__.py || die if use gentoo-dev; then