Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/portage/
Date: Sun, 13 Jun 2021 22:09:03
Message-Id: 1623622083.c0f239a182977dcd67e5592dfedc5f07d927ad53.zmedico@gentoo
1 commit: c0f239a182977dcd67e5592dfedc5f07d927ad53
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 13 22:03:39 2021 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 13 22:08:03 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0f239a1
7
8 sys-apps/portage: Bump to version 3.0.20 for final EAPI 8
9
10 #777492: PORTAGE_NICENESS: Consider autogroup scheduling
11 #794166: setup.py: prefer setuptools over distutils
12
13 Bug: https://bugs.gentoo.org/785484
14 Bug: https://bugs.gentoo.org/777492
15 Bug: https://bugs.gentoo.org/794166
16 Package-Manager: Portage-3.0.20, Repoman-3.0.3
17 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
18
19 sys-apps/portage/Manifest | 1 +
20 sys-apps/portage/portage-3.0.20.ebuild | 266 +++++++++++++++++++++++++++++++++
21 2 files changed, 267 insertions(+)
22
23 diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
24 index ce22a29bfee..864fdaba38a 100644
25 --- a/sys-apps/portage/Manifest
26 +++ b/sys-apps/portage/Manifest
27 @@ -4,3 +4,4 @@ DIST portage-3.0.17-bug-775239-_test_lock_fn-tempfile-leak-d8a12c.patch 733 BLAK
28 DIST portage-3.0.17.tar.xz 970076 BLAKE2B 261d8d3b0da5bb77f37328219365a59d7ac56a22e887de59a6b702fcf895493f7a0aac1af744bc67b80c9e2aa730795e507764e9e1c807c247d1ccbe6f825d2f SHA512 6f4a50b005a67e6eea24600d10179fd48b4aa1de4cdf99bc310854dc303248408f8a31bca4135e4e530fcbd2b3d99c2f89644e4e4240e3a754fd97e949403ffc
29 DIST portage-3.0.18.tar.xz 971692 BLAKE2B 0a8d2062fce1bf85a2f1025d17ddd3eafc987fd93c01f17bcc4487b23841e530451502417e24bbe58175b4fee871ceb528696775116a60f93b7b841d14ecf7a3 SHA512 d3f4b5258748fbef7b8ec000685b7e42804123a5c6b474bb6679666c2696a16e3bd202108df6e647770406539ff223bfd0deb1a3b4240e0a7ba1f2ec52aca2cd
30 DIST portage-3.0.19.tar.gz 1347687 BLAKE2B 86eea08c2559b2d5a3eac39d8f7523380769710e7b4e3973463410bc291e746d9a36708e26d9b6456c06f67157fd04385c98ae28e25e48dba510fbaaab2d3536 SHA512 355153839219b93ae5d7c844ac5ed7ada10b2932d4a8e2b8208793fc33dfba3d46abe5ec7ecfbef9f16f23a6b21e57b7b14247f0b1fd85018a07e198bafa209c
31 +DIST portage-3.0.20.tar.gz 1348818 BLAKE2B e8af0662d073110a921ef23865872b0440f5e549da92b828af3dc71010d0f49d98c429c52c90ed683407fcfee7bf17a504082166f2fcad9590d7435dd43dfb83 SHA512 69c1846dedf0cfa3f57b2748cf8e077ead05ab0185e785dfc6310439b8624cdd72449209a807f12f59a5175ba065f8cca1409d43bee6012900b2c8b1e7f9b7e9
32
33 diff --git a/sys-apps/portage/portage-3.0.20.ebuild b/sys-apps/portage/portage-3.0.20.ebuild
34 new file mode 100644
35 index 00000000000..86acdffec83
36 --- /dev/null
37 +++ b/sys-apps/portage/portage-3.0.20.ebuild
38 @@ -0,0 +1,266 @@
39 +# Copyright 1999-2021 Gentoo Authors
40 +# Distributed under the terms of the GNU General Public License v2
41 +
42 +EAPI=7
43 +
44 +DISTUTILS_USE_SETUPTOOLS=bdepend
45 +PYTHON_COMPAT=( pypy3 python3_{7..10} )
46 +PYTHON_REQ_USE='bzip2(+),threads(+)'
47 +TMPFILES_OPTIONAL=1
48 +
49 +inherit distutils-r1 linux-info tmpfiles prefix
50 +
51 +DESCRIPTION="Portage is the package management and distribution system for Gentoo"
52 +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
53 +
54 +LICENSE="GPL-2"
55 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
56 +SLOT="0"
57 +IUSE="apidoc build doc gentoo-dev +ipc +native-extensions +rsync-verify selinux test xattr"
58 +RESTRICT="!test? ( test )"
59 +
60 +BDEPEND="
61 + app-arch/xz-utils
62 + test? ( dev-vcs/git )"
63 +DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
64 + >=app-arch/tar-1.27
65 + dev-lang/python-exec:2
66 + >=sys-apps/sed-4.0.5 sys-devel/patch
67 + doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
68 + apidoc? (
69 + dev-python/sphinx
70 + dev-python/sphinx-epytext
71 + )"
72 +# Require sandbox-2.2 for bug #288863.
73 +# For whirlpool hash, require python[ssl] (bug #425046).
74 +# For compgen, require bash[readline] (bug #445576).
75 +# app-portage/gemato goes without PYTHON_USEDEP since we're calling
76 +# the executable.
77 +RDEPEND="
78 + acct-user/portage
79 + app-arch/zstd
80 + >=app-arch/tar-1.27
81 + dev-lang/python-exec:2
82 + >=sys-apps/findutils-4.4
83 + !build? (
84 + >=sys-apps/sed-4.0.5
85 + app-shells/bash:0[readline]
86 + >=app-admin/eselect-1.2
87 + rsync-verify? (
88 + >=app-portage/gemato-14.5[${PYTHON_USEDEP}]
89 + >=app-crypt/openpgp-keys-gentoo-release-20180706
90 + >=app-crypt/gnupg-2.2.4-r2[ssl(-)]
91 + )
92 + )
93 + elibc_glibc? ( >=sys-apps/sandbox-2.2 )
94 + elibc_musl? ( >=sys-apps/sandbox-2.2 )
95 + elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
96 + kernel_linux? ( sys-apps/util-linux )
97 + >=app-misc/pax-utils-0.1.17
98 + selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
99 + xattr? ( kernel_linux? (
100 + >=sys-apps/install-xattr-0.3
101 + ) )
102 + !<app-admin/logrotate-3.8.0
103 + !<app-portage/gentoolkit-0.4.6
104 + !<app-portage/repoman-2.3.10
105 + !~app-portage/repoman-3.0.0"
106 +PDEPEND="
107 + !build? (
108 + >=net-misc/rsync-2.6.4
109 + userland_GNU? ( >=sys-apps/coreutils-6.4 )
110 + )"
111 +# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
112 +# NOTE: FEATURES=installsources requires debugedit and rsync
113 +
114 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
115 +
116 +pkg_pretend() {
117 + local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS"
118 +
119 + check_extra_config
120 +}
121 +
122 +python_prepare_all() {
123 + distutils-r1_python_prepare_all
124 +
125 + sed -e "s:^VERSION = \"HEAD\"$:VERSION = \"${PV}\":" -i lib/portage/__init__.py || die
126 +
127 + if use gentoo-dev; then
128 + einfo "Disabling --dynamic-deps by default for gentoo-dev..."
129 + sed -e 's:\("--dynamic-deps", \)\("y"\):\1"n":' \
130 + -i lib/_emerge/create_depgraph_params.py || \
131 + die "failed to patch create_depgraph_params.py"
132 +
133 + einfo "Enabling additional FEATURES for gentoo-dev..."
134 + echo 'FEATURES="${FEATURES} strict-keepdir"' \
135 + >> cnf/make.globals || die
136 + fi
137 +
138 + if use native-extensions; then
139 + printf "[build_ext]\nportage-ext-modules=true\n" >> \
140 + setup.cfg || die
141 + fi
142 +
143 + if ! use ipc ; then
144 + einfo "Disabling ipc..."
145 + sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
146 + -i lib/_emerge/AbstractEbuildProcess.py || \
147 + die "failed to patch AbstractEbuildProcess.py"
148 + fi
149 +
150 + if use xattr && use kernel_linux ; then
151 + einfo "Adding FEATURES=xattr to make.globals ..."
152 + echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
153 + || die "failed to append to make.globals"
154 + fi
155 +
156 + if use build || ! use rsync-verify; then
157 + sed -e '/^sync-rsync-verify-metamanifest/s|yes|no|' \
158 + -e '/^sync-webrsync-verify-signature/s|yes|no|' \
159 + -i cnf/repos.conf || die "sed failed"
160 + fi
161 +
162 + if [[ -n ${EPREFIX} ]] ; then
163 + einfo "Setting portage.const.EPREFIX ..."
164 + hprefixify -e "s|^(EPREFIX[[:space:]]*=[[:space:]]*\").*|\1${EPREFIX}\"|" \
165 + -w "/_BINARY/" lib/portage/const.py
166 +
167 + einfo "Prefixing shebangs ..."
168 + > "${T}/shebangs" || die
169 + while read -r -d $'\0' ; do
170 + local shebang=$(head -n1 "$REPLY")
171 + if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
172 + echo "${REPLY}" >> "${T}/shebangs" || die
173 + fi
174 + done < <(find . -type f -executable ! -name etc-update -print0)
175 +
176 + if [[ -s ${T}/shebangs ]]; then
177 + xargs sed -i -e "1s:^#!:#!${EPREFIX}:" < "${T}/shebangs" || die "sed failed"
178 + fi
179 +
180 + einfo "Adjusting make.globals, repos.conf and etc-update ..."
181 + hprefixify cnf/{make.globals,repos.conf} bin/etc-update
182 +
183 + if use prefix-guest ; then
184 + sed -e "s|^\(main-repo = \).*|\\1gentoo_prefix|" \
185 + -e "s|^\\[gentoo\\]|[gentoo_prefix]|" \
186 + -e "s|^\(sync-uri = \).*|\\1rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix|" \
187 + -i cnf/repos.conf || die "sed failed"
188 + fi
189 +
190 + einfo "Adding FEATURES=force-prefix to make.globals ..."
191 + echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
192 + || die "failed to append to make.globals"
193 + fi
194 +
195 + cd "${S}/cnf" || die
196 + if [ -f "make.conf.example.${ARCH}".diff ]; then
197 + patch make.conf.example "make.conf.example.${ARCH}".diff || \
198 + die "Failed to patch make.conf.example"
199 + else
200 + eerror ""
201 + eerror "Portage does not have an arch-specific configuration for this arch."
202 + eerror "Please notify the arch maintainer about this issue. Using generic."
203 + eerror ""
204 + fi
205 +}
206 +
207 +python_compile_all() {
208 + local targets=()
209 + use doc && targets+=( docbook )
210 + use apidoc && targets+=( apidoc )
211 +
212 + if [[ ${targets[@]} ]]; then
213 + esetup.py "${targets[@]}"
214 + fi
215 +}
216 +
217 +python_test() {
218 + esetup.py test
219 +}
220 +
221 +python_install() {
222 + # Install sbin scripts to bindir for python-exec linking
223 + # they will be relocated in pkg_preinst()
224 + distutils-r1_python_install \
225 + --system-prefix="${EPREFIX}/usr" \
226 + --bindir="$(python_get_scriptdir)" \
227 + --docdir="${EPREFIX}/usr/share/doc/${PF}" \
228 + --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
229 + --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
230 + --sbindir="$(python_get_scriptdir)" \
231 + --sysconfdir="${EPREFIX}/etc" \
232 + "${@}"
233 +}
234 +
235 +python_install_all() {
236 + distutils-r1_python_install_all
237 +
238 + local targets=()
239 + use doc && targets+=(
240 + install_docbook
241 + --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
242 + )
243 + use apidoc && targets+=(
244 + install_apidoc
245 + --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
246 + )
247 +
248 + # install docs
249 + if [[ ${targets[@]} ]]; then
250 + esetup.py "${targets[@]}"
251 + fi
252 +
253 + dotmpfiles "${FILESDIR}"/portage-ccache.conf
254 +
255 + # Due to distutils/python-exec limitations
256 + # these must be installed to /usr/bin.
257 + local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
258 + einfo "Moving admin scripts to the correct directory"
259 + dodir /usr/sbin
260 + for target in ${sbin_relocations}; do
261 + einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
262 + mv "${ED}/usr/bin/${target}" "${ED}/usr/sbin/${target}" || die "sbin scripts move failed!"
263 + done
264 +}
265 +
266 +pkg_preinst() {
267 + python_setup
268 + local sitedir=$(python_get_sitedir)
269 + [[ -d ${D}${sitedir} ]] || die "${D}${sitedir}: No such directory"
270 + env -u DISTDIR \
271 + -u PORTAGE_OVERRIDE_EPREFIX \
272 + -u PORTAGE_REPOSITORIES \
273 + -u PORTDIR \
274 + -u PORTDIR_OVERLAY \
275 + PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
276 + "${PYTHON}" -m portage._compat_upgrade.default_locations || die
277 +
278 + env -u BINPKG_COMPRESS -u PORTAGE_REPOSITORIES \
279 + PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
280 + "${PYTHON}" -m portage._compat_upgrade.binpkg_compression || die
281 +
282 + env -u FEATURES -u PORTAGE_REPOSITORIES \
283 + PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
284 + "${PYTHON}" -m portage._compat_upgrade.binpkg_multi_instance || die
285 +
286 + # elog dir must exist to avoid logrotate error for bug #415911.
287 + # This code runs in preinst in order to bypass the mapping of
288 + # portage:portage to root:root which happens after src_install.
289 + keepdir /var/log/portage/elog
290 + # This is allowed to fail if the user/group are invalid for prefix users.
291 + if chown portage:portage "${ED}"/var/log/portage{,/elog} 2>/dev/null ; then
292 + chmod g+s,ug+rwx "${ED}"/var/log/portage{,/elog}
293 + fi
294 +
295 + if has_version "<${CATEGORY}/${PN}-2.3.77"; then
296 + elog "The emerge --autounmask option is now disabled by default, except for"
297 + elog "portions of behavior which are controlled by the --autounmask-use and"
298 + elog "--autounmask-license options. For backward compatibility, previous"
299 + elog "behavior of --autounmask=y and --autounmask=n is entirely preserved."
300 + elog "Users can get the old behavior simply by adding --autounmask to the"
301 + elog "make.conf EMERGE_DEFAULT_OPTS variable. For the rationale for this"
302 + elog "change, see https://bugs.gentoo.org/658648."
303 + fi
304 +}