sys-apps/portage: update to 3.0.28-r1 for EAPI 8

To be able to support EAPI 8 used by a few ebuilds nowadays, we need to
update sys-apps/portage to 3.0.28-r1. Simply sync with Gentoo.
This commit is contained in:
Dongsu Park 2021-12-14 15:20:27 +01:00
parent 46f9a0bdda
commit c9017c62b8
7 changed files with 38 additions and 184 deletions

View File

@ -1,4 +1,2 @@
DIST portage-2.3.89-bug-718578.patch 1325 BLAKE2B 7a3bc520274617736eac2e3d078e90d151bdb5d8615f6217a499c0f5d4c80813f2c753e7902cf34482df0725ad0b43a38707764c8be14aae9f7ca34f0bd8721f SHA512 6f1c5d7b42beb8078c45cccbad2bd65374b69af92521d9be3beb6784477ca5bcdd75d8e762b239e44e3121e6fe5e3a040c92c9b61521e4a9b1d6bafee10d4c88
DIST portage-2.3.99.tar.bz2 1051210 BLAKE2B dd3f990dbc87e655a767ce01e1ee3f0b1d5226fa818949408e54b81a2f96e50a4215a79af42b00dc795792858c4f86453b238b14baef4f0793c937b5617534b8 SHA512 176842318a4134ce54c5aa6485fef296f5a14edd2a72421c2011973a0f1a6af39bc5398f1e9eb3b8666d5fc307589c5b91ab93c219bdedb2d307357d8ddefbf5
DIST portage-3.0.4.tar.bz2 1042654 BLAKE2B 6f869b2eb24f9e590bf8e01172050105a1bd9ea88657db5893133b4620231a0ddcda871d6fcc10623f7f2ef809116310c76355263819be6c3734b0ca184d5fc0 SHA512 7a0c39cd4ed65aebd84ff8bbadba29760b3aa392a0d606c5b29a1112fd0845c42f74eebb0728a069b2b097a6eb7eec2d18af615fd9edcc38f1018ae6ff686812
DIST portage-3.0.8.tar.bz2 1046968 BLAKE2B 662147c37a9e7b81030fadb4d6438b734ee57a9eb9bfcee80991d137a017aa3541565961282ebf8736db71aeb05532ffa139ff3a34a84bc9064cf74427acb666 SHA512 5f97870a11ecca30ffe8f463f87cd16a1edb52b44832c6eaba15cadcfde2b4f7edf963749e45c8043b45b38e53ee210dc913aa2d2432a2bd3928cc27c8765a85
DIST portage-3.0.28-setuptools-install-depr.patch 1191 BLAKE2B 1601b8943be27fbebea8bfc5e927e9ba6c5e18b6b76a89f8b2b8525595f4693fe014d0bfd936b513a5d03524aba64797ef1bb1e85b0965426a6f36b6c9e9e07c SHA512 bb06c3f705e4a3e6fcc170fe36aa522184c573ef6e05dea3678ff9158472722d1b68fc480b89f4656786e024be6c5f6f656c386aeda467744bf8e9acdb6ffef5
DIST portage-3.0.28.tar.bz2 1153994 BLAKE2B 8d9e3af04acd9bb5fdb3cff5b928abbf707db13f6c25afdac4399ea47adb67b2621ebb733927b4f9386e3f285fa7daac0423ae3fb0509a9df747b41c82865313 SHA512 148484b0384672116f2f2187eaddb56f646548324cd5f6c8e187a02bc965fb2bea6632214aed9b40c615acb89eb6124ab831ad85c59bac9a416b02a07506669b

View File

@ -1,11 +0,0 @@
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.

View File

@ -1,52 +0,0 @@
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

View File

@ -1,38 +0,0 @@
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

View File

@ -1,35 +0,0 @@
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

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<upstream>
<bugs-to>mailto:dev-portage@gentoo.org</bugs-to>

View File

