Gentoo Archives: gentoo-commits

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