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