@ -1,36 +1,38 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 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..10} )
PYTHON_COMPAT=( pypy3 python3_{8..10} )
PYTHON_REQ_USE='bzip2(+),threads(+)'
TMPFILES_OPTIONAL=1
inherit distutils-r1 linux-info tmpfiles prefix
DESCRIPTION="Portage is the package management and distribution system for Gentoo"
DESCRIPTION="The package management and distribution system for Gentoo"
HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
SRC_URI="
https://gitweb.gentoo.org/proj/portage.git/snapshot/${P}.tar.bz2
https://gitweb.gentoo.org/proj/portage.git/patch/?id=c309328c4e1f6254251d31149ee47b4266d4d70f
-> ${P}-setuptools-install-depr.patch"
LICENSE="GPL-2"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86"
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 )"
BDEPEND="
app-arch/xz-utils
test? ( dev-vcs/git )"
DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
>=app-arch/tar-1.27
dev-lang/python-exec:2
>=sys-apps/sed-4.0.5 sys-devel/patch
doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
apidoc? (
dev-python/sphinx
dev-python/sphinx-epytext
dev-python/sphinx[${PYTHON_USEDEP}]
dev-python/sphinx-epytext[${PYTHON_USEDEP}]
)"
# Require sandbox-2.2 for bug #288863.
# For whirlpool hash, require python[ssl] (bug #425046).
@ -38,13 +40,14 @@ DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
# app-portage/gemato goes without PYTHON_USEDEP since we're calling
# the executable.
RDEPEND="
acct-user/portage
app-arch/zstd
>=app-arch/tar-1.27
dev-lang/python-exec:2
>=sys-apps/findutils-4.4
!build? (
>=sys-apps/sed-4.0.5
app-shells/bash:0[readline]
>=app-shells/bash-5.0:0[readline]
>=app-admin/eselect-1.2
rsync-verify? (
>=app-portage/gemato-14.5[${PYTHON_USEDEP}]
@ -73,27 +76,6 @@ PDEPEND="
# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
# NOTE: FEATURES=installsources requires debugedit and rsync
SRC_ARCHIVES="https://dev.gentoo.org/~zmedico/portage/archives"
prefix_src_archives() {
local x y
for x in ${@}; do
for y in ${SRC_ARCHIVES}; do
echo ${y}/${x}
done
done
}
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"
@ -101,9 +83,11 @@ pkg_pretend() {
}
python_prepare_all() {
distutils-r1_python_prepare_all
local PATCHES=(
"${DISTDIR}"/${P}-setuptools-install-depr.patch
)
echo "# no defaults, configuration is in /etc" > cnf/repos.conf
distutils-r1_python_prepare_all
sed -e "s:^VERSION = \"HEAD\"$:VERSION = \"${PV}\":" -i lib/portage/__init__.py || die
@ -114,12 +98,12 @@ python_prepare_all() {
die "failed to patch create_depgraph_params.py"
einfo "Enabling additional FEATURES for gentoo-dev..."
echo 'FEATURES="${FEATURES} strict-keepdir"' \
echo 'FEATURES="${FEATURES} ipc-sandbox network-sandbox strict-keepdir"' \
>> cnf/make.globals || die
fi
if use native-extensions; then
printf "[build_ext]\nportage-ext-modules=true\n" >> \
printf "[build_ext]\nportage_ext_modules=true\n" >> \
setup.cfg || die
fi
@ -148,13 +132,17 @@ python_prepare_all() {
-w "/_BINARY/" lib/portage/const.py
einfo "Prefixing shebangs ..."
> "${T}/shebangs" || die
while read -r -d $'\0' ; do
local shebang=$(head -n1 "$REPLY")
if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
die "sed failed"
echo "${REPLY}" >> "${T}/shebangs" || die
fi
done < <(find . -type f ! -name etc-update -print0)
done < <(find . -type f -executable ! -name etc-update -print0)
if [[ -s ${T}/shebangs ]]; then
xargs sed -i -e "1s:^#!:#!${EPREFIX}:" < "${T}/shebangs" || die "sed failed"
fi
einfo "Adjusting make.globals, repos.conf and etc-update ..."
hprefixify cnf/{make.globals,repos.conf} bin/etc-update
@ -254,10 +242,14 @@ pkg_preinst() {
PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
"${PYTHON}" -m portage._compat_upgrade.default_locations || die
env -u BINPKG_COMPRESS \
env -u BINPKG_COMPRESS -u PORTAGE_REPOSITORIES \
PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
"${PYTHON}" -m portage._compat_upgrade.binpkg_compression || die
env -u FEATURES -u PORTAGE_REPOSITORIES \
PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
"${PYTHON}" -m portage._compat_upgrade.binpkg_multi_instance || die
# elog dir must exist to avoid logrotate error for bug #415911.
# This code runs in preinst in order to bypass the mapping of
# portage:portage to root:root which happens after src_install.