Gentoo Archives: gentoo-commits

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