Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/portage: portage-2.1.12.2.ebuild ChangeLog portage-2.1.12.ebuild
Date: Fri, 24 May 2013 05:41:58
Message-Id: 20130524054150.039102171D@flycatcher.gentoo.org
1 zmedico 13/05/24 05:41:49
2
3 Modified: ChangeLog
4 Added: portage-2.1.12.2.ebuild
5 Removed: portage-2.1.12.ebuild
6 Log:
7 2.1.12.2 version bump. This fixes bug #470670 (repoman check for deprecated EAPIs) and
8 bug #470916 (handle indirect man page symlinks when compressing).
9 Bug #468524 tracks all bugs fixed since portage-2.1.11.62.
10
11 (Portage version: 2.2.0_alpha177/cvs/Linux i686, signed Manifest commit with key 0xFDE8EF85AE5719A3)
12
13 Revision Changes Path
14 1.1270 sys-apps/portage/ChangeLog
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1270&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1270&content-type=text/plain
18 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?r1=1.1269&r2=1.1270
19
20 Index: ChangeLog
21 ===================================================================
22 RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v
23 retrieving revision 1.1269
24 retrieving revision 1.1270
25 diff -u -r1.1269 -r1.1270
26 --- ChangeLog 19 May 2013 00:14:30 -0000 1.1269
27 +++ ChangeLog 24 May 2013 05:41:49 -0000 1.1270
28 @@ -1,6 +1,14 @@
29 # ChangeLog for sys-apps/portage
30 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
31 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1269 2013/05/19 00:14:30 zmedico Exp $
32 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1270 2013/05/24 05:41:49 zmedico Exp $
33 +
34 +*portage-2.1.12.2 (24 May 2013)
35 +
36 + 24 May 2013; Zac Medico <zmedico@g.o> +portage-2.1.12.2.ebuild,
37 + -portage-2.1.12.ebuild:
38 + 2.1.12.2 version bump. This fixes bug #470670 (repoman check for deprecated
39 + EAPIs) and bug #470916 (handle indirect man page symlinks when compressing).
40 + Bug #468524 tracks all bugs fixed since portage-2.1.11.62.
41
42 *portage-2.2.0_alpha176 (19 May 2013)
43
44
45
46
47 1.1 sys-apps/portage/portage-2.1.12.2.ebuild
48
49 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.1.12.2.ebuild?rev=1.1&view=markup
50 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.1.12.2.ebuild?rev=1.1&content-type=text/plain
51
52 Index: portage-2.1.12.2.ebuild
53 ===================================================================
54 # Copyright 1999-2013 Gentoo Foundation
55 # Distributed under the terms of the GNU General Public License v2
56 # $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.1.12.2.ebuild,v 1.1 2013/05/24 05:41:49 zmedico Exp $
57
58 # Require EAPI 2 since we now require at least python-2.6 (for python 3
59 # syntax support) which also requires EAPI 2.
60 EAPI=2
61 PYTHON_COMPAT=(
62 pypy1_9 pypy2_0
63 python3_1 python3_2 python3_3 python3_4
64 python2_6 python2_7
65 )
66 inherit eutils multilib
67
68 DESCRIPTION="Portage is the package management and distribution system for Gentoo"
69 HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
70 LICENSE="GPL-2"
71 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
72 SLOT="0"
73 IUSE="build doc epydoc +ipc linguas_pl linguas_ru pypy2_0 python2 python3 selinux xattr"
74
75 for _pyimpl in ${PYTHON_COMPAT[@]} ; do
76 IUSE+=" python_targets_${_pyimpl}"
77 done
78 unset _pyimpl
79
80 # Import of the io module in python-2.6 raises ImportError for the
81 # thread module if threading is disabled.
82 python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] )
83 !pypy2_0? ( !python2? ( !python3? (
84 || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] )
85 ) ) )
86 pypy2_0? ( !python2? ( !python3? ( dev-python/pypy:2.0[bzip2,ssl] ) ) )
87 python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )"
88 python_dep="${python_dep_ssl//\[ssl\]}"
89 python_dep="${python_dep//,ssl}"
90 python_dep="${python_dep//ssl,}"
91
92 python_dep="${python_dep}
93 python_targets_pypy1_9? ( dev-python/pypy:1.9 )
94 python_targets_pypy2_0? ( dev-python/pypy:2.0 )
95 python_targets_python2_6? ( dev-lang/python:2.6 )
96 python_targets_python2_7? ( dev-lang/python:2.7 )
97 python_targets_python3_1? ( dev-lang/python:3.1 )
98 python_targets_python3_2? ( dev-lang/python:3.2 )
99 python_targets_python3_3? ( dev-lang/python:3.3 )
100 python_targets_python3_4? ( dev-lang/python:3.4 )
101 "
102
103 # The pysqlite blocker is for bug #282760.
104 # make-3.82 is for bug #455858
105 DEPEND="${python_dep}
106 >=sys-devel/make-3.82
107 >=sys-apps/sed-4.0.5 sys-devel/patch
108 doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
109 epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
110 # Require sandbox-2.2 for bug #288863.
111 # For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
112 # quite slow, so it's not considered in the dependencies as an alternative to
113 # to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
114 # for now, don't pull in xattr deps for other kernels.
115 # For whirlpool hash, require python[ssl] or python-mhash (bug #425046).
116 # For compgen, require bash[readline] (bug #445576).
117 RDEPEND="${python_dep}
118 !build? ( >=sys-apps/sed-4.0.5
119 || ( >=app-shells/bash-4.2_p37[readline] ( <app-shells/bash-4.2_p37 >=app-shells/bash-3.2_p17 ) )
120 >=app-admin/eselect-1.2
121 || ( ${python_dep_ssl} dev-python/python-mhash )
122 )
123 elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
124 elibc_glibc? ( >=sys-apps/sandbox-2.2 )
125 elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
126 >=app-misc/pax-utils-0.1.17
127 xattr? ( kernel_linux? ( || ( >=dev-lang/python-3.3_pre20110902 dev-python/pyxattr ) ) )
128 selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
129 !<app-shells/bash-3.2_p17
130 !<app-admin/logrotate-3.8.0"
131 PDEPEND="
132 !build? (
133 >=net-misc/rsync-2.6.4
134 userland_GNU? ( >=sys-apps/coreutils-6.4 )
135 )"
136 # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
137 # NOTE: FEATURES=installsources requires debugedit and rsync
138
139 SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
140
141 prefix_src_archives() {
142 local x y
143 for x in ${@}; do
144 for y in ${SRC_ARCHIVES}; do
145 echo ${y}/${x}
146 done
147 done
148 }
149
150 PV_PL="2.1.2"
151 PATCHVER_PL=""
152 TARBALL_PV=$PV
153 SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
154 $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
155 linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
156 $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
157
158 PATCHVER=
159 [[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
160 if [ -n "${PATCHVER}" ]; then
161 SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
162 $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
163 fi
164
165 S="${WORKDIR}"/${PN}-${TARBALL_PV}
166 S_PL="${WORKDIR}"/${PN}-${PV_PL}
167
168 compatible_python_is_selected() {
169 [[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
170 }
171
172 current_python_has_xattr() {
173 [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
174 local PYTHON=/usr/bin/${EPYTHON}
175 [[ $("${PYTHON}" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \
176 "${PYTHON}" -c 'import xattr' 2>/dev/null
177 }
178
179 call_with_python_impl() {
180 [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
181 env EPYTHON=${EPYTHON} "$@"
182 }
183
184 get_python_interpreter() {
185 [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
186 local impl=$1 python
187 case "${impl}" in
188 python*)
189 python=${impl/_/.}
190 ;;
191 pypy*)
192 python=${impl/_/.}
193 python=${python/pypy/pypy-c}
194 ;;
195 *)
196 die "Unrecognized python target: ${impl}"
197 esac
198 echo ${python}
199 }
200
201 get_python_sitedir() {
202 [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
203 local impl=$1
204 local site_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages
205 [[ -d ${ROOT}${site_dir} ]] || \
206 ewarn "site-packages dir missing for ${impl}: ${ROOT}${site_dir}"
207 echo "${site_dir}"
208 }
209
210 python_compileall() {
211 [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
212 local d=$1 PYTHON=/usr/bin/${EPYTHON}
213 local d_image=${D}${d#/}
214 [[ -d ${d_image} ]] || die "directory does not exist: ${d_image}"
215 case "${EPYTHON}" in
216 python*)
217 "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
218 # Note: Using -OO breaks emaint, since it requires __doc__,
219 # and __doc__ is None when -OO is used.
220 "${PYTHON}" -O -m compileall -q -f -d "${d}" "${d_image}" || die
221 ;;
222 pypy*)
223 "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
224 ;;
225 *)
226 die "Unrecognized EPYTHON value: ${EPYTHON}"
227 esac
228 }
229
230 pkg_setup() {
231 if use python2 && use python3 ; then
232 ewarn "Both python2 and python3 USE flags are enabled, but only one"
233 ewarn "can be in the shebangs. Using python3."
234 fi
235 if use pypy2_0 && use python3 ; then
236 ewarn "Both pypy2_0 and python3 USE flags are enabled, but only one"
237 ewarn "can be in the shebangs. Using python3."
238 fi
239 if use pypy2_0 && use python2 ; then
240 ewarn "Both pypy2_0 and python2 USE flags are enabled, but only one"
241 ewarn "can be in the shebangs. Using python2"
242 fi
243 if ! use pypy2_0 && ! use python2 && ! use python3 && \
244 ! compatible_python_is_selected ; then
245 ewarn "Attempting to select a compatible default python interpreter"
246 local x success=0
247 for x in /usr/bin/python2.* ; do
248 x=${x#/usr/bin/python2.}
249 if [[ $x -ge 6 ]] 2>/dev/null ; then
250 eselect python set python2.$x
251 if compatible_python_is_selected ; then
252 elog "Default python interpreter is now set to python-2.$x"
253 success=1
254 break
255 fi
256 fi
257 done
258 if [ $success != 1 ] ; then
259 eerror "Unable to select a compatible default python interpreter!"
260 die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
261 fi
262 fi
263
264 # We use EPYTHON to designate the active python interpreter,
265 # but we only export when needed, via call_with_python_impl.
266 EPYTHON=python
267 export -n EPYTHON
268 if use python3; then
269 EPYTHON=python3
270 elif use python2; then
271 EPYTHON=python2
272 elif use pypy2_0; then
273 EPYTHON=pypy-c2.0
274 fi
275 }
276
277 src_prepare() {
278 if [ -n "${PATCHVER}" ] ; then
279 if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
280 rm "$S/bin/ebuild-helpers/portageq" \
281 || die "failed to remove portageq helper symlink"
282 fi
283 epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
284 fi
285 einfo "Setting portage.VERSION to ${PVR} ..."
286 sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
287 die "Failed to patch portage.VERSION"
288 sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
289 die "Failed to patch VERSION in doc/fragment/version"
290 sed -e "1s/VERSION/${PVR}/" -i $(find man -type f) || \
291 die "Failed to patch VERSION in man page headers"
292
293 if ! use ipc ; then
294 einfo "Disabling ipc..."
295 sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
296 -i pym/_emerge/AbstractEbuildProcess.py || \
297 die "failed to patch AbstractEbuildProcess.py"
298 fi
299
300 if use xattr && use kernel_linux ; then
301 einfo "Adding FEATURES=xattr to make.globals ..."
302 echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
303 || die "failed to append to make.globals"
304 fi
305
306 local set_shebang=
307 if use python3; then
308 set_shebang=python3
309 elif use python2; then
310 set_shebang=python2
311 elif use pypy2_0; then
312 set_shebang=pypy-c2.0
313 fi
314 if [[ -n ${set_shebang} ]] ; then
315 einfo "Converting shebangs for ${set_shebang}..."
316 while read -r -d $'\0' ; do
317 local shebang=$(head -n1 "$REPLY")
318 if [[ ${shebang} == "#!/usr/bin/python"* ]] ; then
319 sed -i -e "1s:python:${set_shebang}:" "$REPLY" || \
320 die "sed failed"
321 fi
322 done < <(find . -type f -print0)
323 fi
324
325 cd "${S}/cnf" || die
326 if [ -f "make.conf.${ARCH}".diff ]; then
327 patch make.conf "make.conf.${ARCH}".diff || \
328 die "Failed to patch make.conf.example"
329 else
330 eerror ""
331 eerror "Portage does not have an arch-specific configuration for this arch."
332 eerror "Please notify the arch maintainer about this issue. Using generic."
333 eerror ""
334 fi
335 }
336
337 src_compile() {
338 if use doc; then
339 call_with_python_impl \
340 emake docbook || die
341 fi
342
343 if use epydoc; then
344 einfo "Generating api docs"
345 call_with_python_impl \
346 emake epydoc || die
347 fi
348 }
349
350 src_test() {
351 call_with_python_impl \
352 emake test || die
353 }
354
355 src_install() {
356 call_with_python_impl \
357 emake DESTDIR="${D}" \
358 sysconfdir="/etc" \
359 prefix="/usr" \
360 install || die
361
362 # Extended set config is currently disabled in portage-2.1.x.
363 rm -rf "${D}/usr/share/portage/config/sets" || die
364
365 # Use dodoc for compression, since the Makefile doesn't do that.
366 dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die
367
368 if use linguas_pl; then
369 doman -i18n=pl "${S_PL}"/man/pl/*.[0-9] || die
370 doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9] || die
371 fi
372
373 # Allow external portage API consumers to import portage python modules
374 # (this used to be done with PYTHONPATH setting in /etc/env.d).
375 # For each of PYTHON_TARGETS, install a tree of *.py symlinks in
376 # site-packages, and compile with the corresponding interpreter.
377 local impl files mod_dir dest_mod_dir python relative_path x
378 for impl in "${PYTHON_COMPAT[@]}" ; do
379 use "python_targets_${impl}" || continue
380 if use build && [[ ${ROOT} == / &&
381 ! -x /usr/bin/$(get_python_interpreter ${impl}) ]] ; then
382 # Tolerate --nodeps at beginning of stage1 for catalyst
383 ewarn "skipping python_targets_${impl}, interpreter not found"
384 continue
385 fi
386 while read -r mod_dir ; do
387 cd "${D}/usr/lib/portage/pym/${mod_dir}" || die
388 files=$(echo *.py)
389 if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then
390 # __pycache__ directories contain no py files
391 continue
392 fi
393 dest_mod_dir=$(get_python_sitedir ${impl})/${mod_dir}
394 dodir "${dest_mod_dir}" || die
395 relative_path=../../../lib/portage/pym/${mod_dir}
396 x=/${mod_dir}
397 while [ -n "${x}" ] ; do
398 relative_path=../${relative_path}
399 x=${x%/*}
400 done
401 for x in ${files} ; do
402 dosym "${relative_path}/${x}" \
403 "${dest_mod_dir}/${x}" || die
404 done
405 done < <(cd "${D}"/usr/lib/portage/pym || die ; find * -type d ! -path "portage/tests*")
406 cd "${S}" || die
407 EPYTHON=$(get_python_interpreter ${impl}) \
408 python_compileall "$(get_python_sitedir ${impl})"
409 done
410
411 # Compile /usr/lib/portage/pym with the active interpreter, since portage
412 # internal commands force this directory to the beginning of sys.path.
413 python_compileall /usr/lib/portage/pym
414 }
415
416 pkg_preinst() {
417 if [[ $ROOT == / ]] ; then
418 # Run some minimal tests as a sanity check.
419 local test_runner=$(find "$D" -name runTests)
420 if [[ -n $test_runner && -x $test_runner ]] ; then
421 einfo "Running preinst sanity tests..."
422 "$test_runner" || die "preinst sanity tests failed"
423 fi
424 fi
425
426 if use xattr && ! current_python_has_xattr ; then
427 ewarn "For optimal performance in xattr handling, install"
428 ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and"
429 ewarn "enable USE=python3 for $CATEGORY/$PN."
430 fi
431
432 # elog dir must exist to avoid logrotate error for bug #415911.
433 # This code runs in preinst in order to bypass the mapping of
434 # portage:portage to root:root which happens after src_install.
435 keepdir /var/log/portage/elog
436 # This is allowed to fail if the user/group are invalid for prefix users.
437 if chown portage:portage "${D}"var/log/portage{,/elog} 2>/dev/null ; then
438 chmod g+s,ug+rwx "${D}"var/log/portage{,/elog}
439 fi
440
441 if [[ -d ${ROOT}var/log/portage && \
442 $(ls -ld "${ROOT}var/log/portage") != *" portage portage "* ]] && \
443 has_version '<sys-apps/portage-2.1.10.11' ; then
444 # Initialize permissions for bug #378451 and bug #377177, since older
445 # portage does not create /var/log/portage with the desired default
446 # permissions.
447 einfo "Applying portage group permission to ${ROOT}var/log/portage for bug #378451"
448 chown portage:portage "${ROOT}var/log/portage"
449 chmod g+ws "${ROOT}var/log/portage"
450 fi
451
452 if has_version '<sys-apps/portage-2.1.10.61' ; then
453 ewarn "FEATURES=config-protect-if-modified is now enabled by default."
454 ewarn "This causes the CONFIG_PROTECT behavior to be skipped for"
455 ewarn "files that have not been modified since they were installed."
456 fi
457
458 # If portage-2.1.6 is installed and the preserved_libs_registry exists,
459 # assume that the NEEDED.ELF.2 files have already been generated.
460 has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \
461 ! { [ -e "${ROOT}"var/lib/portage/preserved_libs_registry ] && \
462 has_version ">=${CATEGORY}/${PN}-2.1.6_rc" ; } \
463 && NEEDED_REBUILD_UPGRADE=true || NEEDED_REBUILD_UPGRADE=false
464 }
465
466 pkg_postinst() {
467 if ${NEEDED_REBUILD_UPGRADE} ; then
468 einfo "rebuilding NEEDED.ELF.2 files"
469 local cpv filename line newline
470 for cpv in "${ROOT}/var/db/pkg"/*/*; do
471 [[ -f "${cpv}/NEEDED" && ! -f "${cpv}/NEEDED.ELF.2" ]] || continue
472 while read -r line; do
473 filename=${line% *}
474 newline=$(scanelf -BF "%a;%F;%S;%r;%n" "${ROOT%/}${filename}")
475 newline=${newline// - }
476 [[ ${#ROOT} -gt 1 ]] && newline=${newline/${ROOT%/}}
477 echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2"
478 done < "${cpv}/NEEDED"
479 done
480 fi
481 }