Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-apps/portage/
Date: Sat, 26 Sep 2020 11:37:27
Message-Id: 1601120222.5c9f39cb53279acde0d96b29df31d2dba55f1643.grobian@gentoo
1 commit: 5c9f39cb53279acde0d96b29df31d2dba55f1643
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 26 11:37:02 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 26 11:37:02 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=5c9f39cb
7
8 sys-apps/portage-3.0.8: version bump
9
10 Package-Manager: Portage-3.0.8-prefix, Repoman-2.3.23
11 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
12
13 sys-apps/portage/Manifest | 1 +
14 sys-apps/portage/portage-3.0.8.ebuild | 299 ++++++++++++++++++++++++++++++++++
15 2 files changed, 300 insertions(+)
16
17 diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
18 index 40b9f12b82..7c17104cbe 100644
19 --- a/sys-apps/portage/Manifest
20 +++ b/sys-apps/portage/Manifest
21 @@ -1,2 +1,3 @@
22 DIST prefix-portage-2.3.100.tar.bz2 1331695 BLAKE2B 165f113041da8ad1150cc59d25a420effaa163a7694ba8ff36ce1e5fa75669b8fde31ad74594b28b987f9ec5685b9a31aa5228419afd476726ba17ec8f7575db SHA512 8163bfd4e83e48d560dd07150dd468d3b4a63d1507d23226107479bd5de9da3cd94308851b64c63851572288877cb2774f986f8c1a5163521a341ce4c72fbf0c
23 DIST prefix-portage-3.0.1.tar.bz2 1279330 BLAKE2B ac94a2c2b56f23cf35cb229ae8719077e41fe7fb8e74d16beb3542b43d246d6c26dce73b9cec4c126b65b9bf0b4452bc233a83aeb4c873e8dd7c8d5742008221 SHA512 5c141b80e20f11aad6990e5f42fcc2cddb6475e03fc978fd1446773dd6833dd4ccf96b07440e1184cb95e210654218011b383872004907a915164813da22663c
24 +DIST prefix-portage-3.0.8.tar.bz2 1360204 BLAKE2B b4d3046e4a2ac7ae611a54b1a669d3d13b337aa29a9adb540f6da5104b47ca8d41798cc268bc4ab464f553bb280173a598127b5b290871ba0bf57f2fbd15bf58 SHA512 fb532b4145952f9467e1a86349e753e80d20b8b35d17d2d99ede590ff5aa6d367f16be41f2335738ed01c82238e2f93179e9b35d588ad92859f4b1f135539a00
25
26 diff --git a/sys-apps/portage/portage-3.0.8.ebuild b/sys-apps/portage/portage-3.0.8.ebuild
27 new file mode 100644
28 index 0000000000..cf3cc74f4b
29 --- /dev/null
30 +++ b/sys-apps/portage/portage-3.0.8.ebuild
31 @@ -0,0 +1,299 @@
32 +# Copyright 1999-2020 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +DISTUTILS_USE_SETUPTOOLS=no
38 +PYTHON_COMPAT=( pypy3 python3_{6..9} )
39 +PYTHON_REQ_USE='bzip2(+),threads(+)'
40 +
41 +inherit distutils-r1 linux-info systemd prefix
42 +
43 +DESCRIPTION="Portage package manager used in Gentoo Prefix"
44 +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
45 +
46 +LICENSE="GPL-2"
47 +KEYWORDS="~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
48 +SLOT="0"
49 +IUSE="apidoc build doc gentoo-dev +ipc +native-extensions rsync-verify selinux xattr"
50 +
51 +DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
52 + >=app-arch/tar-1.27
53 + dev-lang/python-exec:2
54 + >=sys-apps/sed-4.0.5 sys-devel/patch
55 + doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
56 + apidoc? (
57 + dev-python/sphinx
58 + dev-python/sphinx-epytext
59 + )"
60 +# Require sandbox-2.2 for bug #288863.
61 +# For whirlpool hash, require python[ssl] (bug #425046).
62 +# For compgen, require bash[readline] (bug #445576).
63 +# app-portage/gemato goes without PYTHON_USEDEP since we're calling
64 +# the executable.
65 +RDEPEND="
66 + app-arch/zstd
67 + >=app-arch/tar-1.27
68 + dev-lang/python-exec:2
69 + !build? (
70 + >=sys-apps/sed-4.0.5
71 + app-shells/bash:0[readline]
72 + >=app-admin/eselect-1.2
73 + rsync-verify? (
74 + >=app-portage/gemato-14[${PYTHON_USEDEP}]
75 + >=app-crypt/openpgp-keys-gentoo-release-20180706
76 + >=app-crypt/gnupg-2.2.4-r2[ssl(-)]
77 + )
78 + )
79 + elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
80 + elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
81 + elibc_uclibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
82 + kernel_linux? ( >=app-misc/pax-utils-0.1.17 )
83 + kernel_SunOS? ( >=app-misc/pax-utils-0.1.17 )
84 + kernel_FreeBSD? ( >=app-misc/pax-utils-0.1.17 )
85 + kernel_Darwin? ( >=app-misc/pax-utils-0.1.18 )
86 + kernel_AIX? ( >=sys-apps/aix-miscutils-0.1.1634 )
87 + selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
88 + xattr? ( kernel_linux? (
89 + >=sys-apps/install-xattr-0.3
90 + ) )
91 + !<app-admin/logrotate-3.8.0
92 + !<app-portage/gentoolkit-0.4.6
93 + !<app-portage/repoman-2.3.10"
94 +PDEPEND="
95 + !build? (
96 + >=net-misc/rsync-2.6.4
97 + userland_GNU? ( >=sys-apps/coreutils-6.4 )
98 + )"
99 +# coreutils-6.4 rdep is for date format in emerge-webrsync #164532
100 +# NOTE: FEATURES=installsources requires debugedit and rsync
101 +
102 +SRC_ARCHIVES="https://dev.gentoo.org/~zmedico/portage/archives https://dev.gentoo.org/~grobian/distfiles"
103 +
104 +prefix_src_archives() {
105 + local x y
106 + for x in ${@}; do
107 + for y in ${SRC_ARCHIVES}; do
108 + echo ${y}/${x}
109 + done
110 + done
111 +}
112 +
113 +TARBALL_PV=${PV}
114 +SRC_URI="mirror://gentoo/prefix-${PN}-${TARBALL_PV}.tar.bz2
115 + $(prefix_src_archives prefix-${PN}-${TARBALL_PV}.tar.bz2)"
116 +
117 +S="${WORKDIR}"/prefix-${PN}-${TARBALL_PV}
118 +
119 +pkg_pretend() {
120 + local CONFIG_CHECK="~IPC_NS ~PID_NS ~NET_NS ~UTS_NS"
121 +
122 + check_extra_config
123 +}
124 +
125 +python_prepare_all() {
126 + distutils-r1_python_prepare_all
127 +
128 + eapply "${FILESDIR}"/${PN}-2.3.62-prefix-stack.patch # 658572
129 + eapply "${FILESDIR}"/${PN}-2.3.45-ebuildshell.patch # 155161
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} strict-keepdir"' \
138 + >> cnf/make.globals || die
139 + fi
140 +
141 + if use native-extensions; 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 + # PREFIX LOCAL: only hack const_autotool
167 + local extrapath="/usr/sbin:/usr/bin:/sbin:/bin"
168 + # ok, we can't rely on PORTAGE_ROOT_USER being there yet, as people
169 + # tend not to update that often, as long as we are a separate ebuild
170 + # we can assume when unset, it's time for some older trick
171 + if [[ -z ${PORTAGE_ROOT_USER} ]] ; then
172 + PORTAGE_ROOT_USER=$(python -c 'from portage.const import rootuser; print rootuser')
173 + fi
174 + # We need to probe for bash in the Prefix, because it may not
175 + # exist, in which case we fall back to the currently in use
176 + # bash. This logic is necessary in particular during bootstrap,
177 + # where we pull ourselves out of a temporary place with tools
178 + local bash="${EPREFIX}/bin/bash"
179 + [[ ! -x ${bash} ]] && bash=${BASH}
180 +
181 + einfo "Adjusting sources for ${EPREFIX}"
182 + find . -type f -exec \
183 + sed -e "s|@PORTAGE_EPREFIX@|${EPREFIX}|" \
184 + -e "s|@PORTAGE_MV@|$(type -P mv)|" \
185 + -e "s|@PORTAGE_BASH@|${bash}|" \
186 + -e "s|@PREFIX_PORTAGE_PYTHON@|$(type -P python)|" \
187 + -e "s|@EXTRA_PATH@|${extrapath}|" \
188 + -e "s|@portagegroup@|${PORTAGE_GROUP:-portage}|" \
189 + -e "s|@portageuser@|${PORTAGE_USER:-portage}|" \
190 + -e "s|@rootuser@|${PORTAGE_ROOT_USER:-root}|" \
191 + -e "s|@rootuid@|$(id -u ${PORTAGE_ROOT_USER:-root})|" \
192 + -e "s|@rootgid@|$(id -g ${PORTAGE_ROOT_USER:-root})|" \
193 + -e "s|@sysconfdir@|${EPREFIX}/etc|" \
194 + -i '{}' + || \
195 + die "Failed to patch sources"
196 + # We don't need the below, since setup.py deals with this (and
197 + # more) so we don't have to make this correct
198 + # -e "s|@PORTAGE_BASE@|${EPREFIX}/usr/lib/portage/${EPYTHON}|" \
199 +
200 + # remove Makefiles, or else they will get installed
201 + find . -name "Makefile.*" -delete
202 +
203 + einfo "Prefixing shebangs ..."
204 + while read -r -d $'\0' ; do
205 + local shebang=$(head -n1 "$REPLY")
206 + if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
207 + sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
208 + die "sed failed"
209 + fi
210 + done < <(find . -type f ! -name etc-update -print0)
211 +
212 + einfo "Setting gentoo_prefix as reponame for emerge-webrsync"
213 + sed -i -e 's/repo_name=gentoo/repo_name=gentoo_prefix/' \
214 + bin/emerge-webrsync || die
215 +
216 + einfo "Making absent gemato non-fatal"
217 + sed -i -e '/exitcode = 127/d' \
218 + lib/portage/sync/modules/rsync/rsync.py || die
219 + # END PREFIX LOCAL
220 + fi
221 +
222 + # PREFIX LOCAL: make.conf is written by bootstrap-prefix.sh
223 + if use !prefix ; then
224 + cd "${S}/cnf" || die
225 + if [ -f "make.conf.example.${ARCH}".diff ]; then
226 + patch make.conf.example "make.conf.example.${ARCH}".diff || \
227 + die "Failed to patch make.conf.example"
228 + else
229 + eerror ""
230 + eerror "Portage does not have an arch-specific configuration for this arch."
231 + eerror "Please notify the arch maintainer about this issue. Using generic."
232 + eerror ""
233 + fi
234 + fi
235 +}
236 +
237 +python_compile_all() {
238 + local targets=()
239 + use doc && targets+=( docbook )
240 + use apidoc && targets+=( apidoc )
241 +
242 + if [[ ${targets[@]} ]]; then
243 + esetup.py "${targets[@]}"
244 + fi
245 +}
246 +
247 +python_test() {
248 + esetup.py test
249 +}
250 +
251 +python_install() {
252 + # Install sbin scripts to bindir for python-exec linking
253 + # they will be relocated in pkg_preinst()
254 + distutils-r1_python_install \
255 + --system-prefix="${EPREFIX}/usr" \
256 + --bindir="$(python_get_scriptdir)" \
257 + --docdir="${EPREFIX}/usr/share/doc/${PF}" \
258 + --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
259 + --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
260 + --sbindir="$(python_get_scriptdir)" \
261 + --sysconfdir="${EPREFIX}/etc" \
262 + "${@}"
263 +}
264 +
265 +python_install_all() {
266 + distutils-r1_python_install_all
267 +
268 + local targets=()
269 + use doc && targets+=(
270 + install_docbook
271 + --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
272 + )
273 + use apidoc && targets+=(
274 + install_apidoc
275 + --htmldir="${EPREFIX}/usr/share/doc/${PF}/html"
276 + )
277 +
278 + # install docs
279 + if [[ ${targets[@]} ]]; then
280 + esetup.py "${targets[@]}"
281 + fi
282 +
283 + systemd_dotmpfilesd "${FILESDIR}"/portage-ccache.conf
284 +
285 + # Due to distutils/python-exec limitations
286 + # these must be installed to /usr/bin.
287 + local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
288 + einfo "Moving admin scripts to the correct directory"
289 + dodir /usr/sbin
290 + for target in ${sbin_relocations}; do
291 + einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
292 + mv "${ED}/usr/bin/${target}" "${ED}/usr/sbin/${target}" || die "sbin scripts move failed!"
293 + done
294 +}
295 +
296 +pkg_preinst() {
297 + python_setup
298 + local sitedir=$(python_get_sitedir)
299 + [[ -d ${D}${sitedir} ]] || die "${D}${sitedir}: No such directory"
300 + env -u DISTDIR \
301 + -u PORTAGE_OVERRIDE_EPREFIX \
302 + -u PORTAGE_REPOSITORIES \
303 + -u PORTDIR \
304 + -u PORTDIR_OVERLAY \
305 + PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
306 + "${PYTHON}" -m portage._compat_upgrade.default_locations || die
307 +
308 + env -u BINPKG_COMPRESS \
309 + PYTHONPATH="${D}${sitedir}${PYTHONPATH:+:${PYTHONPATH}}" \
310 + "${PYTHON}" -m portage._compat_upgrade.binpkg_compression || die
311 +
312 + # elog dir must exist to avoid logrotate error for bug #415911.
313 + # This code runs in preinst in order to bypass the mapping of
314 + # portage:portage to root:root which happens after src_install.
315 + keepdir /var/log/portage/elog
316 + # This is allowed to fail if the user/group are invalid for prefix users.
317 + if chown ${PORTAGE_USER}:${PORTAGE_GROUP} "${ED}"/var/log/portage{,/elog} 2>/dev/null ; then
318 + chmod g+s,ug+rwx "${ED}"/var/log/portage{,/elog}
319 + fi
320 +
321 + if has_version "<${CATEGORY}/${PN}-2.3.77"; then
322 + elog "The emerge --autounmask option is now disabled by default, except for"
323 + elog "portions of behavior which are controlled by the --autounmask-use and"
324 + elog "--autounmask-license options. For backward compatibility, previous"
325 + elog "behavior of --autounmask=y and --autounmask=n is entirely preserved."
326 + elog "Users can get the old behavior simply by adding --autounmask to the"
327 + elog "make.conf EMERGE_DEFAULT_OPTS variable. For the rationale for this"
328 + elog "change, see https://bugs.gentoo.org/658648."
329 + fi
330 +}