2 # Copyright 1999-2013 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
7 export _E_EXEDESTTREE_=""
8 export _E_DOCDESTTREE_=""
9 export INSOPTIONS="-m0644"
10 export EXEOPTIONS="-m0755"
11 export LIBOPTIONS="-m0644"
12 export DIROPTIONS="-m0755"
14 declare -a PORTAGE_DOCOMPRESS=( /usr/share/{doc,info,man} )
15 declare -a PORTAGE_DOCOMPRESS_SKIP=( /usr/share/doc/${PF}/html )
18 if [ "$1" == "/" ]; then
22 if ! ___eapi_has_prefix_variables; then
25 if [ ! -d "${ED}${DESTTREE}" ]; then
26 install -d "${ED}${DESTTREE}"
28 if [[ $ret -ne 0 ]] ; then
29 __helpers_die "${FUNCNAME[0]} failed"
37 if [ "$1" == "/" ]; then
41 if ! ___eapi_has_prefix_variables; then
44 if [ ! -d "${ED}${INSDESTTREE}" ]; then
45 install -d "${ED}${INSDESTTREE}"
47 if [[ $ret -ne 0 ]] ; then
48 __helpers_die "${FUNCNAME[0]} failed"
56 if [ "$1" == "/" ]; then
57 export _E_EXEDESTTREE_=""
59 export _E_EXEDESTTREE_="$1"
60 if ! ___eapi_has_prefix_variables; then
63 if [ ! -d "${ED}${_E_EXEDESTTREE_}" ]; then
64 install -d "${ED}${_E_EXEDESTTREE_}"
66 if [[ $ret -ne 0 ]] ; then
67 __helpers_die "${FUNCNAME[0]} failed"
75 if [ "$1" == "/" ]; then
76 export _E_DOCDESTTREE_=""
78 export _E_DOCDESTTREE_="$1"
79 if ! ___eapi_has_prefix_variables; then
82 if [ ! -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}" ]; then
83 install -d "${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
85 if [[ $ret -ne 0 ]] ; then
86 __helpers_die "${FUNCNAME[0]} failed"
94 export INSOPTIONS="$@"
96 # `install` should never be called with '-s' ...
97 has -s ${INSOPTIONS} && die "Never call insopts() with -s"
101 export DIROPTIONS="$@"
105 export EXEOPTIONS="$@"
107 # `install` should never be called with '-s' ...
108 has -s ${EXEOPTIONS} && die "Never call exeopts() with -s"
112 export LIBOPTIONS="$@"
114 # `install` should never be called with '-s' ...
115 has -s ${LIBOPTIONS} && die "Never call libopts() with -s"
119 ___eapi_has_docompress || die "'docompress' not supported in this EAPI"
122 if [[ $1 = "-x" ]]; then
125 f=$(__strip_duplicate_slashes "${f}"); f=${f%/}
126 [[ ${f:0:1} = / ]] || f="/${f}"
127 for g in "${PORTAGE_DOCOMPRESS_SKIP[@]}"; do
128 [[ ${f} = "${g}" ]] && continue 2
130 PORTAGE_DOCOMPRESS_SKIP[${#PORTAGE_DOCOMPRESS_SKIP[@]}]=${f}
134 f=$(__strip_duplicate_slashes "${f}"); f=${f%/}
135 [[ ${f:0:1} = / ]] || f="/${f}"
136 for g in "${PORTAGE_DOCOMPRESS[@]}"; do
137 [[ ${f} = "${g}" ]] && continue 2
139 PORTAGE_DOCOMPRESS[${#PORTAGE_DOCOMPRESS[@]}]=${f}
144 # adds ".keep" files so that dirs aren't auto-cleaned
148 if ! ___eapi_has_prefix_variables; then
151 if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
153 find "$@" -type d -printf "${ED}%p/.keep_${CATEGORY}_${PN}-${SLOT%/*}\n" \
155 while read -r -d $'\0' ; do
157 die "Failed to recursively create .keep files"
161 >> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
162 die "Failed to create .keep in ${ED}${x}"
169 has $EBUILD_PHASE prerm postrm || eqawarn \
170 "QA Notice: The 'useq' function is deprecated (replaced by 'use')"
182 if ___eapi_has_usex; then
197 # if we got something like '!flag', then invert the return value
198 if [[ ${u:0:1} == "!" ]] ; then
203 if [[ $EBUILD_PHASE = depend ]] ; then
204 # TODO: Add a registration interface for eclasses to register
205 # any number of phase hooks, so that global scope eclass
206 # initialization can by migrated to phase hooks in new EAPIs.
207 # Example: add_phase_hook before pkg_setup $ECLASS_pre_pkg_setup
208 #if [[ -n $EAPI ]] && ! has "$EAPI" 0 1 2 3 ; then
209 # die "use() called during invalid phase: $EBUILD_PHASE"
213 # Make sure we have this USE flag in IUSE, but exempt binary
214 # packages for API consumers like Entropy which do not require
215 # a full profile with IUSE_IMPLICIT and stuff (see bug #456830).
216 elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE &&
217 -n $PORTAGE_INTERNAL_CALLER ]] ; then
218 if [[ ! $u =~ $PORTAGE_IUSE ]] ; then
219 if [[ ! ${EAPI} =~ ^(0|1|2|3|4|4-python|4-slot-abi)$ ]] ; then
220 # This is only strict starting with EAPI 5, since implicit IUSE
221 # is not well defined for earlier EAPIs (see bug #449708).
222 die "USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}"
224 eqawarn "QA Notice: USE Flag '${u}' not" \
225 "in IUSE for ${CATEGORY}/${PF}"
229 local IFS=$' \t\n' prev_shopts=$- ret
231 if has ${u} ${USE} ; then
236 [[ ${prev_shopts} == *f* ]] || set +f
242 echo "!!! use_with() called without a parameter." >&2
243 echo "!!! use_with <USEFLAG> [<flagname> [value]]" >&2
247 if ___eapi_use_enable_and_use_with_support_empty_third_argument; then
248 local UW_SUFFIX=${3+=$3}
250 local UW_SUFFIX=${3:+=$3}
255 echo "--with-${UWORD}${UW_SUFFIX}"
257 echo "--without-${UWORD}"
264 echo "!!! use_enable() called without a parameter." >&2
265 echo "!!! use_enable <USEFLAG> [<flagname> [value]]" >&2
269 if ___eapi_use_enable_and_use_with_support_empty_third_argument; then
270 local UE_SUFFIX=${3+=$3}
272 local UE_SUFFIX=${3:+=$3}
277 echo "--enable-${UWORD}${UE_SUFFIX}"
279 echo "--disable-${UWORD}"
290 local eapi=${EAPI:-0}
291 [ -z "$*" ] && die "Nothing passed to the 'unpack' command"
294 __vecho ">>> Unpacking ${x} to ${PWD}"
296 suffix=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${suffix}")
299 y=$(LC_ALL=C tr "[:upper:]" "[:lower:]" <<< "${y}")
301 if [[ ${x} == "./"* ]] ; then
303 elif [[ ${x} == ${DISTDIR%/}/* ]] ; then
304 die "Arguments to unpack() cannot begin with \${DISTDIR}."
305 elif [[ ${x} == "/"* ]] ; then
306 die "Arguments to unpack() cannot be absolute"
310 [[ ! -s ${srcdir}${x} ]] && die "${x} does not exist"
313 if [ "${y}" == "tar" ]; then
314 $1 -c -- "$srcdir$x" | tar xof -
315 __assert_sigpipe_ok "$myfail"
317 local cwd_dest=${x##*/}
318 cwd_dest=${cwd_dest%.*}
319 $1 -c -- "${srcdir}${x}" > "${cwd_dest}" || die "$myfail"
323 myfail="failure unpacking ${x}"
326 tar xof "$srcdir$x" || die "$myfail"
329 tar xozf "$srcdir$x" || die "$myfail"
332 ${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d} -c -- "$srcdir$x" | tar xof -
333 __assert_sigpipe_ok "$myfail"
336 # unzip will interactively prompt under some error conditions,
337 # as reported in bug #336285
338 ( set +x ; while true ; do echo n || break ; done ) | \
339 unzip -qo "${srcdir}${x}" || die "$myfail"
342 __unpack_tar "gzip -d"
345 __unpack_tar "${PORTAGE_BUNZIP2_COMMAND:-${PORTAGE_BZIP2_COMMAND} -d}"
349 my_output="$(7z x -y "${srcdir}${x}")"
350 if [ $? -ne 0 ]; then
351 echo "${my_output}" >&2
356 unrar x -idq -o+ "${srcdir}${x}" || die "$myfail"
359 lha xfq "${srcdir}${x}" || die "$myfail"
362 ar x "${srcdir}${x}" || die "$myfail"
365 # Unpacking .deb archives can not always be done with
366 # `ar`. For instance on AIX this doesn't work out. If
367 # we have `deb2targz` installed, prefer it over `ar` for
368 # that reason. We just make sure on AIX `deb2targz` is
370 if type -P deb2targz > /dev/null; then
372 local created_symlink=0
373 if [ ! "$srcdir$x" -ef "$y" ] ; then
374 # deb2targz always extracts into the same directory as
375 # the source file, so create a symlink in the current
376 # working directory if necessary.
377 ln -sf "$srcdir$x" "$y" || die "$myfail"
380 deb2targz "$y" || die "$myfail"
381 if [ $created_symlink = 1 ] ; then
382 # Clean up the symlink so the ebuild
383 # doesn't inadvertently install it.
386 mv -f "${y%.deb}".tar.gz data.tar.gz || die "$myfail"
388 ar x "$srcdir$x" || die "$myfail"
392 __unpack_tar "lzma -d"
395 if ___eapi_unpack_supports_xz; then
398 __vecho "unpack ${x}: file format not recognized. Ignoring."
402 __vecho "unpack ${x}: file format not recognized. Ignoring."
406 # Do not chmod '.' since it's probably ${WORKDIR} and PORTAGE_WORKDIR_MODE
407 # should be preserved.
408 find . -mindepth 1 -maxdepth 1 ! -type l -print0 | \
409 ${XARGS} -0 chmod -fR a+rX,u+w,g-w,o-w
415 if ! ___eapi_has_prefix_variables; then
422 for x ; do [[ ${x} == ${s} ]] && echo "${x}" && return 0 ; done
426 __hasgq() { __hasg "$@" >/dev/null ; }
428 local phase_func=$(__ebuild_arg_to_phase "$EBUILD_PHASE")
429 if [[ -n $phase_func ]] ; then
430 if ! ___eapi_has_src_configure; then
431 [[ $phase_func != src_compile ]] && \
432 eqawarn "QA Notice: econf called in" \
433 "$phase_func instead of src_compile"
435 [[ $phase_func != src_configure ]] && \
436 eqawarn "QA Notice: econf called in" \
437 "$phase_func instead of src_configure"
442 if [ -x "${ECONF_SOURCE}/configure" ]; then
443 if [[ -n $CONFIG_SHELL && \
444 "$(head -n1 "$ECONF_SOURCE/configure")" =~ ^'#!'[[:space:]]*/bin/sh([[:space:]]|$) ]] ; then
445 # preserve timestamp, see bug #440304
446 touch -r "$ECONF_SOURCE/configure" "$ECONF_SOURCE/configure._portage_tmp_.$$" || die
447 sed -e "1s:^#![[:space:]]*/bin/sh:#!$CONFIG_SHELL:" -i "$ECONF_SOURCE/configure" || \
448 die "Substition of shebang in '$ECONF_SOURCE/configure' failed"
449 touch -r "$ECONF_SOURCE/configure._portage_tmp_.$$" "$ECONF_SOURCE/configure" || die
450 rm -f "$ECONF_SOURCE/configure._portage_tmp_.$$"
452 if [ -e "${EPREFIX}"/usr/share/gnuconfig/ ]; then
453 find "${WORKDIR}" -type f '(' \
454 -name config.guess -o -name config.sub ')' -print0 | \
455 while read -r -d $'\0' x ; do
456 __vecho " * econf: updating ${x/${WORKDIR}\/} with ${EPREFIX}/usr/share/gnuconfig/${x##*/}"
457 cp -f "${EPREFIX}"/usr/share/gnuconfig/"${x##*/}" "${x}"
461 if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules; then
462 local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
464 if ___eapi_econf_passes_--disable-dependency-tracking; then
465 case "${conf_help}" in
466 *--disable-dependency-tracking*)
467 set -- --disable-dependency-tracking "$@"
472 if ___eapi_econf_passes_--disable-silent-rules; then
473 case "${conf_help}" in
474 *--disable-silent-rules*)
475 set -- --disable-silent-rules "$@"
481 # if the profile defines a location to install libs to aside from default, pass it on.
482 # if the ebuild passes in --libdir, they're responsible for the conf_libdir fun.
483 local CONF_LIBDIR LIBDIR_VAR="LIBDIR_${ABI}"
484 if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
485 CONF_LIBDIR=${!LIBDIR_VAR}
487 if [[ -n ${CONF_LIBDIR} ]] && ! __hasgq --libdir=\* "$@" ; then
488 export CONF_PREFIX=$(__hasg --exec-prefix=\* "$@")
489 [[ -z ${CONF_PREFIX} ]] && CONF_PREFIX=$(__hasg --prefix=\* "$@")
490 : ${CONF_PREFIX:=${EPREFIX}/usr}
491 CONF_PREFIX=${CONF_PREFIX#*=}
492 [[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
493 [[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
494 set -- --libdir="$(__strip_duplicate_slashes "${CONF_PREFIX}${CONF_LIBDIR}")" "$@"
497 # Handle arguments containing quoted whitespace (see bug #457136).
498 eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
501 --prefix="${EPREFIX}"/usr \
502 ${CBUILD:+--build=${CBUILD}} \
504 ${CTARGET:+--target=${CTARGET}} \
505 --mandir="${EPREFIX}"/usr/share/man \
506 --infodir="${EPREFIX}"/usr/share/info \
507 --datadir="${EPREFIX}"/usr/share \
508 --sysconfdir="${EPREFIX}"/etc \
509 --localstatedir="${EPREFIX}"/var/lib \
512 __vecho "${ECONF_SOURCE}/configure" "$@"
514 if ! "${ECONF_SOURCE}/configure" "$@" ; then
516 if [ -s config.log ]; then
518 echo "!!! Please attach the following file when seeking support:"
519 echo "!!! ${PWD}/config.log"
523 elif [ -f "${ECONF_SOURCE}/configure" ]; then
524 die "configure is not executable"
526 die "no configure script found"
531 # CONF_PREFIX is only set if they didn't pass in libdir above.
532 local LOCAL_EXTRA_EINSTALL="${EXTRA_EINSTALL}"
533 if ! ___eapi_has_prefix_variables; then
536 LIBDIR_VAR="LIBDIR_${ABI}"
537 if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
538 CONF_LIBDIR="${!LIBDIR_VAR}"
541 if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:+set}" = set ]; then
542 EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}"
543 EI_DESTLIBDIR="$(__strip_duplicate_slashes "${EI_DESTLIBDIR}")"
544 LOCAL_EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${LOCAL_EXTRA_EINSTALL}"
548 if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
549 if [ "${PORTAGE_DEBUG}" == "1" ]; then
550 ${MAKE:-make} -n prefix="${ED}usr" \
551 datadir="${ED}usr/share" \
552 infodir="${ED}usr/share/info" \
553 localstatedir="${ED}var/lib" \
554 mandir="${ED}usr/share/man" \
555 sysconfdir="${ED}etc" \
556 ${LOCAL_EXTRA_EINSTALL} \
557 ${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
560 ${MAKE:-make} prefix="${ED}usr" \
561 datadir="${ED}usr/share" \
562 infodir="${ED}usr/share/info" \
563 localstatedir="${ED}var/lib" \
564 mandir="${ED}usr/share/man" \
565 sysconfdir="${ED}etc" \
566 ${LOCAL_EXTRA_EINSTALL} \
567 ${MAKEOPTS} ${EXTRA_EMAKE} -j1 \
568 "$@" install || die "einstall failed"
570 die "no Makefile found"
574 __eapi0_pkg_nofetch() {
575 [ -z "${SRC_URI}" ] && return
577 elog "The following are listed in SRC_URI for ${PN}:"
579 for x in $(echo ${SRC_URI}); do
584 __eapi0_src_unpack() {
585 [[ -n ${A} ]] && unpack ${A}
588 __eapi0_src_compile() {
589 if [ -x ./configure ] ; then
596 # Since we don't want emake's automatic die
597 # support (EAPI 4 and later), and we also don't
598 # want the warning messages that it produces if
599 # we call it in 'nonfatal' mode, we use emake_cmd
600 # to emulate the desired parts of emake behavior.
601 local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}"
603 if ___eapi_default_src_test_disables_parallel_jobs; then
604 internal_opts+=" -j1"
606 if $emake_cmd ${internal_opts} check -n &> /dev/null; then
607 __vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
608 $emake_cmd ${internal_opts} check || \
609 die "Make check failed. See above for details."
610 elif $emake_cmd ${internal_opts} test -n &> /dev/null; then
611 __vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
612 $emake_cmd ${internal_opts} test || \
613 die "Make test failed. See above for details."
615 __vecho ">>> Test phase [none]: ${CATEGORY}/${PF}"
619 __eapi1_src_compile() {
620 __eapi2_src_configure
624 __eapi2_src_configure() {
625 if [[ -x ${ECONF_SOURCE:-.}/configure ]] ; then
630 __eapi2_src_compile() {
631 if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
632 emake || die "emake failed"
636 __eapi4_src_install() {
637 if [[ -f Makefile || -f GNUmakefile || -f makefile ]] ; then
638 emake DESTDIR="${D}" install
641 if ! declare -p DOCS &>/dev/null ; then
643 for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
644 THANKS BUGS FAQ CREDITS CHANGELOG ; do
645 [[ -s "${d}" ]] && dodoc "${d}"
647 elif [[ $(declare -p DOCS) == "declare -a "* ]] ; then
654 # @FUNCTION: has_version
655 # @USAGE: [--host-root] <DEPEND ATOM>
657 # Return true if given package is installed. Otherwise return false.
658 # Callers may override the ROOT variable in order to match packages from an
662 local atom eroot host_root=false root=${ROOT}
663 if [[ $1 == --host-root ]] ; then
669 [ $# -gt 0 ] && die "${FUNCNAME[0]}: unused argument(s): $*"
671 if ${host_root} ; then
672 if ! ___eapi_best_version_and_has_version_support_--host-root; then
673 die "${FUNCNAME[0]}: option --host-root is not supported with EAPI ${EAPI}"
678 if ___eapi_has_prefix_variables; then
679 # [[ ${root} == / ]] would be ambiguous here,
680 # since both prefixes can share root=/ while
681 # having different EPREFIX offsets.
682 if ${host_root} ; then
683 eroot=${root%/}${PORTAGE_OVERRIDE_EPREFIX}/
685 eroot=${root%/}${EPREFIX}/
690 if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
691 "$PORTAGE_BIN_PATH"/ebuild-ipc has_version "${eroot}" "${atom}"
693 "${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" has_version "${eroot}" "${atom}"
701 die "${FUNCNAME[0]}: invalid atom: ${atom}"
704 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
705 die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
707 die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
713 # @FUNCTION: best_version
714 # @USAGE: [--host-root] <DEPEND ATOM>
716 # Returns the best/most-current match.
717 # Callers may override the ROOT variable in order to match packages from an
721 local atom eroot host_root=false root=${ROOT}
722 if [[ $1 == --host-root ]] ; then
728 [ $# -gt 0 ] && die "${FUNCNAME[0]}: unused argument(s): $*"
730 if ${host_root} ; then
731 if ! ___eapi_best_version_and_has_version_support_--host-root; then
732 die "${FUNCNAME[0]}: option --host-root is not supported with EAPI ${EAPI}"
737 if ___eapi_has_prefix_variables; then
738 # [[ ${root} == / ]] would be ambiguous here,
739 # since both prefixes can share root=/ while
740 # having different EPREFIX offsets.
741 if ${host_root} ; then
742 eroot=${root%/}${PORTAGE_OVERRIDE_EPREFIX}/
744 eroot=${root%/}${EPREFIX}/
749 if [[ -n $PORTAGE_IPC_DAEMON ]] ; then
750 "$PORTAGE_BIN_PATH"/ebuild-ipc best_version "${eroot}" "${atom}"
752 "${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" best_version "${eroot}" "${atom}"
760 die "${FUNCNAME[0]}: invalid atom: ${atom}"
763 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
764 die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
766 die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
772 if ___eapi_has_master_repositories; then
773 master_repositories() {
774 local output repository=$1 retval
776 [[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
778 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
779 "${PORTAGE_BIN_PATH}/ebuild-ipc" master_repositories "${EROOT}" "${repository}"
781 output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" master_repositories "${EROOT}" "${repository}")
784 [[ -n ${output} ]] && echo "${output}"
790 die "${FUNCNAME[0]}: invalid repository: ${repository}"
793 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
794 die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
796 die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
803 if ___eapi_has_repository_path; then
805 local output repository=$1 retval
807 [[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
809 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
810 "${PORTAGE_BIN_PATH}/ebuild-ipc" repository_path "${EROOT}" "${repository}"
812 output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" get_repo_path "${EROOT}" "${repository}")
815 [[ -n ${output} ]] && echo "${output}"
821 die "${FUNCNAME[0]}: invalid repository: ${repository}"
824 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
825 die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
827 die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
834 if ___eapi_has_available_eclasses; then
835 available_eclasses() {
836 local output repository=${PORTAGE_REPO_NAME} retval
837 [[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
839 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
840 "${PORTAGE_BIN_PATH}/ebuild-ipc" available_eclasses "${EROOT}" "${repository}"
842 output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" available_eclasses "${EROOT}" "${repository}")
845 [[ -n ${output} ]] && echo "${output}"
851 die "${FUNCNAME[0]}: invalid repository: ${repository}"
854 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
855 die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
857 die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
864 if ___eapi_has_eclass_path; then
866 local eclass=$1 output repository=${PORTAGE_REPO_NAME} retval
868 [[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
870 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
871 "${PORTAGE_BIN_PATH}/ebuild-ipc" eclass_path "${EROOT}" "${repository}" "${eclass}"
873 output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" eclass_path "${EROOT}" "${repository}" "${eclass}")
876 [[ -n ${output} ]] && echo "${output}"
882 die "${FUNCNAME[0]}: invalid repository: ${repository}"
885 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
886 die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
888 die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
895 if ___eapi_has_license_path; then
897 local license=$1 output repository=${PORTAGE_REPO_NAME} retval
899 [[ $# -gt 0 ]] && die "${FUNCNAME[0]}: unused argument(s): $*"
901 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
902 "${PORTAGE_BIN_PATH}/ebuild-ipc" license_path "${EROOT}" "${repository}" "${license}"
904 output=$("${PORTAGE_BIN_PATH}/ebuild-helpers/portageq" license_path "${EROOT}" "${repository}" "${license}")
907 [[ -n ${output} ]] && echo "${output}"
913 die "${FUNCNAME[0]}: invalid repository: ${repository}"
916 if [[ -n ${PORTAGE_IPC_DAEMON} ]]; then
917 die "${FUNCNAME[0]}: unexpected ebuild-ipc exit code: ${retval}"
919 die "${FUNCNAME[0]}: unexpected portageq exit code: ${retval}"
926 if ___eapi_has_package_manager_build_user; then
927 package_manager_build_user() {
928 echo "${PORTAGE_BUILD_USER}"
932 if ___eapi_has_package_manager_build_group; then
933 package_manager_build_group() {
934 echo "${PORTAGE_BUILD_GROUP}"