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