Gentoo Archives: gentoo-commits

From: "Brian Dolbec (dolsen)" <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/portage: ChangeLog portage-2.2.18.ebuild
Date: Wed, 04 Mar 2015 21:16:10
Message-Id: 20150304211604.E2458130C1@oystercatcher.gentoo.org
1 dolsen 15/03/04 21:16:04
2
3 Modified: ChangeLog
4 Added: portage-2.2.18.ebuild
5 Log:
6 Version bump
7
8 (Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0xD80F5F1E1245142E)
9
10 Revision Changes Path
11 1.1432 sys-apps/portage/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1432&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1432&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?r1=1.1431&r2=1.1432
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v
20 retrieving revision 1.1431
21 retrieving revision 1.1432
22 diff -u -r1.1431 -r1.1432
23 --- ChangeLog 2 Mar 2015 09:27:01 -0000 1.1431
24 +++ ChangeLog 4 Mar 2015 21:16:04 -0000 1.1432
25 @@ -1,6 +1,12 @@
26 # ChangeLog for sys-apps/portage
27 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1431 2015/03/02 09:27:01 ago Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1432 2015/03/04 21:16:04 dolsen Exp $
30 +
31 +*portage-2.2.18 (04 Mar 2015)
32 +
33 + 04 Mar 2015; Brian Dolbec <dolsen@g.o> +portage-2.2.18.ebuild:
34 + Version bump. Fixes bugs 539706, 538980, 282639, 540882, 541188, 541198,
35 + 541302, 500436, 540482, 511806, 541746, 542052.
36
37 02 Mar 2015; Agostino Sarubbo <ago@g.o> portage-2.2.14.ebuild:
38 Stable for ppc, wrt bug #531594
39
40
41
42 1.1 sys-apps/portage/portage-2.2.18.ebuild
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.18.ebuild?rev=1.1&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.18.ebuild?rev=1.1&content-type=text/plain
46
47 Index: portage-2.2.18.ebuild
48 ===================================================================
49 # Copyright 1999-2015 Gentoo Foundation
50 # Distributed under the terms of the GNU General Public License v2
51 # $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.2.18.ebuild,v 1.1 2015/03/04 21:16:04 dolsen Exp $
52
53 EAPI=5
54
55 PYTHON_COMPAT=(
56 pypy
57 python3_2 python3_3 python3_4
58 python2_7
59 )
60 # Note: substituted below
61 PYTHON_REQ_USE='bzip2(+)'
62
63 inherit distutils-r1 multilib
64
65 DESCRIPTION="Portage is the package management and distribution system for Gentoo"
66 HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
67
68 LICENSE="GPL-2"
69 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
70 SLOT="0"
71 IUSE="build doc epydoc +ipc linguas_ru selinux xattr"
72
73 DEPEND="!build? ( ${PYTHON_DEPS//bzip2(+)/ssl(+),bzip2(+)} )
74 dev-lang/python-exec:2
75 >=sys-apps/sed-4.0.5 sys-devel/patch
76 doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
77 epydoc? ( >=dev-python/epydoc-2.0[$(python_gen_usedep 'python2*')] )"
78 # Require sandbox-2.2 for bug #288863.
79 # For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
80 # quite slow, so it's not considered in the dependencies as an alternative to
81 # to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
82 # for now, don't pull in xattr deps for other kernels.
83 # For whirlpool hash, require python[ssl] (bug #425046).
84 # For compgen, require bash[readline] (bug #445576).
85 RDEPEND="
86 dev-lang/python-exec:2
87 !build? (
88 >=sys-apps/sed-4.0.5
89 app-shells/bash:0[readline]
90 >=app-admin/eselect-1.2
91 )
92 elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
93 elibc_glibc? ( >=sys-apps/sandbox-2.2 )
94 elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
95 >=app-misc/pax-utils-0.1.17
96 selinux? ( >=sys-libs/libselinux-2.0.94[python,${PYTHON_USEDEP}] )
97 xattr? ( kernel_linux? (
98 >=sys-apps/install-xattr-0.3
99 $(python_gen_cond_dep 'dev-python/pyxattr[${PYTHON_USEDEP}]' \
100 python{2_7,3_2} pypy)
101 ) )
102 !<app-admin/logrotate-3.8.0"
103 PDEPEND="
104 !build? (
105 >=net-misc/rsync-2.6.4
106 userland_GNU? ( >=sys-apps/coreutils-6.4 )
107 )"
108 # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
109 # NOTE: FEATURES=installsources requires debugedit and rsync
110
111 REQUIRED_USE="epydoc? ( $(python_gen_useflags 'python2*') )"
112
113 SRC_ARCHIVES="http://dev.gentoo.org/~dolsen/releases/portage"
114
115 prefix_src_archives() {
116 local x y
117 for x in ${@}; do
118 for y in ${SRC_ARCHIVES}; do
119 echo ${y}/${x}
120 done
121 done
122 }
123
124 TARBALL_PV=${PV}
125 SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
126 $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)"
127
128 python_prepare_all() {
129 distutils-r1_python_prepare_all
130
131 if ! use ipc ; then
132 einfo "Disabling ipc..."
133 sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
134 -i pym/_emerge/AbstractEbuildProcess.py || \
135 die "failed to patch AbstractEbuildProcess.py"
136 fi
137
138 if use xattr && use kernel_linux ; then
139 einfo "Adding FEATURES=xattr to make.globals ..."
140 echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
141 || die "failed to append to make.globals"
142 fi
143
144 if [[ -n ${EPREFIX} ]] ; then
145 einfo "Setting portage.const.EPREFIX ..."
146 sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
147 -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
148 -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
149 -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
150 -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
151 -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
152 -i pym/portage/const.py || \
153 die "Failed to patch portage.const.EPREFIX"
154
155 einfo "Prefixing shebangs ..."
156 while read -r -d $'\0' ; do
157 local shebang=$(head -n1 "$REPLY")
158 if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
159 sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
160 die "sed failed"
161 fi
162 done < <(find . -type f -print0)
163
164 einfo "Adjusting make.globals ..."
165 sed -e "s|\(/usr/portage\)|${EPREFIX}\\1|" \
166 -e "s|^\(PORTAGE_TMPDIR=\"\)\(/var/tmp\"\)|\\1${EPREFIX}\\2|" \
167 -i cnf/make.globals || die "sed failed"
168
169 einfo "Adjusting repos.conf ..."
170 sed -e "s|^\(main-repo = \).*|\\1gentoo_prefix|" \
171 -e "s|^\\[gentoo\\]|[gentoo_prefix]|" \
172 -e "s|^\(location = \)\(/usr/portage\)|\\1${EPREFIX}\\2|" \
173 -e "s|^\(sync-uri = \).*|\\1rsync://prefix.gentooexperimental.org/gentoo-portage-prefix|" \
174 -i cnf/repos.conf || die "sed failed"
175
176 einfo "Adding FEATURES=force-prefix to make.globals ..."
177 echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
178 || die "failed to append to make.globals"
179 fi
180
181 cd "${S}/cnf" || die
182 if [ -f "make.conf.example.${ARCH}".diff ]; then
183 patch make.conf.example "make.conf.example.${ARCH}".diff || \
184 die "Failed to patch make.conf.example"
185 else
186 eerror ""
187 eerror "Portage does not have an arch-specific configuration for this arch."
188 eerror "Please notify the arch maintainer about this issue. Using generic."
189 eerror ""
190 fi
191 }
192
193 python_compile_all() {
194 local targets=()
195 use doc && targets+=( docbook )
196 use epydoc && targets+=( epydoc )
197
198 if [[ ${targets[@]} ]]; then
199 esetup.py "${targets[@]}"
200 fi
201 }
202
203 python_test() {
204 esetup.py test
205 }
206
207 python_install() {
208 # Install sbin scripts to bindir for python-exec linking
209 # they will be relocated in pkg_preinst()
210 distutils-r1_python_install \
211 --system-prefix="${EPREFIX}/usr" \
212 --bindir="$(python_get_scriptdir)" \
213 --docdir="${EPREFIX}/usr/share/doc/${PF}" \
214 --htmldir="${EPREFIX}/usr/share/doc/${PF}/html" \
215 --portage-bindir="${EPREFIX}/usr/lib/portage/${EPYTHON}" \
216 --sbindir="$(python_get_scriptdir)" \
217 --sysconfdir="${EPREFIX}/etc" \
218 "${@}"
219 }
220
221 python_install_all() {
222 distutils-r1_python_install_all
223
224 local targets=()
225 use doc && targets+=( install_docbook )
226 use epydoc && targets+=( install_epydoc )
227
228 # install docs
229 if [[ ${targets[@]} ]]; then
230 esetup.py "${targets[@]}"
231 fi
232
233 # Due to distutils/python-exec limitations
234 # these must be installed to /usr/bin.
235 local sbin_relocations='archive-conf dispatch-conf emaint env-update etc-update fixpackages regenworld'
236 einfo "Moving admin scripts to the correct directory"
237 dodir /usr/sbin
238 for target in ${sbin_relocations}; do
239 einfo "Moving /usr/bin/${target} to /usr/sbin/${target}"
240 mv "${ED}usr/bin/${target}" "${ED}usr/sbin/${target}" || die "sbin scripts move failed!"
241 done
242 }
243
244 pkg_preinst() {
245 # comment out sanity test until it is fixed to work
246 # with the new PORTAGE_PYM_PATH
247 #if [[ $ROOT == / ]] ; then
248 ## Run some minimal tests as a sanity check.
249 #local test_runner=$(find "${ED}" -name runTests)
250 #if [[ -n $test_runner && -x $test_runner ]] ; then
251 #einfo "Running preinst sanity tests..."
252 #"$test_runner" || die "preinst sanity tests failed"
253 #fi
254 #fi
255
256 # elog dir must exist to avoid logrotate error for bug #415911.
257 # This code runs in preinst in order to bypass the mapping of
258 # portage:portage to root:root which happens after src_install.
259 keepdir /var/log/portage/elog
260 # This is allowed to fail if the user/group are invalid for prefix users.
261 if chown portage:portage "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
262 chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
263 fi
264
265 if has_version "<${CATEGORY}/${PN}-2.1.13" || \
266 {
267 has_version ">=${CATEGORY}/${PN}-2.2_rc0" && \
268 has_version "<${CATEGORY}/${PN}-2.2.0_alpha189"
269 } ; then
270 USERPRIV_UPGRADE=true
271 USERSYNC_UPGRADE=true
272 REPOS_CONF_UPGRADE=true
273 REPOS_CONF_SYNC=
274 type -P portageq >/dev/null 2>&1 && \
275 REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
276 else
277 USERPRIV_UPGRADE=false
278 USERSYNC_UPGRADE=false
279 REPOS_CONF_UPGRADE=false
280 fi
281 }
282
283 get_ownership() {
284 case ${USERLAND} in
285 BSD)
286 stat -f '%Su:%Sg' "${1}"
287 ;;
288 *)
289 stat -c '%U:%G' "${1}"
290 ;;
291 esac
292 }
293
294 new_config_protect() {
295 # Generate a ._cfg file even if the target file
296 # does not exist, ensuring that the user will
297 # notice the config change.
298 local basename=${1##*/}
299 local dirname=${1%/*}
300 local i=0
301 while true ; do
302 local filename=$(
303 echo -n "${dirname}/._cfg"
304 printf "%04d" ${i}
305 echo -n "_${basename}"
306 )
307 [[ -e ${filename} ]] || break
308 (( i++ ))
309 done
310 echo "${filename}"
311 }
312
313 pkg_postinst() {
314
315 if ${REPOS_CONF_UPGRADE} ; then
316 einfo "Generating repos.conf"
317 local repo_name=
318 [[ -f ${PORTDIR}/profiles/repo_name ]] && \
319 repo_name=$(< "${PORTDIR}/profiles/repo_name")
320 if [[ -z ${REPOS_CONF_SYNC} ]] ; then
321 REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
322 REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
323 fi
324 local sync_type=
325 [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
326
327 if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
328 sync_type=cvs
329 REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
330 fi
331
332 cat <<-EOF > "${T}/repos.conf"
333 [DEFAULT]
334 main-repo = ${repo_name:-gentoo}
335
336 [${repo_name:-gentoo}]
337 location = ${PORTDIR:-${EPREFIX}/usr/portage}
338 sync-type = ${sync_type:-rsync}
339 sync-uri = ${REPOS_CONF_SYNC}
340 EOF
341
342 [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
343
344 local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
345 if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
346 dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
347 fi
348 # Don't install the config update if the desired repos.conf directory
349 # and config file exist, since users may accept it blindly and break
350 # their config (bug #478726).
351 [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
352 mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
353
354 if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
355 einfo "Generating make.conf PORTDIR setting for backward compatibility"
356 for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
357 [[ -e ${dest} ]] && break
358 done
359 [[ -d ${dest} ]] && dest=${dest}/portdir.conf
360 rm -rf "${T}/make.conf"
361 [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
362 cat <<-EOF >> "${T}/make.conf"
363
364 # Set PORTDIR for backward compatibility with various tools:
365 # gentoo-bashcomp - bug #478444
366 # euse - bug #474574
367 # euses and ufed - bug #478318
368 PORTDIR="${EPREFIX}/usr/portage"
369 EOF
370 mkdir -p "${dest%/*}"
371 mv "${T}/make.conf" "$(new_config_protect "${dest}")"
372 fi
373 fi
374
375 local distdir=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
376
377 if ${USERSYNC_UPGRADE} && \
378 [[ -d ${PORTDIR} && -w ${PORTDIR} ]] ; then
379 local ownership=$(get_ownership "${PORTDIR}")
380 if [[ -n ${ownership} ]] ; then
381 einfo "Adjusting PORTDIR permissions for usersync"
382 find "${PORTDIR}" -path "${distdir%/}" -prune -o \
383 ! \( -user "${ownership%:*}" -a -group "${ownership#*:}" \) \
384 -exec chown "${ownership}" {} +
385 fi
386 fi
387
388 # Do this last, since it could take a long time if there
389 # are lots of live sources, and the user may be tempted
390 # to kill emerge while it is running.
391 if ${USERPRIV_UPGRADE} && \
392 [[ -d ${distdir} && -w ${distdir} ]] ; then
393 local ownership=$(get_ownership "${distdir}")
394 if [[ ${ownership#*:} == portage ]] ; then
395 einfo "Adjusting DISTDIR permissions for userpriv"
396 find "${distdir}" -mindepth 1 -maxdepth 1 -type d -uid 0 \
397 -exec chown -R portage:portage {} +
398 fi
399 fi
400 }