mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-18 10:27:00 +02:00
sys-apps/portage: Apply Flatcar modifications and document them
This commit is contained in:
parent
6314d75a5f
commit
ba5929ebbc
11
sdk_container/src/third_party/coreos-overlay/sys-apps/portage/README.md
vendored
Normal file
11
sdk_container/src/third_party/coreos-overlay/sys-apps/portage/README.md
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
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.
|
||||
|
||||
- Remove mentions of python version we haven't yet packaged.
|
||||
|
||||
- Disable rsync_verify USE flag to avoid pulling more dependencies.
|
||||
|
||||
- Overwrite the `cnf/repos.conf` file, so we do not use the gentoo
|
||||
repo.
|
@ -0,0 +1,52 @@
|
||||
From eeb6911796e6d602cb12c91901fb4ab1f37dca65 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Crawford <alex.crawford@coreos.com>
|
||||
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
|
||||
|
@ -0,0 +1,38 @@
|
||||
From 9e7ba8e73d8e043a91d215af4b4fcdb8e37921f5 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Marineau <mike@marineau.org>
|
||||
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
|
||||
|
@ -0,0 +1,35 @@
|
||||
From 91f1cc6fa46e149094a7021f43b10bd13d39b7d9 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Marineau <mike@marineau.org>
|
||||
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
|
||||
|
@ -1,10 +1,14 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# Flatcar: Based on portage-3.0.8.ebuild from commit
|
||||
# be7749525a3958edbcecee314d0e1c294222f87f in Gentoo repo (see
|
||||
# https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-apps/portage/portage-3.0.8.ebuild?id=be7749525a3958edbcecee314d0e1c294222f87f).
|
||||
|
||||
EAPI=7
|
||||
|
||||
DISTUTILS_USE_SETUPTOOLS=no
|
||||
PYTHON_COMPAT=( pypy3 python3_{6..9} )
|
||||
PYTHON_COMPAT=( pypy3 python3_{6..7} )
|
||||
PYTHON_REQ_USE='bzip2(+),threads(+)'
|
||||
|
||||
inherit distutils-r1 linux-info tmpfiles prefix
|
||||
@ -15,7 +19,7 @@ HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
|
||||
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="test? ( dev-vcs/git )"
|
||||
@ -84,6 +88,12 @@ TARBALL_PV=${PV}
|
||||
SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
|
||||
$(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)"
|
||||
|
||||
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"
|
||||
|
||||
@ -93,6 +103,8 @@ pkg_pretend() {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user