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