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