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.24.ebuild ChangeLog portage-2.2.0_alpha3.ebuild
Date: Sun, 31 Oct 2010 18:48:49
Message-Id: 20101031184842.6060220051@flycatcher.gentoo.org
1 zmedico 10/10/31 18:48:42
2
3 Modified: ChangeLog
4 Added: portage-2.1.9.24.ebuild portage-2.2.0_alpha3.ebuild
5 Log:
6 *portage-2.2.0_alpha3 (31 Oct 2010)
7
8 31 Oct 2010; Zac Medico <zmedico@g.o> +portage-2.2.0_alpha3.ebuild:
9 2.2.0_alpha3 version bump. This includes all of the fixes in
10 portage-2.1.9.24. Bug #210077 tracks all bugs fixed since 2.1.x.
11
12 *portage-2.1.9.24 (31 Oct 2010)
13
14 31 Oct 2010; Zac Medico <zmedico@g.o> +portage-2.1.9.24.ebuild:
15 2.1.9.24 version bump. This fixes bug #342721 (rpm creation does not work
16 with empty FILESDIR), and also fixes an incompatibility with the
17 implementation of deepcopy in python-2.7. Bug #335925 tracks all bugs
18 fixed since 2.1.8.x.
19
20 (Portage version: 2.2.0_alpha3/cvs/Linux i686)
21
22 Revision Changes Path
23 1.761 sys-apps/portage/ChangeLog
24
25 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.761&view=markup
26 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.761&content-type=text/plain
27 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?r1=1.760&r2=1.761
28
29 Index: ChangeLog
30 ===================================================================
31 RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v
32 retrieving revision 1.760
33 retrieving revision 1.761
34 diff -u -r1.760 -r1.761
35 --- ChangeLog 28 Oct 2010 04:02:20 -0000 1.760
36 +++ ChangeLog 31 Oct 2010 18:48:42 -0000 1.761
37 @@ -1,6 +1,20 @@
38 # ChangeLog for sys-apps/portage
39 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
40 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.760 2010/10/28 04:02:20 zmedico Exp $
41 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.761 2010/10/31 18:48:42 zmedico Exp $
42 +
43 +*portage-2.2.0_alpha3 (31 Oct 2010)
44 +
45 + 31 Oct 2010; Zac Medico <zmedico@g.o> +portage-2.2.0_alpha3.ebuild:
46 + 2.2.0_alpha3 version bump. This includes all of the fixes in
47 + portage-2.1.9.24. Bug #210077 tracks all bugs fixed since 2.1.x.
48 +
49 +*portage-2.1.9.24 (31 Oct 2010)
50 +
51 + 31 Oct 2010; Zac Medico <zmedico@g.o> +portage-2.1.9.24.ebuild:
52 + 2.1.9.24 version bump. This fixes bug #342721 (rpm creation does not work
53 + with empty FILESDIR), and also fixes an incompatibility with the
54 + implementation of deepcopy in python-2.7. Bug #335925 tracks all bugs
55 + fixed since 2.1.8.x.
56
57 *portage-2.2.0_alpha2 (28 Oct 2010)
58
59
60
61
62 1.1 sys-apps/portage/portage-2.1.9.24.ebuild
63
64 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.1.9.24.ebuild?rev=1.1&view=markup
65 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.1.9.24.ebuild?rev=1.1&content-type=text/plain
66
67 Index: portage-2.1.9.24.ebuild
68 ===================================================================
69 # Copyright 1999-2010 Gentoo Foundation
70 # Distributed under the terms of the GNU General Public License v2
71 # $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.1.9.24.ebuild,v 1.1 2010/10/31 18:48:42 zmedico Exp $
72
73 # Require EAPI 2 since we now require at least python-2.6 (for python 3
74 # syntax support) which also requires EAPI 2.
75 EAPI=2
76 inherit eutils multilib python
77
78 DESCRIPTION="Portage is the package management and distribution system for Gentoo"
79 HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
80 LICENSE="GPL-2"
81 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd"
82 PROVIDE="virtual/portage"
83 SLOT="0"
84 IUSE="build doc epydoc +ipc linguas_pl python3 selinux"
85
86 python_dep="python3? ( =dev-lang/python-3* )
87 !python3? (
88 build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 ) )
89 !build? ( || ( dev-lang/python:2.8 dev-lang/python:2.7 dev-lang/python:2.6 >=dev-lang/python-3 ) )
90 )"
91
92 # The pysqlite blocker is for bug #282760.
93 DEPEND="${python_dep}
94 !build? ( >=sys-apps/sed-4.0.5 )
95 doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
96 epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
97
98 RDEPEND="${python_dep}
99 !build? ( >=sys-apps/sed-4.0.5
100 >=app-shells/bash-3.2_p17
101 >=app-admin/eselect-1.2 )
102 elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
103 elibc_glibc? ( >=sys-apps/sandbox-1.6 )
104 elibc_uclibc? ( >=sys-apps/sandbox-1.6 )
105 >=app-misc/pax-utils-0.1.17
106 selinux? ( sys-libs/libselinux )
107 !<app-shells/bash-3.2_p17"
108 PDEPEND="
109 !build? (
110 >=net-misc/rsync-2.6.4
111 userland_GNU? ( >=sys-apps/coreutils-6.4 )
112 )"
113 # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
114 # rsync-2.6.4 rdep is for the --filter option #167668
115
116 SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
117
118 prefix_src_archives() {
119 local x y
120 for x in ${@}; do
121 for y in ${SRC_ARCHIVES}; do
122 echo ${y}/${x}
123 done
124 done
125 }
126
127 PV_PL="2.1.2"
128 PATCHVER_PL=""
129 TARBALL_PV=$PV
130 SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
131 $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
132 linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
133 $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
134
135 PATCHVER=
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_alpha3.ebuild
385
386 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha3.ebuild?rev=1.1&view=markup
387 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha3.ebuild?rev=1.1&content-type=text/plain
388
389 Index: portage-2.2.0_alpha3.ebuild
390 ===================================================================
391 # Copyright 1999-2010 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_alpha3.ebuild,v 1.1 2010/10/31 18:48:42 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="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~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 )
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_alpha1
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=$PV
458 if [ -n "${PATCHVER}" ]; then
459 SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
460 $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
461 fi
462
463 S="${WORKDIR}"/${PN}-${TARBALL_PV}
464 S_PL="${WORKDIR}"/${PN}-${PV_PL}
465
466 compatible_python_is_selected() {
467 [[ $(/usr/bin/python -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
468 }
469
470 pkg_setup() {
471 if ! use python3 && ! compatible_python_is_selected ; then
472 ewarn "Attempting to select a compatible default python interpreter"
473 local x success=0
474 for x in /usr/bin/python2.* ; do
475 x=${x#/usr/bin/python2.}
476 if [[ $x -ge 6 ]] 2>/dev/null ; then
477 eselect python set python2.$x
478 if compatible_python_is_selected ; then
479 elog "Default python interpreter is now set to python-2.$x"
480 success=1
481 break
482 fi
483 fi
484 done
485 if [ $success != 1 ] ; then
486 eerror "Unable to select a compatible default python interpreter!"
487 die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
488 fi
489 fi
490
491 if use python3; then
492 python_set_active_version 3
493 fi
494 }
495
496 src_prepare() {
497 if [ -n "${PATCHVER}" ] ; then
498 if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
499 rm "$S/bin/ebuild-helpers/portageq" \
500 || die "failed to remove portageq helper symlink"
501 fi
502 epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
503 fi
504 einfo "Setting portage.VERSION to ${PVR} ..."
505 sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
506 die "Failed to patch portage.VERSION"
507 sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
508 die "Failed to patch VERSION in doc/fragment/version"
509 sed -e "1s/VERSION/${PVR}/" -i man/* || \
510 die "Failed to patch VERSION in man page headers"
511
512 if ! use ipc ; then
513 einfo "Disabling ipc..."
514 sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
515 -i pym/_emerge/AbstractEbuildProcess.py || \
516 die "failed to patch AbstractEbuildProcess.py"
517 fi
518
519 if use python3; then
520 einfo "Converting shebangs for python3..."
521 python_convert_shebangs -r 3 .
522 fi
523 }
524
525 src_compile() {
526 if use doc; then
527 cd "${S}"/doc
528 touch fragment/date
529 make xhtml xhtml-nochunks || die "failed to make docs"
530 fi
531
532 if use epydoc; then
533 einfo "Generating api docs"
534 mkdir "${WORKDIR}"/api
535 local my_modules epydoc_opts=""
536 my_modules="$(find "${S}/pym" -name "*.py" \
537 | sed -e 's:/__init__.py$::' -e 's:\.py$::' -e "s:^${S}/pym/::" \
538 -e 's:/:.:g' | sort)" || die "error listing modules"
539 # workaround for bug 282760
540 > "$S/pym/pysqlite2.py"
541 PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \
542 epydoc -o "${WORKDIR}"/api \
543 -qqqqq --no-frames --show-imports $epydoc_opts \
544 --name "${PN}" --url "${HOMEPAGE}" \
545 ${my_modules} || die "epydoc failed"
546 rm "$S/pym/pysqlite2.py"
547 fi
548 }
549
550 src_test() {
551 # make files executable, in case they were created by patch
552 find bin -type f | xargs chmod +x
553 PYTHONPATH=${S}/pym:${PYTHONPATH:+:}${PYTHONPATH} \
554 ./pym/portage/tests/runTests || die "test(s) failed"
555 }
556
557 src_install() {
558 local libdir=$(get_libdir)
559 local portage_base="/usr/${libdir}/portage"
560 local portage_share_config=/usr/share/portage/config
561
562 cd "${S}"/cnf
563 insinto /etc
564 doins etc-update.conf dispatch-conf.conf || die
565
566 insinto "$portage_share_config/sets"
567 doins "$S"/cnf/sets/*.conf || die
568 insinto "$portage_share_config"
569 doins "$S/cnf/make.globals" || die
570 if [ -f "make.conf.${ARCH}".diff ]; then
571 patch make.conf "make.conf.${ARCH}".diff || \
572 die "Failed to patch make.conf.example"
573 newins make.conf make.conf.example || die
574 else
575 eerror ""
576 eerror "Portage does not have an arch-specific configuration for this arch."
577 eerror "Please notify the arch maintainer about this issue. Using generic."
578 eerror ""
579 newins make.conf make.conf.example || die
580 fi
581
582 dosym ..${portage_share_config}/make.globals /etc/make.globals
583
584 insinto /etc/logrotate.d
585 doins "${S}"/cnf/logrotate.d/elog-save-summary || die
586
587 # BSD and OSX need a sed wrapper so that find/xargs work properly
588 if use userland_GNU; then
589 rm "${S}"/bin/ebuild-helpers/sed || die "Failed to remove sed wrapper"
590 fi
591
592 local x symlinks
593
594 cd "$S" || die "cd failed"
595 for x in $(find bin -type d) ; do
596 exeinto $portage_base/$x || die "exeinto failed"
597 cd "$S"/$x || die "cd failed"
598 doexe $(find . -mindepth 1 -maxdepth 1 -type f ! -type l) || \
599 die "doexe failed"
600 symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
601 if [ -n "$symlinks" ] ; then
602 cp -P $symlinks "$D$portage_base/$x" || die "cp failed"
603 fi
604 done
605
606 cd "$S" || die "cd failed"
607 for x in $(find pym/* -type d) ; do
608 insinto $portage_base/$x || die "insinto failed"
609 cd "$S"/$x || die "cd failed"
610 # __pycache__ directories contain no py files
611 [[ "*.py" != $(echo *.py) ]] || continue
612 doins *.py || die "doins failed"
613 symlinks=$(find . -mindepth 1 -maxdepth 1 -type l)
614 if [ -n "$symlinks" ] ; then
615 cp -P $symlinks "$D$portage_base/$x" || die "cp failed"
616 fi
617 done
618
619 # Symlinks to directories cause up/downgrade issues and the use of these
620 # modules outside of portage is probably negligible.
621 for x in "${D}${portage_base}/pym/"{cache,elog_modules} ; do
622 [ ! -L "${x}" ] && continue
623 die "symlink to directory will cause upgrade/downgrade issues: '${x}'"
624 done
625
626 exeinto ${portage_base}/pym/portage/tests
627 doexe "${S}"/pym/portage/tests/runTests
628
629 doman "${S}"/man/*.[0-9]
630 if use linguas_pl; then
631 doman -i18n=pl "${S_PL}"/man/pl/*.[0-9]
632 doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9]
633 fi
634
635 dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES}
636 use doc && dohtml -r "${S}"/doc/*
637 use epydoc && dohtml -r "${WORKDIR}"/api
638
639 dodir /usr/bin
640 for x in ebuild egencache emerge portageq quickpkg repoman ; do
641 dosym ../${libdir}/portage/bin/${x} /usr/bin/${x}
642 done
643
644 dodir /usr/sbin
645 local my_syms="archive-conf
646 dispatch-conf
647 emaint
648 emerge-webrsync
649 env-update
650 etc-update
651 fixpackages
652 regenworld"
653 local x
654 for x in ${my_syms}; do
655 dosym ../${libdir}/portage/bin/${x} /usr/sbin/${x}
656 done
657 dosym env-update /usr/sbin/update-env
658 dosym etc-update /usr/sbin/update-etc
659
660 dodir /etc/portage
661 keepdir /etc/portage
662 }
663
664 pkg_preinst() {
665 if ! use build && ! has_version dev-python/pycrypto && \
666 ! has_version '>=dev-lang/python-2.6[ssl]' ; then
667 ewarn "If you are an ebuild developer and you plan to commit ebuilds"
668 ewarn "with this system then please install dev-python/pycrypto or"
669 ewarn "enable the ssl USE flag for >=dev-lang/python-2.6 in order"
670 ewarn "to enable RMD160 hash support."
671 ewarn "See bug #198398 for more information."
672 fi
673 if [ -f "${ROOT}/etc/make.globals" ]; then
674 rm "${ROOT}/etc/make.globals"
675 fi
676
677 has_version "<${CATEGORY}/${PN}-2.2_alpha"
678 MINOR_UPGRADE=$?
679
680 has_version "<=${CATEGORY}/${PN}-2.2_pre5"
681 WORLD_MIGRATION_UPGRADE=$?
682
683 # If portage-2.1.6 is installed and the preserved_libs_registry exists,
684 # assume that the NEEDED.ELF.2 files have already been generated.
685 has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \
686 ! ( [ -e "$ROOT"var/lib/portage/preserved_libs_registry ] && \
687 has_version ">=${CATEGORY}/${PN}-2.1.6_rc" )
688 NEEDED_REBUILD_UPGRADE=$?
689
690 [[ -n $PORTDIR_OVERLAY ]] && has_version "<${CATEGORY}/${PN}-2.1.6.12"
691 REPO_LAYOUT_CONF_WARN=$?
692 }
693
694 pkg_postinst() {
695 # Compile all source files recursively. Any orphans
696 # will be identified and removed in postrm.
697 python_mod_optimize /usr/$(get_libdir)/portage/pym
698
699 if [ $WORLD_MIGRATION_UPGRADE = 0 ] ; then
700 einfo "moving set references from the worldfile into world_sets"
701 cd "${ROOT}/var/lib/portage/"
702 grep "^@" world >> world_sets
703 sed -i -e '/^@/d' world
704 fi
705
706 if [ $NEEDED_REBUILD_UPGRADE = 0 ] ; then
707 einfo "rebuilding NEEDED.ELF.2 files"
708 for cpv in "${ROOT}/var/db/pkg"/*/*; do
709 if [ -f "${cpv}/NEEDED" ]; then
710 rm -f "${cpv}/NEEDED.ELF.2"
711 while read line; do
712 filename=${line% *}
713 needed=${line#* }
714 needed=${needed//+/++}
715 needed=${needed//#/##}
716 needed=${needed//%/%%}
717 newline=$(scanelf -BF "%a;%F;%S;%r;${needed}" $filename)
718 newline=${newline// - }
719 echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2"
720 done < "${cpv}/NEEDED"
721 fi
722 done
723 fi
724
725 if [ $REPO_LAYOUT_CONF_WARN = 0 ] ; then
726 ewarn
727 echo "If you want overlay eclasses to override eclasses from" \
728 "other repos then see the portage(5) man page" \
729 "for information about the new layout.conf and repos.conf" \
730 "configuration files." \
731 | fmt -w 75 | while read -r ; do ewarn "$REPLY" ; done
732 ewarn
733 fi
734
735 einfo
736 einfo "For help with using portage please consult the Gentoo Handbook"
737 einfo "at http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3"
738 einfo
739
740 if [ $MINOR_UPGRADE = 0 ] ; then
741 elog "If you're upgrading from a pre-2.2 version of portage you might"
742 elog "want to remerge world (emerge -e world) to take full advantage"
743 elog "of some of the new features in 2.2."
744 elog "This is not required however for portage to function properly."
745 elog
746 fi
747
748 if [ -z "${PV/*_alpha*}" ]; then
749 elog "If you always want to use the latest development version of portage"
750 elog "please read http://www.gentoo.org/proj/en/portage/doc/testing.xml"
751 elog
752 fi
753 }
754
755 pkg_postrm() {
756 python_mod_cleanup /usr/$(get_libdir)/portage/pym
757 }