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.2.0_alpha19.ebuild ChangeLog portage-2.1.9.35.ebuild
Date: Sat, 22 Jan 2011 06:52:45
Message-Id: 20110122065231.394F720054@flycatcher.gentoo.org
1 zmedico 11/01/22 06:52:31
2
3 Modified: ChangeLog
4 Added: portage-2.2.0_alpha19.ebuild
5 portage-2.1.9.35.ebuild
6 Log:
7 *portage-2.2.0_alpha19 (22 Jan 2011)
8
9 22 Jan 2011; Zac Medico <zmedico@g.o> +portage-2.2.0_alpha19.ebuild:
10 2.2.0_alpha19 version bump. This includes all of the fixes in
11 portage-2.1.9.35. Bug #210077 tracks all bugs fixed since portage-2.1.x.
12
13 *portage-2.1.9.35 (22 Jan 2011)
14
15 22 Jan 2011; Zac Medico <zmedico@g.o> +portage-2.1.9.35.ebuild:
16 2.1.9.35 version bump. This fixes bug #287648 (logging via pty with
17 python3). Bug #349307 tracks all bugs fixed since 2.1.9.25.
18
19 (Portage version: 2.2.0_alpha19/cvs/Linux i686)
20
21 Revision Changes Path
22 1.793 sys-apps/portage/ChangeLog
23
24 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.793&view=markup
25 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.793&content-type=text/plain
26 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?r1=1.792&r2=1.793
27
28 Index: ChangeLog
29 ===================================================================
30 RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v
31 retrieving revision 1.792
32 retrieving revision 1.793
33 diff -u -r1.792 -r1.793
34 --- ChangeLog 19 Jan 2011 20:51:53 -0000 1.792
35 +++ ChangeLog 22 Jan 2011 06:52:31 -0000 1.793
36 @@ -1,6 +1,18 @@
37 # ChangeLog for sys-apps/portage
38 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
39 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.792 2011/01/19 20:51:53 zmedico Exp $
40 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.793 2011/01/22 06:52:31 zmedico Exp $
41 +
42 +*portage-2.2.0_alpha19 (22 Jan 2011)
43 +
44 + 22 Jan 2011; Zac Medico <zmedico@g.o> +portage-2.2.0_alpha19.ebuild:
45 + 2.2.0_alpha19 version bump. This includes all of the fixes in
46 + portage-2.1.9.35. Bug #210077 tracks all bugs fixed since portage-2.1.x.
47 +
48 +*portage-2.1.9.35 (22 Jan 2011)
49 +
50 + 22 Jan 2011; Zac Medico <zmedico@g.o> +portage-2.1.9.35.ebuild:
51 + 2.1.9.35 version bump. This fixes bug #287648 (logging via pty with
52 + python3). Bug #349307 tracks all bugs fixed since 2.1.9.25.
53
54 *portage-2.2.0_alpha18 (19 Jan 2011)
55
56
57
58
59 1.1 sys-apps/portage/portage-2.2.0_alpha19.ebuild
60
61 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha19.ebuild?rev=1.1&view=markup
62 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha19.ebuild?rev=1.1&content-type=text/plain
63
64 Index: portage-2.2.0_alpha19.ebuild
65 ===================================================================
66 # Copyright 1999-2011 Gentoo Foundation
67 # Distributed under the terms of the GNU General Public License v2
68 # $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha19.ebuild,v 1.1 2011/01/22 06:52:31 zmedico Exp $
69
70 # Require EAPI 2 since we now require at least python-2.6 (for python 3
71 # syntax support) which also requires EAPI 2.
72 EAPI=2
73 inherit eutils multilib python
74
75 DESCRIPTION="Portage is the package management and distribution system for Gentoo"
76 HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
77 LICENSE="GPL-2"
78 KEYWORDS="~sparc-fbsd ~x86-fbsd"
79 PROVIDE="virtual/portage"
80 SLOT="0"
81 IUSE="build doc epydoc +ipc linguas_pl python3 selinux"
82
83 python_dep="python3? ( =dev-lang/python-3* )
84 !python3? (
85 build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 ) )
86 !build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 >=dev-lang/python-3 ) )
87 )"
88
89 # The pysqlite blocker is for bug #282760.
90 DEPEND="${python_dep}
91 !build? ( >=sys-apps/sed-4.0.5 )
92 doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
93 epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
94 # Require sandbox-2.2 for bug #288863.
95 RDEPEND="${python_dep}
96 !build? ( >=sys-apps/sed-4.0.5
97 >=app-shells/bash-3.2_p17
98 >=app-admin/eselect-1.2 )
99 elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
100 elibc_glibc? ( >=sys-apps/sandbox-2.2 )
101 elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
102 >=app-misc/pax-utils-0.1.17
103 selinux? ( sys-libs/libselinux )
104 !<app-shells/bash-3.2_p17"
105 PDEPEND="
106 !build? (
107 >=net-misc/rsync-2.6.4
108 userland_GNU? ( >=sys-apps/coreutils-6.4 )
109 )"
110 # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
111 # rsync-2.6.4 rdep is for the --filter option #167668
112
113 SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
114
115 prefix_src_archives() {
116 local x y
117 for x in ${@}; do
118 for y in ${SRC_ARCHIVES}; do
119 echo ${y}/${x}
120 done
121 done
122 }
123
124 PV_PL="2.1.2"
125 PATCHVER_PL=""
126 TARBALL_PV=2.2.0_alpha18
127 SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
128 $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
129 linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
130 $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
131
132 PATCHVER=
133 [[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
134 if [ -n "${PATCHVER}" ]; then
135 SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
136 $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
137 fi
138
139 S="${WORKDIR}"/${PN}-${TARBALL_PV}
140 S_PL="${WORKDIR}"/${PN}-${PV_PL}
141
142 compatible_python_is_selected() {
143 [[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
144 }
145
146 pkg_setup() {
147 if ! use python3 && ! compatible_python_is_selected ; then
148 ewarn "Attempting to select a compatible default python interpreter"
149 local x success=0
150 for x in /usr/bin/python2.* ; do
151 x=${x#/usr/bin/python2.}
152 if [[ $x -ge 6 ]] 2>/dev/null ; then
153 eselect python set python2.$x
154 if compatible_python_is_selected ; then
155 elog "Default python interpreter is now set to python-2.$x"
156 success=1
157 break
158 fi
159 fi
160 done
161 if [ $success != 1 ] ; then
162 eerror "Unable to select a compatible default python interpreter!"
163 die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
164 fi
165 fi
166
167 if use python3; then
168 python_set_active_version 3
169 fi
170 }
171
172 src_prepare() {
173 if [ -n "${PATCHVER}" ] ; then
174 if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
175 rm "$S/bin/ebuild-helpers/portageq" \
176 || die "failed to remove portageq helper symlink"
177 fi
178 epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
179 fi
180 einfo "Setting portage.VERSION to ${PVR} ..."
181 sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
182 die "Failed to patch portage.VERSION"
183 sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
184 die "Failed to patch VERSION in doc/fragment/version"
185 sed -e "1s/VERSION/${PVR}/" -i man/* || \
186 die "Failed to patch VERSION in man page headers"
187
188 if ! use ipc ; then
189 einfo "Disabling ipc..."
190 sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
191 -i pym/_emerge/AbstractEbuildProcess.py || \
192 die "failed to patch AbstractEbuildProcess.py"
193 fi
194
195 if use python3; then
196 einfo "Converting shebangs for python3..."
197 python_convert_shebangs -r 3 .
198 fi
199 }
200
201 src_compile() {
202 if use doc; then
203 cd "${S}"/doc
204 touch fragment/date
205 make xhtml xhtml-nochunks || die "failed to make docs"
206 fi
207
208 if use epydoc; then
209 einfo "Generating api docs"
210 mkdir "${WORKDIR}"/api
211 local my_modules epydoc_opts=""
212 my_modules="$(find "${S}/pym" -name "*.py" \
213 | sed -e 's:/__init__.py$::' -e 's:\.py$::' -e "s:^${S}/pym/::" \
214 -e 's:/:.:g' | sort)" || die "error listing modules"
215 # workaround for bug 282760
216 > "$S/pym/pysqlite2.py"
217 PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \
218 epydoc -o "${WORKDIR}"/api \
219 -qqqqq --no-frames --show-imports $epydoc_opts \
220 --name "${PN}" --url "${HOMEPAGE}" \
221 ${my_modules} || die "epydoc failed"
222 rm "$S/pym/pysqlite2.py"
223 fi
224 }
225
226 src_test() {
227 # make files executable, in case they were created by patch
228 find bin -type f | xargs chmod +x
229 PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \
230 ./pym/portage/tests/runTests || die "test(s) failed"
231 }
232
233 src_install() {
234 local libdir=$(get_libdir)
235 local portage_base="/usr/${libdir}/portage"
236 local portage_share_config=/usr/share/portage/config
237
238 cd "${S}"/cnf
239 insinto /etc
240 doins etc-update.conf dispatch-conf.conf || die
241
242 insinto "$portage_share_config/sets"
243 doins "$S"/cnf/sets/*.conf || die
244 insinto "$portage_share_config"
245 doins "$S/cnf/make.globals" || die
246 if [ -f "make.conf.${ARCH}".diff ]; then
247 patch make.conf "make.conf.${ARCH}".diff || \
248 die "Failed to patch make.conf.example"
249 newins make.conf make.conf.example || die
250 else
251 eerror ""
252 eerror "Portage does not have an arch-specific configuration for this arch."
253 eerror "Please notify the arch maintainer about this issue. Using generic."
254 eerror ""
255 newins make.conf make.conf.example || die
256 fi
257
258 dosym ..${portage_share_config}/make.globals /etc/make.globals
259
260 insinto /etc/logrotate.d
261 doins "${S}"/cnf/logrotate.d/elog-save-summary || die
262
263 # BSD and OSX need a sed wrapper so that find/xargs work properly
264 if use userland_GNU; then
265 rm "${S}"/bin/ebuild-helpers/sed || die "Failed to remove sed wrapper"
266 fi
267
268 local x symlinks
269
270 cd "$S" || die "cd failed"
271 for x in $(find bin -type d) ; do
272 exeinto $portage_base/$x || die "exeinto failed"
273 cd "$S"/$x || die "cd failed"
274 doexe $(find . -mindepth 1 -maxdepth 1 -type f ! -type l) || \
275 die "doexe failed"
276 symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
277 if [ -n "$symlinks" ] ; then
278 cp -P $symlinks "$D$portage_base/$x" || die "cp failed"
279 fi
280 done
281
282 cd "$S" || die "cd failed"
283 for x in $(find pym/* -type d) ; do
284 insinto $portage_base/$x || die "insinto failed"
285 cd "$S"/$x || die "cd failed"
286 # __pycache__ directories contain no py files
287 [[ "*.py" != $(echo *.py) ]] || continue
288 doins *.py || die "doins failed"
289 symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
290 if [ -n "$symlinks" ] ; then
291 cp -P $symlinks "$D$portage_base/$x" || die "cp failed"
292 fi
293 done
294
295 # Symlinks to directories cause up/downgrade issues and the use of these
296 # modules outside of portage is probably negligible.
297 for x in "${D}${portage_base}/pym/"{cache,elog_modules} ; do
298 [ ! -L "${x}" ] && continue
299 die "symlink to directory will cause upgrade/downgrade issues: '${x}'"
300 done
301
302 exeinto ${portage_base}/pym/portage/tests
303 doexe "${S}"/pym/portage/tests/runTests
304
305 doman "${S}"/man/*.[0-9]
306 if use linguas_pl; then
307 doman -i18n=pl "${S_PL}"/man/pl/*.[0-9]
308 doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9]
309 fi
310
311 dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES}
312 use doc && dohtml -r "${S}"/doc/*
313 use epydoc && dohtml -r "${WORKDIR}"/api
314
315 dodir /usr/bin
316 for x in ebuild egencache emerge portageq quickpkg repoman ; do
317 dosym ../${libdir}/portage/bin/${x} /usr/bin/${x}
318 done
319
320 dodir /usr/sbin
321 local my_syms="archive-conf
322 dispatch-conf
323 emaint
324 emerge-webrsync
325 env-update
326 etc-update
327 fixpackages
328 regenworld"
329 local x
330 for x in ${my_syms}; do
331 dosym ../${libdir}/portage/bin/${x} /usr/sbin/${x}
332 done
333 dosym env-update /usr/sbin/update-env
334 dosym etc-update /usr/sbin/update-etc
335
336 dodir /etc/portage
337 keepdir /etc/portage
338 }
339
340 pkg_preinst() {
341 if ! use build && ! has_version dev-python/pycrypto && \
342 ! has_version '>=dev-lang/python-2.6[ssl]' ; then
343 ewarn "If you are an ebuild developer and you plan to commit ebuilds"
344 ewarn "with this system then please install dev-python/pycrypto or"
345 ewarn "enable the ssl USE flag for >=dev-lang/python-2.6 in order"
346 ewarn "to enable RMD160 hash support."
347 ewarn "See bug #198398 for more information."
348 fi
349 if [ -f "${ROOT}/etc/make.globals" ]; then
350 rm "${ROOT}/etc/make.globals"
351 fi
352
353 has_version "<${CATEGORY}/${PN}-2.2_alpha"
354 MINOR_UPGRADE=$?
355
356 has_version "<=${CATEGORY}/${PN}-2.2_pre5"
357 WORLD_MIGRATION_UPGRADE=$?
358
359 # If portage-2.1.6 is installed and the preserved_libs_registry exists,
360 # assume that the NEEDED.ELF.2 files have already been generated.
361 has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \
362 ! ( [ -e "$ROOT"var/lib/portage/preserved_libs_registry ] && \
363 has_version ">=${CATEGORY}/${PN}-2.1.6_rc" )
364 NEEDED_REBUILD_UPGRADE=$?
365
366 [[ -n $PORTDIR_OVERLAY ]] && has_version "<${CATEGORY}/${PN}-2.1.6.12"
367 REPO_LAYOUT_CONF_WARN=$?
368 }
369
370 pkg_postinst() {
371 # Compile all source files recursively. Any orphans
372 # will be identified and removed in postrm.
373 python_mod_optimize /usr/$(get_libdir)/portage/pym
374
375 if [ $WORLD_MIGRATION_UPGRADE = 0 ] ; then
376 einfo "moving set references from the worldfile into world_sets"
377 cd "${ROOT}/var/lib/portage/"
378 grep "^@" world >> world_sets
379 sed -i -e '/^@/d' world
380 fi
381
382 if [ $NEEDED_REBUILD_UPGRADE = 0 ] ; then
383 einfo "rebuilding NEEDED.ELF.2 files"
384 for cpv in "${ROOT}/var/db/pkg"/*/*; do
385 if [ -f "${cpv}/NEEDED" ]; then
386 rm -f "${cpv}/NEEDED.ELF.2"
387 while read line; do
388 filename=${line% *}
389 needed=${line#* }
390 needed=${needed//+/++}
391 needed=${needed//#/##}
392 needed=${needed//%/%%}
393 newline=$(scanelf -BF "%a;%F;%S;%r;${needed}" $filename)
394 newline=${newline// - }
395 echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2"
396 done < "${cpv}/NEEDED"
397 fi
398 done
399 fi
400
401 if [ $REPO_LAYOUT_CONF_WARN = 0 ] ; then
402 ewarn
403 echo "If you want overlay eclasses to override eclasses from" \
404 "other repos then see the portage(5) man page" \
405 "for information about the new layout.conf and repos.conf" \
406 "configuration files." \
407 | fmt -w 75 | while read -r ; do ewarn "$REPLY" ; done
408 ewarn
409 fi
410
411 einfo
412 einfo "For help with using portage please consult the Gentoo Handbook"
413 einfo "at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3"
414 einfo
415
416 if [ $MINOR_UPGRADE = 0 ] ; then
417 elog "If you're upgrading from a pre-2.2 version of portage you might"
418 elog "want to remerge world (emerge -e world) to take full advantage"
419 elog "of some of the new features in 2.2."
420 elog "This is not required however for portage to function properly."
421 elog
422 fi
423
424 if [ -z "${PV/*_alpha*}" ]; then
425 elog "If you always want to use the latest development version of portage"
426 elog "please read http://www.gentoo.org/proj/en/portage/doc/testing.xml"
427 elog
428 fi
429 }
430
431 pkg_postrm() {
432 python_mod_cleanup /usr/$(get_libdir)/portage/pym
433 }
434
435
436
437 1.1 sys-apps/portage/portage-2.1.9.35.ebuild
438
439 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.1.9.35.ebuild?rev=1.1&view=markup
440 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.1.9.35.ebuild?rev=1.1&content-type=text/plain
441
442 Index: portage-2.1.9.35.ebuild
443 ===================================================================
444 # Copyright 1999-2011 Gentoo Foundation
445 # Distributed under the terms of the GNU General Public License v2
446 # $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.1.9.35.ebuild,v 1.1 2011/01/22 06:52:31 zmedico Exp $
447
448 # Require EAPI 2 since we now require at least python-2.6 (for python 3
449 # syntax support) which also requires EAPI 2.
450 EAPI=2
451 inherit eutils multilib python
452
453 DESCRIPTION="Portage is the package management and distribution system for Gentoo"
454 HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
455 LICENSE="GPL-2"
456 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
457 PROVIDE="virtual/portage"
458 SLOT="0"
459 IUSE="build doc epydoc +ipc linguas_pl python3 selinux"
460
461 python_dep="python3? ( =dev-lang/python-3* )
462 !python3? (
463 build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 ) )
464 !build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 >=dev-lang/python-3 ) )
465 )"
466
467 # The pysqlite blocker is for bug #282760.
468 DEPEND="${python_dep}
469 !build? ( >=sys-apps/sed-4.0.5 )
470 doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
471 epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
472
473 RDEPEND="${python_dep}
474 !build? ( >=sys-apps/sed-4.0.5
475 >=app-shells/bash-3.2_p17
476 >=app-admin/eselect-1.2 )
477 elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
478 elibc_glibc? ( >=sys-apps/sandbox-1.6 )
479 elibc_uclibc? ( >=sys-apps/sandbox-1.6 )
480 >=app-misc/pax-utils-0.1.17
481 selinux? ( sys-libs/libselinux )
482 !<app-shells/bash-3.2_p17"
483 PDEPEND="
484 !build? (
485 >=net-misc/rsync-2.6.4
486 userland_GNU? ( >=sys-apps/coreutils-6.4 )
487 )"
488 # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
489 # rsync-2.6.4 rdep is for the --filter option #167668
490
491 SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
492
493 prefix_src_archives() {
494 local x y
495 for x in ${@}; do
496 for y in ${SRC_ARCHIVES}; do
497 echo ${y}/${x}
498 done
499 done
500 }
501
502 PV_PL="2.1.2"
503 PATCHVER_PL=""
504 TARBALL_PV=$PV
505 SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
506 $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
507 linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
508 $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
509
510 PATCHVER=
511 [[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
512 if [ -n "${PATCHVER}" ]; then
513 SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
514 $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
515 fi
516
517 S="${WORKDIR}"/${PN}-${TARBALL_PV}
518 S_PL="${WORKDIR}"/${PN}-${PV_PL}
519
520 compatible_python_is_selected() {
521 [[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
522 }
523
524 pkg_setup() {
525 if ! use python3 && ! compatible_python_is_selected ; then
526 ewarn "Attempting to select a compatible default python interpreter"
527 local x success=0
528 for x in /usr/bin/python2.* ; do
529 x=${x#/usr/bin/python2.}
530 if [[ $x -ge 6 ]] 2>/dev/null ; then
531 eselect python set python2.$x
532 if compatible_python_is_selected ; then
533 elog "Default python interpreter is now set to python-2.$x"
534 success=1
535 break
536 fi
537 fi
538 done
539 if [ $success != 1 ] ; then
540 eerror "Unable to select a compatible default python interpreter!"
541 die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
542 fi
543 fi
544
545 if use python3; then
546 python_set_active_version 3
547 fi
548 }
549
550 src_prepare() {
551 if [ -n "${PATCHVER}" ] ; then
552 if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
553 rm "$S/bin/ebuild-helpers/portageq" \
554 || die "failed to remove portageq helper symlink"
555 fi
556 epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
557 fi
558 einfo "Setting portage.VERSION to ${PVR} ..."
559 sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
560 die "Failed to patch portage.VERSION"
561 sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
562 die "Failed to patch VERSION in doc/fragment/version"
563 sed -e "1s/VERSION/${PVR}/" -i man/* || \
564 die "Failed to patch VERSION in man page headers"
565
566 if ! use ipc ; then
567 einfo "Disabling ipc..."
568 sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
569 -i pym/_emerge/AbstractEbuildProcess.py || \
570 die "failed to patch AbstractEbuildProcess.py"
571 fi
572
573 if use python3; then
574 einfo "Converting shebangs for python3..."
575 python_convert_shebangs -r 3 .
576 fi
577 }
578
579 src_compile() {
580 if use doc; then
581 cd "${S}"/doc
582 touch fragment/date
583 make xhtml xhtml-nochunks || die "failed to make docs"
584 fi
585
586 if use epydoc; then
587 einfo "Generating api docs"
588 mkdir "${WORKDIR}"/api
589 local my_modules epydoc_opts=""
590 my_modules="$(find "${S}/pym" -name "*.py" \
591 | sed -e 's:/__init__.py$::' -e 's:\.py$::' -e "s:^${S}/pym/::" \
592 -e 's:/:.:g' | sort)" || die "error listing modules"
593 # workaround for bug 282760
594 > "$S/pym/pysqlite2.py"
595 PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \
596 epydoc -o "${WORKDIR}"/api \
597 -qqqqq --no-frames --show-imports $epydoc_opts \
598 --name "${PN}" --url "${HOMEPAGE}" \
599 ${my_modules} || die "epydoc failed"
600 rm "$S/pym/pysqlite2.py"
601 fi
602 }
603
604 src_test() {
605 # make files executable, in case they were created by patch
606 find bin -type f | xargs chmod +x
607 PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \
608 ./pym/portage/tests/runTests || die "test(s) failed"
609 }
610
611 src_install() {
612 local libdir=$(get_libdir)
613 local portage_base="/usr/${libdir}/portage"
614 local portage_share_config=/usr/share/portage/config
615
616 cd "${S}"/cnf
617 insinto /etc
618 doins etc-update.conf dispatch-conf.conf || die
619
620 insinto "$portage_share_config"
621 doins "$S/cnf/make.globals" || die
622 if [ -f "make.conf.${ARCH}".diff ]; then
623 patch make.conf "make.conf.${ARCH}".diff || \
624 die "Failed to patch make.conf.example"
625 newins make.conf make.conf.example || die
626 else
627 eerror ""
628 eerror "Portage does not have an arch-specific configuration for this arch."
629 eerror "Please notify the arch maintainer about this issue. Using generic."
630 eerror ""
631 newins make.conf make.conf.example || die
632 fi
633
634 dosym ..${portage_share_config}/make.globals /etc/make.globals
635
636 insinto /etc/logrotate.d
637 doins "${S}"/cnf/logrotate.d/elog-save-summary || die
638
639 # BSD and OSX need a sed wrapper so that find/xargs work properly
640 if use userland_GNU; then
641 rm "${S}"/bin/ebuild-helpers/sed || die "Failed to remove sed wrapper"
642 fi
643
644 local x symlinks
645
646 cd "$S" || die "cd failed"
647 for x in $(find bin -type d) ; do
648 exeinto $portage_base/$x || die "exeinto failed"
649 cd "$S"/$x || die "cd failed"
650 doexe $(find . -mindepth 1 -maxdepth 1 -type f ! -type l) || \
651 die "doexe failed"
652 symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
653 if [ -n "$symlinks" ] ; then
654 cp -P $symlinks "$D$portage_base/$x" || die "cp failed"
655 fi
656 done
657
658 cd "$S" || die "cd failed"
659 for x in $(find pym/* -type d) ; do
660 insinto $portage_base/$x || die "insinto failed"
661 cd "$S"/$x || die "cd failed"
662 # __pycache__ directories contain no py files
663 [[ "*.py" != $(echo *.py) ]] || continue
664 doins *.py || die "doins failed"
665 symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
666 if [ -n "$symlinks" ] ; then
667 cp -P $symlinks "$D$portage_base/$x" || die "cp failed"
668 fi
669 done
670
671 # Symlinks to directories cause up/downgrade issues and the use of these
672 # modules outside of portage is probably negligible.
673 for x in "${D}${portage_base}/pym/"{cache,elog_modules} ; do
674 [ ! -L "${x}" ] && continue
675 die "symlink to directory will cause upgrade/downgrade issues: '${x}'"
676 done
677
678 exeinto ${portage_base}/pym/portage/tests
679 doexe "${S}"/pym/portage/tests/runTests
680
681 doman "${S}"/man/*.[0-9]
682 if use linguas_pl; then
683 doman -i18n=pl "${S_PL}"/man/pl/*.[0-9]
684 doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9]
685 fi
686
687 dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES}
688 use doc && dohtml -r "${S}"/doc/*
689 use epydoc && dohtml -r "${WORKDIR}"/api
690
691 dodir /usr/bin
692 for x in ebuild egencache emerge portageq quickpkg repoman ; do
693 dosym ../${libdir}/portage/bin/${x} /usr/bin/${x}
694 done
695
696 dodir /usr/sbin
697 local my_syms="archive-conf
698 dispatch-conf
699 emaint
700 emerge-webrsync
701 env-update
702 etc-update
703 fixpackages
704 regenworld"
705 local x
706 for x in ${my_syms}; do
707 dosym ../${libdir}/portage/bin/${x} /usr/sbin/${x}
708 done
709 dosym env-update /usr/sbin/update-env
710 dosym etc-update /usr/sbin/update-etc
711
712 dodir /etc/portage
713 keepdir /etc/portage
714 }
715
716 pkg_preinst() {
717 if ! use build && ! has_version dev-python/pycrypto && \
718 ! has_version '>=dev-lang/python-2.6[ssl]' ; then
719 ewarn "If you are an ebuild developer and you plan to commit ebuilds"
720 ewarn "with this system then please install dev-python/pycrypto or"
721 ewarn "enable the ssl USE flag for >=dev-lang/python-2.6 in order"
722 ewarn "to enable RMD160 hash support."
723 ewarn "See bug #198398 for more information."
724 fi
725 if [ -f "${ROOT}/etc/make.globals" ]; then
726 rm "${ROOT}/etc/make.globals"
727 fi
728
729 [[ -n $PORTDIR_OVERLAY ]] && has_version "<${CATEGORY}/${PN}-2.1.6.12"
730 REPO_LAYOUT_CONF_WARN=$?
731 }
732
733 pkg_postinst() {
734 # Compile all source files recursively. Any orphans
735 # will be identified and removed in postrm.
736 python_mod_optimize /usr/$(get_libdir)/portage/pym
737
738 if [ $REPO_LAYOUT_CONF_WARN = 0 ] ; then
739 ewarn
740 echo "If you want overlay eclasses to override eclasses from" \
741 "other repos then see the portage(5) man page" \
742 "for information about the new layout.conf and repos.conf" \
743 "configuration files." \
744 | fmt -w 75 | while read -r ; do ewarn "$REPLY" ; done
745 ewarn
746 fi
747
748 einfo
749 einfo "For help with using portage please consult the Gentoo Handbook"
750 einfo "at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3"
751 einfo
752 }
753
754 pkg_postrm() {
755 python_mod_cleanup /usr/$(get_libdir)/portage/pym
756 }