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