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