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_alpha176.ebuild ChangeLog portage-2.2.0_alpha174.ebuild
Date: Sun, 19 May 2013 00:14:33
Message-Id: 20130519001430.3BA5E2171D@flycatcher.gentoo.org
1 zmedico 13/05/19 00:14:30
2
3 Modified: ChangeLog
4 Added: portage-2.2.0_alpha176.ebuild
5 Removed: portage-2.2.0_alpha174.ebuild
6 Log:
7 2.2.0_alpha176 version bump. This includes all of the fixes in 2.1.12.1.
8 Bug #210077 tracks all bugs fixed since portage-2.1.x.
9
10 (Portage version: 2.1.12.1/cvs/Linux i686, signed Manifest commit with key 0xFDE8EF85AE5719A3)
11
12 Revision Changes Path
13 1.1269 sys-apps/portage/ChangeLog
14
15 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1269&view=markup
16 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?rev=1.1269&content-type=text/plain
17 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/ChangeLog?r1=1.1268&r2=1.1269
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v
22 retrieving revision 1.1268
23 retrieving revision 1.1269
24 diff -u -r1.1268 -r1.1269
25 --- ChangeLog 19 May 2013 00:12:51 -0000 1.1268
26 +++ ChangeLog 19 May 2013 00:14:30 -0000 1.1269
27 @@ -1,6 +1,13 @@
28 # ChangeLog for sys-apps/portage
29 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
30 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1268 2013/05/19 00:12:51 zmedico Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/ChangeLog,v 1.1269 2013/05/19 00:14:30 zmedico Exp $
32 +
33 +*portage-2.2.0_alpha176 (19 May 2013)
34 +
35 + 19 May 2013; Zac Medico <zmedico@g.o> +portage-2.2.0_alpha176.ebuild,
36 + -portage-2.2.0_alpha174.ebuild:
37 + 2.2.0_alpha176 version bump. This includes all of the fixes in 2.1.12.1. Bug
38 + #210077 tracks all bugs fixed since portage-2.1.x.
39
40 *portage-2.1.12.1 (19 May 2013)
41
42
43
44
45 1.1 sys-apps/portage/portage-2.2.0_alpha176.ebuild
46
47 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha176.ebuild?rev=1.1&view=markup
48 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha176.ebuild?rev=1.1&content-type=text/plain
49
50 Index: portage-2.2.0_alpha176.ebuild
51 ===================================================================
52 # Copyright 1999-2013 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 # $Header: /var/cvsroot/gentoo-x86/sys-apps/portage/portage-2.2.0_alpha176.ebuild,v 1.1 2013/05/19 00:14:30 zmedico Exp $
55
56 # Require EAPI 2 since we now require at least python-2.6 (for python 3
57 # syntax support) which also requires EAPI 2.
58 EAPI=3
59 PYTHON_COMPAT=(
60 pypy1_9 pypy2_0
61 python3_1 python3_2 python3_3 python3_4
62 python2_6 python2_7
63 )
64 inherit eutils multilib
65
66 DESCRIPTION="Portage is the package management and distribution system for Gentoo"
67 HOMEPAGE="http://www.gentoo.org/proj/en/portage/index.xml"
68 LICENSE="GPL-2"
69 KEYWORDS="~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
70 SLOT="0"
71 IUSE="build doc epydoc +ipc linguas_pl linguas_ru pypy2_0 python2 python3 selinux xattr"
72
73 for _pyimpl in ${PYTHON_COMPAT[@]} ; do
74 IUSE+=" python_targets_${_pyimpl}"
75 done
76 unset _pyimpl
77
78 # Import of the io module in python-2.6 raises ImportError for the
79 # thread module if threading is disabled.
80 python_dep_ssl="python3? ( =dev-lang/python-3*[ssl] )
81 !pypy2_0? ( !python2? ( !python3? (
82 || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] )
83 ) ) )
84 pypy2_0? ( !python2? ( !python3? ( dev-python/pypy:2.0[bzip2,ssl] ) ) )
85 python2? ( !python3? ( || ( dev-lang/python:2.7[ssl] dev-lang/python:2.6[ssl,threads] ) ) )"
86 python_dep="${python_dep_ssl//\[ssl\]}"
87 python_dep="${python_dep//,ssl}"
88 python_dep="${python_dep//ssl,}"
89
90 python_dep="${python_dep}
91 python_targets_pypy1_9? ( dev-python/pypy:1.9 )
92 python_targets_pypy2_0? ( dev-python/pypy:2.0 )
93 python_targets_python2_6? ( dev-lang/python:2.6 )
94 python_targets_python2_7? ( dev-lang/python:2.7 )
95 python_targets_python3_1? ( dev-lang/python:3.1 )
96 python_targets_python3_2? ( dev-lang/python:3.2 )
97 python_targets_python3_3? ( dev-lang/python:3.3 )
98 python_targets_python3_4? ( dev-lang/python:3.4 )
99 "
100
101 # The pysqlite blocker is for bug #282760.
102 # make-3.82 is for bug #455858
103 DEPEND="${python_dep}
104 >=sys-devel/make-3.82
105 >=sys-apps/sed-4.0.5 sys-devel/patch
106 doc? ( app-text/xmlto ~app-text/docbook-xml-dtd-4.4 )
107 epydoc? ( >=dev-python/epydoc-2.0 !<=dev-python/pysqlite-2.4.1 )"
108 # Require sandbox-2.2 for bug #288863.
109 # For xattr, we can spawn getfattr and setfattr from sys-apps/attr, but that's
110 # quite slow, so it's not considered in the dependencies as an alternative to
111 # to python-3.3 / pyxattr. Also, xattr support is only tested with Linux, so
112 # for now, don't pull in xattr deps for other kernels.
113 # For whirlpool hash, require python[ssl] or python-mhash (bug #425046).
114 # For compgen, require bash[readline] (bug #445576).
115 RDEPEND="${python_dep}
116 !build? ( >=sys-apps/sed-4.0.5
117 || ( >=app-shells/bash-4.2_p37[readline] ( <app-shells/bash-4.2_p37 >=app-shells/bash-3.2_p17 ) )
118 >=app-admin/eselect-1.2
119 || ( ${python_dep_ssl} dev-python/python-mhash )
120 )
121 elibc_FreeBSD? ( sys-freebsd/freebsd-bin )
122 elibc_glibc? ( >=sys-apps/sandbox-2.2 )
123 elibc_uclibc? ( >=sys-apps/sandbox-2.2 )
124 >=app-misc/pax-utils-0.1.17
125 xattr? ( kernel_linux? ( || ( >=dev-lang/python-3.3_pre20110902 dev-python/pyxattr ) ) )
126 selinux? ( || ( >=sys-libs/libselinux-2.0.94[python] <sys-libs/libselinux-2.0.94 ) )
127 !<app-shells/bash-3.2_p17
128 !<app-admin/logrotate-3.8.0"
129 PDEPEND="
130 !build? (
131 >=net-misc/rsync-2.6.4
132 userland_GNU? ( >=sys-apps/coreutils-6.4 )
133 )"
134 # coreutils-6.4 rdep is for date format in emerge-webrsync #164532
135 # NOTE: FEATURES=installsources requires debugedit and rsync
136
137 SRC_ARCHIVES="http://dev.gentoo.org/~zmedico/portage/archives"
138
139 prefix_src_archives() {
140 local x y
141 for x in ${@}; do
142 for y in ${SRC_ARCHIVES}; do
143 echo ${y}/${x}
144 done
145 done
146 }
147
148 PV_PL="2.1.2"
149 PATCHVER_PL=""
150 TARBALL_PV=2.2.0_alpha175
151 SRC_URI="mirror://gentoo/${PN}-${TARBALL_PV}.tar.bz2
152 $(prefix_src_archives ${PN}-${TARBALL_PV}.tar.bz2)
153 linguas_pl? ( mirror://gentoo/${PN}-man-pl-${PV_PL}.tar.bz2
154 $(prefix_src_archives ${PN}-man-pl-${PV_PL}.tar.bz2) )"
155
156 PATCHVER=
157 [[ $TARBALL_PV = $PV ]] || PATCHVER=$PV
158 if [ -n "${PATCHVER}" ]; then
159 SRC_URI="${SRC_URI} mirror://gentoo/${PN}-${PATCHVER}.patch.bz2
160 $(prefix_src_archives ${PN}-${PATCHVER}.patch.bz2)"
161 fi
162
163 S="${WORKDIR}"/${PN}-${TARBALL_PV}
164 S_PL="${WORKDIR}"/${PN}-${PV_PL}
165
166 compatible_python_is_selected() {
167 [[ $("${EPREFIX}/usr/bin/python" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x2060000 and "good" or "bad")') = good ]]
168 }
169
170 current_python_has_xattr() {
171 [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
172 local PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
173 [[ $("${PYTHON}" -c 'import sys ; sys.stdout.write(sys.hexversion >= 0x3030000 and "yes" or "no")') = yes ]] || \
174 "${PYTHON}" -c 'import xattr' 2>/dev/null
175 }
176
177 call_with_python_impl() {
178 [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
179 env EPYTHON=${EPYTHON} "$@"
180 }
181
182 get_python_interpreter() {
183 [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
184 local impl=$1 python
185 case "${impl}" in
186 python*)
187 python=${impl/_/.}
188 ;;
189 pypy*)
190 python=${impl/_/.}
191 python=${python/pypy/pypy-c}
192 ;;
193 *)
194 die "Unrecognized python target: ${impl}"
195 esac
196 echo ${python}
197 }
198
199 get_python_sitedir() {
200 [ $# -eq 1 ] || die "expected 1 argument, got $#: $*"
201 local impl=$1
202 local site_dir=/usr/$(get_libdir)/${impl/_/.}/site-packages
203 [[ -d ${EROOT}${site_dir} ]] || \
204 ewarn "site-packages dir missing for ${impl}: ${EROOT}${site_dir}"
205 echo "${site_dir}"
206 }
207
208 python_compileall() {
209 [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
210 local d=${EPREFIX}$1 PYTHON=${EPREFIX}/usr/bin/${EPYTHON}
211 local d_image=${D}${d#/}
212 [[ -d ${d_image} ]] || die "directory does not exist: ${d_image}"
213 case "${EPYTHON}" in
214 python*)
215 "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
216 # Note: Using -OO breaks emaint, since it requires __doc__,
217 # and __doc__ is None when -OO is used.
218 "${PYTHON}" -O -m compileall -q -f -d "${d}" "${d_image}" || die
219 ;;
220 pypy*)
221 "${PYTHON}" -m compileall -q -f -d "${d}" "${d_image}" || die
222 ;;
223 *)
224 die "Unrecognized EPYTHON value: ${EPYTHON}"
225 esac
226 }
227
228 pkg_setup() {
229 if use python2 && use python3 ; then
230 ewarn "Both python2 and python3 USE flags are enabled, but only one"
231 ewarn "can be in the shebangs. Using python3."
232 fi
233 if use pypy2_0 && use python3 ; then
234 ewarn "Both pypy2_0 and python3 USE flags are enabled, but only one"
235 ewarn "can be in the shebangs. Using python3."
236 fi
237 if use pypy2_0 && use python2 ; then
238 ewarn "Both pypy2_0 and python2 USE flags are enabled, but only one"
239 ewarn "can be in the shebangs. Using python2"
240 fi
241 if ! use pypy2_0 && ! use python2 && ! use python3 && \
242 ! compatible_python_is_selected ; then
243 ewarn "Attempting to select a compatible default python interpreter"
244 local x success=0
245 for x in "${EPREFIX}"/usr/bin/python2.* ; do
246 x=${x#${EPREFIX}/usr/bin/python2.}
247 if [[ $x -ge 6 ]] 2>/dev/null ; then
248 eselect python set python2.$x
249 if compatible_python_is_selected ; then
250 elog "Default python interpreter is now set to python-2.$x"
251 success=1
252 break
253 fi
254 fi
255 done
256 if [ $success != 1 ] ; then
257 eerror "Unable to select a compatible default python interpreter!"
258 die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
259 fi
260 fi
261
262 # We use EPYTHON to designate the active python interpreter,
263 # but we only export when needed, via call_with_python_impl.
264 EPYTHON=python
265 export -n EPYTHON
266 if use python3; then
267 EPYTHON=python3
268 elif use python2; then
269 EPYTHON=python2
270 elif use pypy2_0; then
271 EPYTHON=pypy-c2.0
272 fi
273 }
274
275 src_prepare() {
276 if [ -n "${PATCHVER}" ] ; then
277 if [[ -L $S/bin/ebuild-helpers/portageq ]] ; then
278 rm "$S/bin/ebuild-helpers/portageq" \
279 || die "failed to remove portageq helper symlink"
280 fi
281 epatch "${WORKDIR}/${PN}-${PATCHVER}.patch"
282 fi
283 einfo "Setting portage.VERSION to ${PVR} ..."
284 sed -e "s/^VERSION=.*/VERSION=\"${PVR}\"/" -i pym/portage/__init__.py || \
285 die "Failed to patch portage.VERSION"
286 sed -e "1s/VERSION/${PVR}/" -i doc/fragment/version || \
287 die "Failed to patch VERSION in doc/fragment/version"
288 sed -e "1s/VERSION/${PVR}/" -i $(find man -type f) || \
289 die "Failed to patch VERSION in man page headers"
290
291 if ! use ipc ; then
292 einfo "Disabling ipc..."
293 sed -e "s:_enable_ipc_daemon = True:_enable_ipc_daemon = False:" \
294 -i pym/_emerge/AbstractEbuildProcess.py || \
295 die "failed to patch AbstractEbuildProcess.py"
296 fi
297
298 if use xattr && use kernel_linux ; then
299 einfo "Adding FEATURES=xattr to make.globals ..."
300 echo -e '\nFEATURES="${FEATURES} xattr"' >> cnf/make.globals \
301 || die "failed to append to make.globals"
302 fi
303
304 local set_shebang=
305 if use python3; then
306 set_shebang=python3
307 elif use python2; then
308 set_shebang=python2
309 elif use pypy2_0; then
310 set_shebang=pypy-c2.0
311 fi
312 if [[ -n ${set_shebang} ]] ; then
313 einfo "Converting shebangs for ${set_shebang}..."
314 while read -r -d $'\0' ; do
315 local shebang=$(head -n1 "$REPLY")
316 if [[ ${shebang} == "#!/usr/bin/python"* ]] ; then
317 sed -i -e "1s:python:${set_shebang}:" "$REPLY" || \
318 die "sed failed"
319 fi
320 done < <(find . -type f -print0)
321 fi
322
323 if [[ -n ${EPREFIX} ]] ; then
324 einfo "Setting portage.const.EPREFIX ..."
325 sed -e "s|^\(SANDBOX_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/sandbox\"\)|\\1${EPREFIX}\\2|" \
326 -e "s|^\(FAKEROOT_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/bin/fakeroot\"\)|\\1${EPREFIX}\\2|" \
327 -e "s|^\(BASH_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/bash\"\)|\\1${EPREFIX}\\2|" \
328 -e "s|^\(MOVE_BINARY[[:space:]]*=[[:space:]]*\"\)\(/bin/mv\"\)|\\1${EPREFIX}\\2|" \
329 -e "s|^\(PRELINK_BINARY[[:space:]]*=[[:space:]]*\"\)\(/usr/sbin/prelink\"\)|\\1${EPREFIX}\\2|" \
330 -e "s|^\(EPREFIX[[:space:]]*=[[:space:]]*\"\).*|\\1${EPREFIX}\"|" \
331 -i pym/portage/const.py || \
332 die "Failed to patch portage.const.EPREFIX"
333
334 einfo "Prefixing shebangs ..."
335 while read -r -d $'\0' ; do
336 local shebang=$(head -n1 "$REPLY")
337 if [[ ${shebang} == "#!"* && ! ${shebang} == "#!${EPREFIX}/"* ]] ; then
338 sed -i -e "1s:.*:#!${EPREFIX}${shebang:2}:" "$REPLY" || \
339 die "sed failed"
340 fi
341 done < <(find . -type f -print0)
342
343 einfo "Adjusting make.globals ..."
344 sed -e 's|^SYNC=.*|SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"|' \
345 -e "s|^\(PORTDIR=\)\(/usr/portage\)|\\1\"${EPREFIX}\\2\"|" \
346 -e "s|^\(PORTAGE_TMPDIR=\)\(/var/tmp\)|\\1\"${EPREFIX}\\2\"|" \
347 -i cnf/make.globals || die "sed failed"
348
349 einfo "Adding FEATURES=force-prefix to make.globals ..."
350 echo -e '\nFEATURES="${FEATURES} force-prefix"' >> cnf/make.globals \
351 || die "failed to append to make.globals"
352 fi
353
354 cd "${S}/cnf" || die
355 if [ -f "make.conf.${ARCH}".diff ]; then
356 patch make.conf "make.conf.${ARCH}".diff || \
357 die "Failed to patch make.conf.example"
358 else
359 eerror ""
360 eerror "Portage does not have an arch-specific configuration for this arch."
361 eerror "Please notify the arch maintainer about this issue. Using generic."
362 eerror ""
363 fi
364 }
365
366 src_compile() {
367 if use doc; then
368 call_with_python_impl \
369 emake docbook || die
370 fi
371
372 if use epydoc; then
373 einfo "Generating api docs"
374 call_with_python_impl \
375 emake epydoc || die
376 fi
377 }
378
379 src_test() {
380 # make files executable, in case they were created by patch
381 find bin -type f | xargs chmod +x
382 call_with_python_impl \
383 emake test || die
384 }
385
386 src_install() {
387 call_with_python_impl \
388 emake DESTDIR="${D}" \
389 sysconfdir="${EPREFIX}/etc" \
390 prefix="${EPREFIX}/usr" \
391 install || die
392
393 # Use dodoc for compression, since the Makefile doesn't do that.
394 dodoc "${S}"/{ChangeLog,NEWS,RELEASE-NOTES} || die
395
396 if use linguas_pl; then
397 doman -i18n=pl "${S_PL}"/man/pl/*.[0-9] || die
398 doman -i18n=pl_PL.UTF-8 "${S_PL}"/man/pl_PL.UTF-8/*.[0-9] || die
399 fi
400
401 # Allow external portage API consumers to import portage python modules
402 # (this used to be done with PYTHONPATH setting in /etc/env.d).
403 # For each of PYTHON_TARGETS, install a tree of *.py symlinks in
404 # site-packages, and compile with the corresponding interpreter.
405 local impl files mod_dir dest_mod_dir python relative_path x
406 for impl in "${PYTHON_COMPAT[@]}" ; do
407 use "python_targets_${impl}" || continue
408 if use build && [[ ${ROOT} == / &&
409 ! -x ${EPREFIX}/usr/bin/$(get_python_interpreter ${impl}) ]] ; then
410 # Tolerate --nodeps at beginning of stage1 for catalyst
411 ewarn "skipping python_targets_${impl}, interpreter not found"
412 continue
413 fi
414 while read -r mod_dir ; do
415 cd "${ED}/usr/lib/portage/pym/${mod_dir}" || die
416 files=$(echo *.py)
417 if [ -z "${files}" ] || [ "${files}" = "*.py" ]; then
418 # __pycache__ directories contain no py files
419 continue
420 fi
421 dest_mod_dir=$(get_python_sitedir ${impl})/${mod_dir}
422 dodir "${dest_mod_dir}" || die
423 relative_path=../../../lib/portage/pym/${mod_dir}
424 x=/${mod_dir}
425 while [ -n "${x}" ] ; do
426 relative_path=../${relative_path}
427 x=${x%/*}
428 done
429 for x in ${files} ; do
430 dosym "${relative_path}/${x}" \
431 "${dest_mod_dir}/${x}" || die
432 done
433 done < <(cd "${ED}"/usr/lib/portage/pym || die ; find * -type d ! -path "portage/tests*")
434 cd "${S}" || die
435 EPYTHON=$(get_python_interpreter ${impl}) \
436 python_compileall "$(get_python_sitedir ${impl})"
437 done
438
439 # Compile /usr/lib/portage/pym with the active interpreter, since portage
440 # internal commands force this directory to the beginning of sys.path.
441 python_compileall /usr/lib/portage/pym
442 }
443
444 pkg_preinst() {
445 if [[ $ROOT == / ]] ; then
446 # Run some minimal tests as a sanity check.
447 local test_runner=$(find "$ED" -name runTests)
448 if [[ -n $test_runner && -x $test_runner ]] ; then
449 einfo "Running preinst sanity tests..."
450 "$test_runner" || die "preinst sanity tests failed"
451 fi
452 fi
453
454 if use xattr && ! current_python_has_xattr ; then
455 ewarn "For optimal performance in xattr handling, install"
456 ewarn "dev-python/pyxattr, or install >=dev-lang/python-3.3 and"
457 ewarn "enable USE=python3 for $CATEGORY/$PN."
458 fi
459
460 # elog dir must exist to avoid logrotate error for bug #415911.
461 # This code runs in preinst in order to bypass the mapping of
462 # portage:portage to root:root which happens after src_install.
463 keepdir /var/log/portage/elog
464 # This is allowed to fail if the user/group are invalid for prefix users.
465 if chown portage:portage "${ED}"var/log/portage{,/elog} 2>/dev/null ; then
466 chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
467 fi
468
469 has_version "<=${CATEGORY}/${PN}-2.2_pre5" \
470 && WORLD_MIGRATION_UPGRADE=true || WORLD_MIGRATION_UPGRADE=false
471
472 # If portage-2.1.6 is installed and the preserved_libs_registry exists,
473 # assume that the NEEDED.ELF.2 files have already been generated.
474 has_version "<=${CATEGORY}/${PN}-2.2_pre7" && \
475 ! { [ -e "${EROOT}"var/lib/portage/preserved_libs_registry ] && \
476 has_version ">=${CATEGORY}/${PN}-2.1.6_rc" ; } \
477 && NEEDED_REBUILD_UPGRADE=true || NEEDED_REBUILD_UPGRADE=false
478 }
479
480 pkg_postinst() {
481 if $WORLD_MIGRATION_UPGRADE && \
482 grep -q "^@" "${EROOT}/var/lib/portage/world"; then
483 einfo "moving set references from the worldfile into world_sets"
484 cd "${EROOT}/var/lib/portage/"
485 grep "^@" world >> world_sets
486 sed -i -e '/^@/d' world
487 fi
488
489 if ${NEEDED_REBUILD_UPGRADE} ; then
490 einfo "rebuilding NEEDED.ELF.2 files"
491 local cpv filename line newline
492 for cpv in "${EROOT}/var/db/pkg"/*/*; do
493 [[ -f "${cpv}/NEEDED" && ! -f "${cpv}/NEEDED.ELF.2" ]] || continue
494 while read -r line; do
495 filename=${line% *}
496 newline=$(scanelf -BF "%a;%F;%S;%r;%n" "${ROOT%/}${filename}")
497 newline=${newline// - }
498 [[ ${#ROOT} -gt 1 ]] && newline=${newline/${ROOT%/}}
499 echo "${newline:3}" >> "${cpv}/NEEDED.ELF.2"
500 done < "${cpv}/NEEDED"
501 done
502 fi
503 }