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