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