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