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: Fri, 16 Apr 2021 13:13:14
Message-Id: 1618578776.df5404d501c3630c8a71f79f1841275ed63f1e23.grobian@gentoo
1 commit: df5404d501c3630c8a71f79f1841275ed63f1e23
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 16 13:12:56 2021 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 16 13:12:56 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=df5404d5
7
8 sys-apps/portage-3.0.18: version bump
9
10 Package-Manager: Portage-3.0.18-prefix, Repoman-3.0.2
11 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
12
13 sys-apps/portage/Manifest | 1 +
14 sys-apps/portage/portage-3.0.18.ebuild | 298 +++++++++++++++++++++++++++++++++
15 2 files changed, 299 insertions(+)
16
17 diff --git a/sys-apps/portage/Manifest b/sys-apps/portage/Manifest
18 index 2bcf934896..51c88c4215 100644
19 --- a/sys-apps/portage/Manifest
20 +++ b/sys-apps/portage/Manifest
21 @@ -1,3 +1,4 @@
22 DIST prefix-portage-3.0.12.0.2.tar.bz2 1321851 BLAKE2B 80e8596531800d690083bddc8363f74d295839d70c6f86da0b5c385260836e593136e5baa5bd07d745e8eb82c894d0c97441aa2a0eb28bab8f1b83876a9aa3e5 SHA512 7dc1167058eb9aec756b59479a055c85037f4a7924a7a2dccbaf405a5d8464e04aef8796b02c8b7402e1f3446676d4d94789a170ef6b7e597c09a9600c2d2dae
23 DIST prefix-portage-3.0.12.tar.bz2 1309809 BLAKE2B 04b037b7d2d5077845f7d37d8dcedc03758191804d2dd44af4d87b5bbd94c8108ea673f9e06fce45342a5f8c26890bf2aa2dd482103fecb774cb14e314351d4c SHA512 8fc179f571c6094b12fabca5e371e7d91d86d2799d282bc4ce2acf096950b18462a0c8dc766e7f4dc29ebba5f188c66375573f8539f8d1d0b1edf385a1d4078e
24 DIST prefix-portage-3.0.14.tar.bz2 1314909 BLAKE2B 5e5e0390466e5073795fece5d75800e7181f691d9fb81affdf5eb291b72a917a51976a83b9df5db6f5069a567c4c96e94e4ddb485cbff8b6827d281770006f2a SHA512 a41dee35ae3e5eb1c77801640d6cedd75a706993a38d3260348ad13d570c128101443bc761ef6f207a305c0d03aa45fb8a88c29237e116c426382f2e2fd265e6
25 +DIST prefix-portage-3.0.18.tar.bz2 1348023 BLAKE2B fe0a39611e0a4c2af60f6b73bf56a432193dd859bd3d0a7ab91d5b716b980abe55823c48fa7811bacf152ff9ebfc499792ba37ff94920d3a0d5604536a119d3c SHA512 ca0b78ceda58f225ab5f27e0998d5d9486d9f6609dc94b4471f4b5613fbdb6275c019ff994736cf9d85abb127e207e7065f00aea9f36ad6ebd36c196272cbfb1
26
27 diff --git a/sys-apps/portage/portage-3.0.18.ebuild b/sys-apps/portage/portage-3.0.18.ebuild
28 new file mode 100644
29 index 0000000000..bf3300c246
30 --- /dev/null
31 +++ b/sys-apps/portage/portage-3.0.18.ebuild
32 @@ -0,0 +1,298 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +
38 +DISTUTILS_USE_SETUPTOOLS=no
39 +PYTHON_COMPAT=( pypy3 python3_{7..9} )
40 +PYTHON_REQ_USE='bzip2(+),threads(+)'
41 +
42 +inherit distutils-r1 linux-info systemd prefix
43 +
44 +DESCRIPTION="Portage package manager used in Gentoo Prefix"
45 +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Portage"
46 +
47 +LICENSE="GPL-2"
48 +KEYWORDS="~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
49 +SLOT="0"
50 +IUSE="apidoc build doc gentoo-dev +ipc +native-extensions rsync-verify selinux xattr"
51 +
52 +DEPEND="!build? ( $(python_gen_impl_dep 'ssl(+)') )
53 + >=app-arch/tar-1.27
54 + dev-lang/python-exec:2
55 + >=sys-apps/sed-4.0.5 sys-devel/patch
56 + doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
57 + apidoc? (
58 + dev-python/sphinx
59 + dev-python/sphinx-epytext
60 + )"
61 +# Require sandbox-2.2 for bug #288863.
62 +# For whirlpool hash, require python[ssl] (bug #425046).
63 +# For compgen, require bash[readline] (bug #445576).
64 +# app-portage/gemato goes without PYTHON_USEDEP since we're calling
65 +# the executable.
66 +RDEPEND="
67 + app-arch/zstd
68 + >=app-arch/tar-1.27
69 + dev-lang/python-exec:2
70 + !build? (
71 + >=sys-apps/sed-4.0.5
72 + app-shells/bash:0[readline]
73 + >=app-admin/eselect-1.2
74 + rsync-verify? (
75 + >=app-portage/gemato-14[${PYTHON_USEDEP}]
76 + >=app-crypt/openpgp-keys-gentoo-release-20180706
77 + >=app-crypt/gnupg-2.2.4-r2[ssl(-)]
78 + )
79 + )
80 + elibc_FreeBSD? ( !prefix? ( sys-freebsd/freebsd-bin ) )
81 + elibc_glibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
82 + elibc_uclibc? ( !prefix? ( >=sys-apps/sandbox-2.2 ) )
83 + kernel_linux? ( >=app-misc/pax-utils-0.1.17 )
84 + kernel_SunOS? ( >=app-misc/pax-utils-0.1.17 )
85 + kernel_FreeBSD? ( >=app-misc/pax-utils-0.1.17 )
86 + kernel_Darwin? ( >=app-misc/pax-utils-0.1.18 )
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 +}