declare -x ABI="amd64" declare -x ABI_MIPS="" declare -x ABI_S390="" declare -x ABI_X86="64" declare -x ADA_TARGET="" declare -x ALSA_CARDS="" declare -x AMDGPU_TARGETS="" declare -x APACHE2_MODULES="" declare -x APACHE2_MPMS="" declare -x ARCH="amd64" declare BDEPEND=" dev-perl/ExtUtils-CChecker dev-perl/Module-Build virtual/perl-ExtUtils-CBuilder virtual/perl-ExtUtils-ParseXS dev-lang/perl test? ( virtual/perl-Test-Simple )" declare -x BINPKG_FORMAT="xpak" declare -x BINPKG_GPG_SIGNING_BASE_COMMAND="/usr/bin/flock /run/lock/portage-binpkg-gpg.lock /usr/bin/gpg --sign --armor [PORTAGE_CONFIG]" declare -x BINPKG_GPG_SIGNING_DIGEST="SHA512" declare -x BINPKG_GPG_VERIFY_BASE_COMMAND="/usr/bin/gpg --verify --batch --no-tty --no-auto-check-trustdb --status-fd 2 [PORTAGE_CONFIG] [SIGNATURE]" declare -x BINPKG_GPG_VERIFY_GPG_HOME="/etc/portage/gnupg" declare -x BOOTSTRAP_USE="unicode internal-glib pkg-config split-usr xml python_targets_python3_10 multilib systemd udev" declare -x CALLIGRA_FEATURES="" declare -x CAMERAS="" declare -x CARGO_TERM_COLOR="never" declare -x CBUILD="x86_64-pc-linux-gnu" declare -x CC="clang" declare -x CFLAGS="-pipe -march=native -fno-diagnostics-color -O2" declare -x CFLAGS_amd64="-m64" declare -x CFLAGS_x32="-mx32" declare -x CFLAGS_x86="-m32" declare -x CHOST="x86_64-pc-linux-gnu" declare -x CHOST_amd64="x86_64-pc-linux-gnu" declare -x CHOST_x32="x86_64-pc-linux-gnux32" declare -x CHOST_x86="i686-pc-linux-gnu" declare -x COLLECTD_PLUGINS="" declare -x CPU_FLAGS_ARM="" declare -x CPU_FLAGS_PPC="" declare -x CPU_FLAGS_X86="" declare -x CURL_SSL="" declare -x CXX="clang++" declare -x CXXFLAGS="-pipe -march=native -fno-diagnostics-color -O2" declare -x DEFAULT_ABI="amd64" declare -x DEFINED_PHASES=" compile configure install prepare test" declare DEPEND="dev-lang/perl" declare DESCRIPTION="XS functions to assist in parsing keyword syntax" declare -x DIROPTIONS="-m0755" declare -- DIST_A="XS-Parse-Keyword-0.24.tar.gz" declare -- DIST_AUTHOR="PEVANS" declare -a DIST_MAKE=([0]="OPTIMIZE=-pipe -march=native -fno-diagnostics-color -O2") declare -- DIST_NAME="XS-Parse-Keyword" declare -- DIST_P="XS-Parse-Keyword-0.24" declare -- DIST_VERSION="0.24" declare -x EAPI="8" declare -x EGO_BUILD_FLAGS="-p 4" declare -x ELIBC="glibc" declare -x ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR" declare -- EPOCHREALTIME="1663351579.736849" declare -- EPOCHSECONDS="1663351579" declare -x EXEOPTIONS="-m0755" declare -x FCFLAGS="-pipe -march=native -fno-diagnostics-color -O2" declare -x FETCHCOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port= ; exec rsync --rsh=\\\"ssh \\\${port:+-p\\\${port}} \\\${3}\\\" -avP \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" \"\${URI}\" \"\${PORTAGE_SSH_OPTS}\"" declare -x FFLAGS="-pipe -march=native -fno-diagnostics-color -O2" declare -x FFTOOLS="" declare -x GCC_COLORS="" declare -x GCC_SPECS="" declare -x GIT_PAGER="cat" declare -x GO19CONCURRENTCOMPILATION="0" declare -x GOMAXPROCS="4" declare -x GPG_VERIFY_GROUP_DROP="nogroup" declare -x GPG_VERIFY_USER_DROP="nobody" declare -x GPSD_PROTOCOLS="" declare -x GRUB_PLATFORMS="" declare -x GSETTINGS_BACKEND="dconf" declare HOMEPAGE="https://metacpan.org/release/XS-Parse-Keyword" declare IDEPEND="" declare -x INHERITED=" multiprocessing perl-functions readme.gentoo-r1 perl-module" declare -x INPUT_DEVICES="" declare -x INSOPTIONS="-m0644" declare IUSE="test" declare -x IUSE_EFFECTIVE="abi_x86_64 alpha amd64 amd64-linux arm arm64 arm64-macos elibc_Cygwin elibc_Darwin elibc_SunOS elibc_Winnt elibc_bionic elibc_glibc elibc_mingw elibc_musl hppa ia64 kernel_Darwin kernel_SunOS kernel_Winnt kernel_linux loong m68k mips ppc ppc-macos ppc64 ppc64-linux prefix prefix-guest prefix-stack riscv s390 sparc sparc-solaris sparc64-solaris test userland_BSD userland_GNU x64-cygwin x64-macos x64-solaris x64-winnt x86 x86-linux x86-solaris x86-winnt" declare -x IUSE_IMPLICIT="abi_x86_64 prefix prefix-guest prefix-stack" declare -x KERNEL="linux" declare -x KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" declare -x L10N="" declare -x LANG="C.UTF8" declare -x LCD_DEVICES="" declare -x LC_COLLATE="C" declare -x LC_MESSAGES="C" declare -x LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0" declare -x LDFLAGS_amd64="-m elf_x86_64" declare -x LDFLAGS_x32="-m elf32_x86_64" declare -x LDFLAGS_x86="-m elf_i386" declare -x LIBDIR_amd64="lib64" declare -x LIBDIR_x32="libx32" declare -x LIBDIR_x86="lib" declare -x LIBOPTIONS="-m0644" declare -x LIBREOFFICE_EXTENSIONS="" declare -x LICENSE="|| ( Artistic GPL-1+ )" declare -x LLVM_TARGETS="" declare -x LUA_SINGLE_TARGET="" declare -x LUA_TARGETS="" declare -x MAILTO="tinderbox" declare -x MAKEOPTS=" -j4" declare -x MANPAGER="manpager" declare -x MONKEYD_PLUGINS="" declare -x MULTILIB_ABIS="amd64 x86" declare -x MULTILIB_STRICT_DENY="64-bit.*shared object" declare -x MULTILIB_STRICT_DIRS="/lib32 /lib /usr/lib32 /usr/lib /usr/kde/*/lib32 /usr/kde/*/lib /usr/qt/*/lib32 /usr/qt/*/lib /usr/X11R6/lib32 /usr/X11R6/lib" declare -x MULTILIB_STRICT_EXEMPT="(perl5|gcc|binutils|eclipse-3|debug|portage|udev|systemd|clang|python-exec|llvm)" declare -x NGINX_MODULES_HTTP="" declare -x NGINX_MODULES_MAIL="" declare -x NGINX_MODULES_STREAM="" declare -x OCAML_COLOR="never" declare -x OFFICE_IMPLEMENTATION="" declare -x OMP_DYNAMIC="FALSE" declare -x OMP_NESTED="FALSE" declare -x OMP_NUM_THREADS="4" declare -x OPENMPI_FABRICS="" declare -x OPENMPI_OFED_FEATURES="" declare -x OPENMPI_RM="" declare -x PATH="/usr/lib/portage/python3.10/ebuild-helpers/xattr:/usr/lib/portage/python3.10/ebuild-helpers:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/14/bin" declare PDEPEND="" declare -- PERL_EXPF="src_prepare src_configure src_compile src_test src_install" declare -x PHP_TARGETS="" declare -x PKGSYSTEM_ENABLE_FSYNC="0" declare -x PORTAGE_COMPRESSION_COMMAND="zstd" declare -a PORTAGE_DOCOMPRESS=([0]="/usr/share/doc" [1]="/usr/share/info" [2]="/usr/share/man") declare -x PORTAGE_DOCOMPRESS_SIZE_LIMIT="128" declare -a PORTAGE_DOCOMPRESS_SKIP=([0]="/usr/share/doc/XS-Parse-Keyword-0.240.0/html") declare -a PORTAGE_DOSTRIP=([0]="/") declare -a PORTAGE_DOSTRIP_SKIP=() declare -x PORTAGE_TMPFS="/dev/shm" declare -x PORT_LOGDIR="/var/log/portage" declare -x POSTGRES_TARGETS="" declare -- PREFER_BUILDPL="yes" declare -x PROFILE_ONLY_VARIABLES="ARCH ELIBC IUSE_IMPLICIT KERNEL USERLAND USE_EXPAND_IMPLICIT USE_EXPAND_UNPREFIXED USE_EXPAND_VALUES_ARCH USE_EXPAND_VALUES_ELIBC USE_EXPAND_VALUES_KERNEL USE_EXPAND_VALUES_USERLAND" declare -- PROPERTIES="" declare -x PYTEST_ADDOPTS="--color=no" declare -x PYTHONDONTWRITEBYTECODE="1" declare -x PYTHON_SINGLE_TARGET="" declare -x PYTHON_TARGETS="" declare -x PY_FORCE_COLOR="0" declare -x QEMU_SOFTMMU_TARGETS="" declare -x QEMU_USER_TARGETS="" declare RDEPEND="dev-lang/perl:=" declare -- README_GENTOO_SUFFIX="" declare REPOSITORY declare REQUIRED_USE="" declare RESTRICT="test" declare -x RESUMECOMMAND_SSH="bash -c \"x=\\\${2#ssh://} ; host=\\\${x%%/*} ; port=\\\${host##*:} ; host=\\\${host%:*} ; [[ \\\${host} = \\\${port} ]] && port= ; exec rsync --rsh=\\\"ssh \\\${port:+-p\\\${port}} \\\${3}\\\" -avP \\\"\\\${host}:/\\\${x#*/}\\\" \\\"\\\$1\\\"\" rsync \"\${DISTDIR}/\${FILE}\" \"\${URI}\" \"\${PORTAGE_SSH_OPTS}\"" declare -x ROS_MESSAGES="" declare -x RUBY_TARGETS="" declare -x RUSTFLAGS="-Ctarget-cpu=native -v" declare -x RUST_TEST_TASKS="4" declare -x RUST_TEST_THREADS="4" declare -x S="/var/tmp/portage/dev-perl/XS-Parse-Keyword-0.240.0/work/XS-Parse-Keyword-0.24" declare -x SANDBOX_DEBUG="0" declare -x SANDBOX_DENY="" declare -x SANDBOX_METHOD="any" declare -x SANDBOX_PREDICT="/var/tmp/portage/dev-perl/XS-Parse-Keyword-0.240.0/homedir:/dev/crypto:/var/cache/man:/var/cache/fontconfig" declare -x SANDBOX_READ="/:/var/tmp/portage" declare -x SANDBOX_VERBOSE="1" declare -x SANDBOX_WRITE=":/dev/console:/dev/fd:/dev/full:/dev/null:/dev/ptmx:/dev/pts/:/dev/pty:/dev/shm:/dev/tts:/dev/tty:/dev/vc/:/dev/zero:/proc/self/fd:/tmp/:/usr/lib/cf:/usr/lib/conftest:/usr/lib32/cf:/usr/lib32/conftest:/usr/lib64/cf:/usr/lib64/conftest:/usr/tmp/:/usr/tmp/cf:/usr/tmp/conftest:/var/tmp/:/var/tmp/portage:/var/tmp/portage/dev-perl/XS-Parse-Keyword-0.240.0/homedir/.bash_history" declare -x SANE_BACKENDS="" declare -x SHELL="/bin/bash" declare -x SKIP_KERNEL_CHECK="y" declare -x SLOT="0" declare -i SRANDOM="3270439021" declare SRC_URI="mirror://cpan/authors/id/P/PE/PEVANS/XS-Parse-Keyword-0.24.tar.gz" declare -x SYMLINK_LIB="no" declare -x TERMINFO="/etc/terminfo" declare -x TWISTED_DISABLE_WRITING_OF_PLUGIN_CACHE="1" declare -x USE="abi_x86_64 amd64 elibc_glibc kernel_linux userland_GNU" declare -x USERLAND="GNU" declare -x USE_EXPAND_IMPLICIT="ARCH ELIBC KERNEL USERLAND" declare -x USE_EXPAND_UNPREFIXED="ARCH" declare -x USE_EXPAND_VALUES_ARCH="alpha amd64 amd64-linux arm arm64 arm64-macos hppa ia64 loong m68k mips ppc ppc64 ppc64-linux ppc-macos riscv s390 sparc sparc64-solaris sparc-solaris x64-cygwin x64-macos x64-solaris x64-winnt x86 x86-linux x86-solaris x86-winnt" declare -x USE_EXPAND_VALUES_ELIBC="bionic Cygwin Darwin glibc mingw musl SunOS Winnt" declare -x USE_EXPAND_VALUES_KERNEL="Darwin linux SunOS Winnt" declare -x USE_EXPAND_VALUES_USERLAND="BSD GNU" declare -x UWSGI_PLUGINS="" declare -x VIDEO_CARDS="" declare -x VOICEMAIL_STORAGE="" declare -x XDG_CONFIG_DIRS="/etc/xdg" declare -x XDG_DATA_DIRS="/usr/local/share:/usr/share" declare -x XTABLES_ADDONS="" declare -x _E_DESTTREE_="/usr" declare -x _E_DOCDESTTREE_="" declare -x _E_EXEDESTTREE_="" declare -x _E_INSDESTTREE_="" declare -- _MULTIPROCESSING_ECLASS="1" declare -- _README_GENTOO_ECLASS="1" declare -x bugz_timeout="timeout --signal=15 --kill-after=1m 3m" declare -x enable_year2038="no" declare -- perlinfo_done="false" declare -- pm_echovar="" SwitchGCC () { local highest=$(gcc-config --list-profiles --nocolor | cut -f3 -d' ' -s | grep -E 'x86_64-(pc|gentoo)-linux-(gnu|musl)-.*[0-9]$'| tail -n 1); if ! gcc-config --list-profiles --nocolor | grep -q -F "$highest *"; then local current=$(gcc -dumpversion); echo "$FUNCNAME: major version change detected, switch from $current to $highest" | tee -a $taskfile.history; gcc-config --nocolor $highest; source_profile; add2backlog "@preserved-rebuild"; if grep -q '^LIBTOOL="rdlibtool"' /etc/portage/make.conf; then add2backlog "sys-devel/slibtool"; fi; add2backlog "sys-devel/libtool"; add2backlog "%emerge --unmerge sys-devel/gcc:$(cut -f1 -d'.' <<< $current)"; fi } declare -fx SwitchGCC __eapi6_src_install () { if [[ -f Makefile || -f GNUmakefile || -f makefile ]]; then emake DESTDIR="${D}" install; fi; einstalldocs } __eapi6_src_prepare () { if ___is_indexed_array_var PATCHES; then [[ ${#PATCHES[@]} -gt 0 ]] && eapply "${PATCHES[@]}"; else if [[ -n ${PATCHES} ]]; then eapply ${PATCHES}; fi; fi; eapply_user } __eapi7_ver_compare () { local va=${1} vb=${2} a an al as ar b bn bl bs br re LC_ALL=C; re="^([0-9]+(\.[0-9]+)*)([a-z]?)((_(alpha|beta|pre|rc|p)[0-9]*)*)(-r[0-9]+)?$"; [[ ${va} =~ ${re} ]] || die "${FUNCNAME}: invalid version: ${va}"; an=${BASH_REMATCH[1]}; al=${BASH_REMATCH[3]}; as=${BASH_REMATCH[4]}; ar=${BASH_REMATCH[7]}; [[ ${vb} =~ ${re} ]] || die "${FUNCNAME}: invalid version: ${vb}"; bn=${BASH_REMATCH[1]}; bl=${BASH_REMATCH[3]}; bs=${BASH_REMATCH[4]}; br=${BASH_REMATCH[7]}; __eapi7_ver_compare_int "${an%%.*}" "${bn%%.*}" || return; while [[ ${an} == *.* && ${bn} == *.* ]]; do an=${an#*.}; bn=${bn#*.}; a=${an%%.*}; b=${bn%%.*}; if [[ ${a} == 0* || ${b} == 0* ]]; then [[ ${a} =~ 0+$ ]] && a=${a%"${BASH_REMATCH[0]}"}; [[ ${b} =~ 0+$ ]] && b=${b%"${BASH_REMATCH[0]}"}; [[ ${a} > ${b} ]] && return 3; [[ ${a} < ${b} ]] && return 1; else __eapi7_ver_compare_int "${a}" "${b}" || return; fi; done; [[ ${an} == *.* ]] && return 3; [[ ${bn} == *.* ]] && return 1; [[ ${al} > ${bl} ]] && return 3; [[ ${al} < ${bl} ]] && return 1; as=${as#_}${as:+_}; bs=${bs#_}${bs:+_}; while [[ -n ${as} && -n ${bs} ]]; do a=${as%%_*}; b=${bs%%_*}; if [[ ${a%%[0-9]*} == "${b%%[0-9]*}" ]]; then __eapi7_ver_compare_int "${a##*[a-z]}" "${b##*[a-z]}" || return; else [[ ${a%%[0-9]*} == p ]] && return 3; [[ ${b%%[0-9]*} == p ]] && return 1; [[ ${a} > ${b} ]] && return 3 || return 1; fi; as=${as#*_}; bs=${bs#*_}; done; if [[ -n ${as} ]]; then [[ ${as} == p[_0-9]* ]] && return 3 || return 1; else if [[ -n ${bs} ]]; then [[ ${bs} == p[_0-9]* ]] && return 1 || return 3; fi; fi; __eapi7_ver_compare_int "${ar#-r}" "${br#-r}" || return; return 2 } __eapi7_ver_compare_int () { local a=$1 b=$2 d=$(( ${#1}-${#2} )); if [[ ${d} -gt 0 ]]; then printf -v b "%0${d}d%s" 0 "${b}"; else if [[ ${d} -lt 0 ]]; then printf -v a "%0$(( -d ))d%s" 0 "${a}"; fi; fi; [[ ${a} > ${b} ]] && return 3; [[ ${a} == "${b}" ]] } __eapi7_ver_parse_range () { local range=${1}; local max=${2}; [[ ${range} == [0-9]* ]] || die "${FUNCNAME}: range must start with a number"; start=${range%-*}; [[ ${range} == *-* ]] && end=${range#*-} || end=${start}; if [[ -n ${end} ]]; then [[ ${start} -le ${end} ]] || die "${FUNCNAME}: end of range must be >= start"; [[ ${end} -le ${max} ]] || end=${max}; else end=${max}; fi } __eapi7_ver_split () { local v=${1} LC_ALL=C; comp=(); local s c; while [[ -n ${v} ]]; do s=${v%%[a-zA-Z0-9]*}; v=${v:${#s}}; [[ ${v} == [0-9]* ]] && c=${v%%[^0-9]*} || c=${v%%[^a-zA-Z]*}; v=${v:${#c}}; comp+=("${s}" "${c}"); done } __eapi8_src_prepare () { local f; if ___is_indexed_array_var PATCHES; then [[ ${#PATCHES[@]} -gt 0 ]] && eapply -- "${PATCHES[@]}"; else if [[ -n ${PATCHES} ]]; then eapply -- ${PATCHES}; fi; fi; eapply_user } add2backlog () { if [[ $1 =~ '@' || $1 =~ '%' ]]; then if [[ "$(tail -n 1 /var/tmp/tb/backlog.1st)" != "$1" ]]; then echo "$1" >> /var/tmp/tb/backlog.1st; fi; else if ! grep -q "^${1}$" /var/tmp/tb/backlog.1st; then echo "$1" >> /var/tmp/tb/backlog.1st; fi; fi } declare -fx add2backlog eapply () { local failed patch_cmd=patch; local -x LC_COLLATE=POSIX; type -P gpatch > /dev/null && patch_cmd=gpatch; function _eapply_patch () { local f=${1}; local prefix=${2}; ebegin "${prefix:-Applying }${f##*/}"; local all_opts=(-p1 -f -g0 --no-backup-if-mismatch "${patch_options[@]}"); if ${patch_cmd} "${all_opts[@]}" --dry-run -s -F0 < "${f}" &> /dev/null; then all_opts+=(-s -F0); fi; ${patch_cmd} "${all_opts[@]}" < "${f}"; failed=${?}; if ! eend "${failed}"; then __helpers_die "patch -p1 ${patch_options[*]} failed with ${f}"; fi }; local patch_options=() files=(); local i found_doublehyphen; for ((i = 1; i <= ${#@}; ++i )) do if [[ ${@:i:1} == -- ]]; then patch_options=("${@:1:i-1}"); files=("${@:i+1}"); found_doublehyphen=1; break; fi; done; if [[ -z ${found_doublehyphen} ]]; then for ((i = 1; i <= ${#@}; ++i )) do if [[ ${@:i:1} != -* ]]; then patch_options=("${@:1:i-1}"); files=("${@:i}"); break; fi; done; for i in "${files[@]}"; do if [[ ${i} == -* ]]; then die "eapply: all options must be passed before non-options"; fi; done; fi; if [[ ${#files[@]} -eq 0 ]]; then die "eapply: no files specified"; fi; local f; for f in "${files[@]}"; do if [[ -d ${f} ]]; then function _eapply_get_files () { local LC_ALL=POSIX; local prev_shopt=$(shopt -p nullglob); shopt -s nullglob; local f; for f in "${1}"/*; do if [[ ${f} == *.diff || ${f} == *.patch ]]; then files+=("${f}"); fi; done; ${prev_shopt} }; local files=(); _eapply_get_files "${f}"; [[ ${#files[@]} -eq 0 ]] && die "No *.{patch,diff} files in directory ${f}"; einfo "Applying patches from ${f} ..."; local f2; for f2 in "${files[@]}"; do _eapply_patch "${f2}" ' '; [[ ${failed} -ne 0 ]] && return "${failed}"; done; else _eapply_patch "${f}"; [[ ${failed} -ne 0 ]] && return "${failed}"; fi; done; return 0 } eapply_user () { [[ ${EBUILD_PHASE} == prepare ]] || die "eapply_user() called during invalid phase: ${EBUILD_PHASE}"; local tagfile=${T}/.portage_user_patches_applied; [[ -f ${tagfile} ]] && return; >> "${tagfile}"; local basedir=${PORTAGE_CONFIGROOT%/}/etc/portage/patches; local columns=${COLUMNS:-0}; [[ ${columns} == 0 ]] && columns=$(set -- $( ( stty size /dev/null || echo 24 80 ) ; echo $2); (( columns > 0 )) || (( columns = 80 )); local applied d f; local -A _eapply_user_patches; local prev_shopt=$(shopt -p nullglob); shopt -s nullglob; for d in "${basedir}"/${CATEGORY}/{${P}-${PR},${P},${PN}}{:${SLOT%/*},}; do for f in "${d}"/*; do if [[ ( ${f} == *.diff || ${f} == *.patch ) && -z ${_eapply_user_patches[${f##*/}]} ]]; then _eapply_user_patches[${f##*/}]=${f}; fi; done; done; if [[ ${#_eapply_user_patches[@]} -gt 0 ]]; then while read -r -d '' f; do f=${_eapply_user_patches[${f}]}; if [[ -s ${f} ]]; then if [[ -z ${applied} ]]; then einfo "${PORTAGE_COLOR_INFO}$(for ((column = 0; column < ${columns} - 3; column++)); do echo -n =; done)${PORTAGE_COLOR_NORMAL}"; einfo "Applying user patches from ${basedir} ..."; fi; eapply "${f}"; applied=1; fi; done < <(printf -- '%s\0' "${!_eapply_user_patches[@]}" | LC_ALL=C sort -z); fi; ${prev_shopt}; if [[ -n ${applied} ]]; then einfo "User patches applied."; einfo "${PORTAGE_COLOR_INFO}$(for ((column = 0; column < ${columns} - 3; column++)); do echo -n =; done)${PORTAGE_COLOR_NORMAL}"; fi } einstalldocs () { ( if [[ $(declare -p DOCS 2>/dev/null) != *=* ]]; then local d; for d in README* ChangeLog AUTHORS NEWS TODO CHANGES THANKS BUGS FAQ CREDITS CHANGELOG; do [[ -f ${d} && -s ${d} ]] && docinto / && dodoc "${d}"; done; else if ___is_indexed_array_var DOCS; then [[ ${#DOCS[@]} -gt 0 ]] && docinto / && dodoc -r "${DOCS[@]}"; else [[ -n ${DOCS} ]] && docinto / && dodoc -r ${DOCS}; fi; fi ); ( if ___is_indexed_array_var HTML_DOCS; then [[ ${#HTML_DOCS[@]} -gt 0 ]] && docinto html && dodoc -r "${HTML_DOCS[@]}"; else [[ -n ${HTML_DOCS} ]] && docinto html && dodoc -r ${HTML_DOCS}; fi ) } get_libdir () { local libdir_var="LIBDIR_${ABI}"; local libdir="lib"; [[ -n ${ABI} && -n ${!libdir_var} ]] && libdir=${!libdir_var}; echo "${libdir}" } get_nproc () { local nproc; if type -P nproc &> /dev/null; then nproc=$(nproc); fi; if [[ -z ${nproc} ]] && type -P sysctl &> /dev/null; then nproc=$(sysctl -n hw.ncpu 2>/dev/null); fi; if [[ -z ${nproc} ]] && type -P python &> /dev/null; then nproc=$(python -c 'import multiprocessing; print(multiprocessing.cpu_count());' 2>/dev/null); fi; if [[ -n ${nproc} ]]; then echo "${nproc}"; else echo "${1:-1}"; fi } in_iuse () { local use=${1}; if [[ -z "${use}" ]]; then echo "!!! in_iuse() called without a parameter." 1>&2; echo "!!! in_iuse " 1>&2; die "in_iuse() called without a parameter"; fi; local liuse=(${IUSE_EFFECTIVE}); has "${use}" "${liuse[@]#[+-]}" } makeopts_jobs () { [[ $# -eq 0 ]] && set -- "${MAKEOPTS}"; local jobs=$(echo " $* " | sed -r -n -e 's:.*[[:space:]](-[a-z]*j|--jobs[=[:space:]])[[:space:]]*([0-9]+).*:\2:p' -e "s:.*[[:space:]](-[a-z]*j|--jobs)[[:space:]].*:${2:-$(( $(get_nproc) + 1 ))}:p"); echo ${jobs:-1} } makeopts_loadavg () { [[ $# -eq 0 ]] && set -- "${MAKEOPTS}"; local lavg=$(echo " $* " | sed -r -n -e 's:.*[[:space:]](-[a-z]*l|--(load-average|max-load)[=[:space:]])[[:space:]]*([0-9]+(\.[0-9]+)?)[[:space:]].*:\3:p' -e "s:.*[[:space:]](-[a-z]*l|--(load-average|max-load))[[:space:]].*:${2:-999}:p"); echo ${lavg:-${2:-999}} } perl-module_pkg_postinst () { debug-print-function ${FUNCNAME} "$@"; if [[ ${CATEGORY} != perl-core ]]; then eerror "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category."; die " This does not do anything; the call can be removed."; fi; perl_link_duallife_scripts } perl-module_pkg_postrm () { debug-print-function ${FUNCNAME} "$@"; if [[ ${CATEGORY} != perl-core ]]; then eerror "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category."; die " This does not do anything; the call can be removed."; fi; perl_link_duallife_scripts } perl-module_src_compile () { debug-print-function ${FUNCNAME} "$@"; perl_set_version; case ${EAPI} in 7) if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then local mymake_local=(${mymake}); else local mymake_local=("${mymake[@]}"); fi ;; *) local mymake_local=("${DIST_MAKE[@]}") ;; esac; if [[ -f Build ]]; then ./Build build || die "Compilation failed"; else if [[ -f Makefile ]]; then set -- OTHERLDFLAGS="${LDFLAGS}" "${mymake_local[@]}"; emake "$@"; fi; fi } perl-module_src_configure () { debug-print-function ${FUNCNAME} "$@"; perl_check_env; perl_set_version; [[ -z ${pm_echovar} ]] && export PERL_MM_USE_DEFAULT=1; export PERL_EXTUTILS_AUTOINSTALL="--skipdeps"; if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then local myconf_local=(${myconf}); else local myconf_local=("${myconf[@]}"); fi; if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]]; then if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL; then einfo "Using Module::Build::Tiny"; if [[ ${BDEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then eerror "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it."; eerror " Add dev-perl/Module-Build-Tiny to BDEPEND!"; fi; else einfo "Using Module::Build"; if [[ ${BDEPEND} != *virtual/perl-Module-Build* && ${BDEPEND} != *dev-perl/Module-Build* && ${PN} != Module-Build ]]; then eerror "QA Notice: The ebuild uses Module::Build but doesn't depend on it."; eerror " Add dev-perl/Module-Build to BDEPEND!"; fi; fi; set -- --installdirs=vendor --libdoc= --destdir="${D}" --create_packlist=1 "${myconf_local[@]}"; einfo "perl Build.PL" "$@"; perl Build.PL "$@" <<< "${pm_echovar}" || die "Unable to build!"; else if [[ -f Makefile.PL ]]; then einfo "Using ExtUtils::MakeMaker"; set -- PREFIX=${EPREFIX}/usr INSTALLDIRS=vendor INSTALLMAN3DIR='none' DESTDIR="${D}" "${myconf_local[@]}"; einfo "perl Makefile.PL" "$@"; perl Makefile.PL "$@" <<< "${pm_echovar}" || die "Unable to build!"; fi; fi; if [[ ! -f Build.PL && ! -f Makefile.PL ]]; then einfo "No Make or Build file detected..."; return; fi } perl-module_src_install () { debug-print-function ${FUNCNAME} "$@"; perl_set_version; local f; if [[ -f Build ]]; then mytargets="${mytargets:-install}"; mbparams="${mbparams:---pure}"; einfo "./Build ${mytargets} ${mbparams}"; ./Build ${mytargets} ${mbparams} || die "./Build ${mytargets} ${mbparams} failed"; else if [[ -f Makefile ]]; then case "${CATEGORY}" in dev-perl | perl-core) mytargets="pure_install" ;; *) mytargets="install" ;; esac; if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then local myinst_local=(${myinst}); else local myinst_local=("${myinst[@]}"); fi; emake "${myinst_local[@]}" ${mytargets}; fi; fi; case ${EAPI} in 7) ;; *) perl_fix_permissions ;; esac; perl_delete_module_manpages; perl_delete_localpod; perl_fix_packlist; perl_delete_emptybsdir; perl_remove_temppath; for f in Change* CHANGES README* TODO FAQ ${mydoc}; do [[ -s ${f} ]] && dodoc ${f}; done; if in_iuse examples && use examples; then [[ ${#DIST_EXAMPLES[@]} -eq 0 ]] || perl_doexamples "${DIST_EXAMPLES[@]}"; fi; perl_link_duallife_scripts; case ${EAPI} in 7) ;; *) if has 'features' ${DIST_WIKI}; then DISABLE_AUTOFORMATTING=yes; DOC_CONTENTS="This package may require additional dependencies and/or preparation steps for\n"; DOC_CONTENTS+="some optional features. For details, see\n"; DOC_CONTENTS+="$(perl_get_wikiurl_features)"; einfo; readme.gentoo_create_doc; readme.gentoo_print_elog; fi ;; esac } perl-module_src_prepare () { debug-print-function ${FUNCNAME} "$@"; default; if [[ -n ${PERL_RM_FILES[@]} ]]; then debug-print "$FUNCNAME: stripping unneeded files"; perl_rm_files "${PERL_RM_FILES[@]}"; fi; perl_fix_osx_extra } perl-module_src_test () { debug-print-function ${FUNCNAME} "$@"; local my_test_control; local my_test_verbose; [[ -n "${DIST_TEST_OVERRIDE}" ]] && ewarn "DIST_TEST_OVERRIDE is set to ${DIST_TEST_OVERRIDE}"; my_test_control=${DIST_TEST_OVERRIDE:-${DIST_TEST:-do parallel}}; if ! has 'do' ${my_test_control} && ! has 'parallel' ${my_test_control}; then einfo Skipping tests due to DIST_TEST=${my_test_control}; return 0; fi; if has verbose ${my_test_control}; then my_test_verbose=1; else my_test_verbose=0; fi; if has parallel ${my_test_control}; then export HARNESS_OPTIONS=j$(makeopts_jobs); einfo "Test::Harness Jobs=$(makeopts_jobs)"; fi; if ! has network ${my_test_control}; then export NO_NETWORK_TESTING=1; fi; case ${EAPI} in 7) ;; *) if has 'tests' ${DIST_WIKI}; then ewarn "This package may require additional dependencies and/or preparation steps for"; ewarn "comprehensive testing. For details, see:"; ewarn "$(perl_get_wikiurl_tests)"; fi ;; esac; perl_set_version; if [[ -f Build ]]; then ./Build test verbose=${my_test_verbose} || die "test failed"; else if [[ -f Makefile ]]; then emake test TEST_VERBOSE=${my_test_verbose}; fi; fi } perl_check_env () { local errored value; for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do [[ -v $i ]] || continue; if [[ ${errored:-0} == 0 ]]; then if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then elog "perl-module.eclass: Suspicious environment values found."; else eerror "perl-module.eclass: Suspicious environment values found."; fi; fi; errored=1; value=${!i}; if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then elog " $i=\"$value\""; else eerror " $i=\"$value\""; fi; done; [[ ${errored:-0} == 0 ]] && return; if [[ -n ${I_KNOW_WHAT_I_AM_DOING} ]]; then elog "Continuing anyway, seems you know what you're doing."; return; fi; eerror "Your environment settings may lead to undefined behavior and/or build failures."; die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details." } perl_delete_emptybsdir () { debug-print-function ${FUNCNAME} "$@"; perl_set_version; if [[ -d ${D}/${VENDOR_ARCH} ]]; then find "${D}/${VENDOR_ARCH}" -type f -a -name '*.bs' -a -empty -delete; find "${D}" -depth -mindepth 1 -type d -empty -delete; fi } perl_delete_localpod () { debug-print-function ${FUNCNAME} "$@"; find "${D}" -type f -name perllocal.pod -delete; find "${D}" -depth -mindepth 1 -type d -empty -delete } perl_delete_module_manpages () { debug-print-function ${FUNCNAME} "$@"; if [[ -d "${ED}"/usr/share/man ]]; then find "${ED}"/usr/share/man -type f -name "*.3pm" -delete; find "${ED}"/usr/share/man -depth -type d -empty -delete; fi } perl_delete_packlist () { debug-print-function ${FUNCNAME} "$@"; perl_set_version; if [[ -d ${D}/${VENDOR_ARCH} ]]; then find "${D}/${VENDOR_ARCH}" -type f -a -name .packlist -delete; perl_delete_emptybsdir; fi } perl_doexamples () { debug-print-function ${FUNCNAME} "$@"; einfo "Installing examples into /usr/share/doc/${PF}/examples"; docompress -x /usr/share/doc/${PF}/examples; docinto examples/; dodoc -r $@ } perl_domodule () { local target_prefix=""; local files=(); local doins_opts=(); local recursive="false"; local target; local file; while [[ $# -gt 0 ]]; do case $1 in -C | --target-prefix) [[ -z "${2}" || "${2:0:1}" == "-" ]] && die "${FUNCNAME}: -C|--target-prefix expects an argument, got \"$2\"!"; target_prefix="${2}"; shift 2 ;; -r) recursive="true"; shift ;; *) [[ -z "${1}" || "${1:0:1}" == "-" ]] && die "${FUNCNAME}: Unknown argument \"${1}\"!"; files+=("${1}"); shift 1 ;; esac; done; if [[ "true" == $recursive ]]; then doins_opts+=("-r"); fi; for file in "${files[@]}"; do [[ -e "${file}" ]] || die "$FUNCNAME: Argument \"${file}\" is not an existing file"; [[ "false" == ${recursive} && -d "${file}" ]] && die "$FUNCNAME: Argument \"${file}\" is a directory ( needs -r parameter )"; done; target="$(perl_get_vendorlib)"; [[ -z "${target_prefix}" ]] || target="${target%/}/${target_prefix#/}"; insinto "/${target#/}"; doins "${doins_opts[@]}" "${files[@]}" } perl_fix_osx_extra () { debug-print-function ${FUNCNAME} "$@"; local f; find "${S}" -type f -name "._*" -print0 | while read -rd '' f; do einfo "Removing AppleDouble encoded Macintosh file: ${f#${S}/}"; rm -f "${f}"; f=${f#${S}/}; grep -q "${f}" "${S}"/MANIFEST && elog "AppleDouble encoded Macintosh file in MANIFEST: ${f#${S}/}"; done } perl_fix_packlist () { debug-print-function ${FUNCNAME} "$@"; local packlist_temp="${T}/.gentoo_packlist_temp"; find "${D}" -type f -name '.packlist' -print0 | while read -rd '' f; do if file "${f}" | grep -q -i " text"; then einfo "Fixing packlist file /${f#${D}}"; sed -i -e "s:${D%/}/:/:g" "${f}"; sort -u "${f}" > "${packlist_temp}"; mv "${packlist_temp}" "${f}"; cat "${f}" | while read -r entry; do if [[ ! -e ${D}/${entry} ]]; then einfo "Pruning surplus packlist entry ${entry}"; grep -v -x -F "${entry}" "${f}" > "${packlist_temp}"; mv "${packlist_temp}" "${f}"; fi; done; fi; done } perl_fix_permissions () { debug-print-function ${FUNCNAME} "$@"; perl_set_version; einfo Fixing installed file permissions; fperms -R u+w / } perl_get_module_version () { debug-print-function ${FUNCNAME} "$@"; [[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided"; [[ $# -lt 2 ]] || die "${FUNCNAME}: Too many parameters ($#)"; if ! perl_has_module "$@"; then echo "(Not Installed)"; return 1; fi; perl -we 'my $mn = $ARGV[0]; $mn =~ s{(::|\x{27})}{/}g; local $@; eval { require qq[${mn}.pm]; 1 } or do { print q[(Compilation failed in require)]; exit 1; }; my $stash = \%{ $ARGV[0] . q[::] }; if ( not exists $stash->{VERSION} ) { print q[(No VERSION property)]; exit 0; } if ( not defined ${$stash->{VERSION}} ) { print q[(undef)]; exit 0; } print ${$stash->{VERSION}}; exit 0; ' "$@" } perl_get_raw_vendorlib () { debug-print-function ${FUNCNAME} "$@"; [[ $# -lt 1 ]] || die "${FUNCNAME}: Too many parameters ($#)"; perl -MConfig -e'exists $Config{$ARGV[0]} || die qq{No such Config key "$ARGV[0]"}; print $Config{$ARGV[0]}; exit 0' -- "installvendorlib" || die "Can't extract installvendorlib from Perl Configuration" } perl_get_vendorlib () { debug-print-function ${FUNCNAME} "$@"; [[ $# -lt 1 ]] || die "${FUNCNAME}: Too many parameters ($#)"; perl -M5.014 -MConfig -e'exists $Config{$ARGV[0]} || die qq{No such Config key "$ARGV[0]"}; print $Config{$ARGV[0]} =~ s{\A\Q$ARGV[1]\E}{}r; exit 0' -- "installvendorlib" "$EPREFIX" || die "Can't extract installvendorlib from Perl Configuration" } perl_get_wikiurl () { debug-print-function ${FUNCNAME} "$@"; if [[ -z "${1}" ]]; then echo "https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/${CATEGORY}/${PN}"; else echo "https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/${CATEGORY}/${PN}#${1}"; fi } perl_get_wikiurl_features () { perl_get_wikiurl Optional_Features } perl_get_wikiurl_tests () { perl_get_wikiurl Testing } perl_has_module () { debug-print-function ${FUNCNAME} "$@"; [[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided"; [[ $# -lt 2 ]] || die "${FUNCNAME}: Too many parameters ($#)"; perl -we 'my $mn = $ARGV[0]; $mn =~ s{(::|\x{27})}{/}g; for(@INC){ next if ref $_; exit 0 if -r $_ . q[/] . $mn . q[.pm] } exit 1' "$@" } perl_has_module_version () { debug-print-function ${FUNCNAME} "$@"; [[ $# -gt 0 ]] || die "${FUNCNAME}: No module name provided"; [[ $# -gt 1 ]] || die "${FUNCNAME}: No module version provided"; [[ $# -lt 3 ]] || die "${FUNCNAME}: Too many parameters ($#)"; perl -we 'my $mn = $ARGV[0]; $mn =~ s{(::|\x{27})}{/}g; exit ( eval { require qq[${mn}.pm]; $ARGV[0]->VERSION($ARGV[1]); 1 } ? 0 : 1 )' "$@" } perl_link_duallife_scripts () { debug-print-function ${FUNCNAME} "$@"; [[ ${CATEGORY} != perl-core ]] && return 0; local i ff; if has "${EBUILD_PHASE:-none}" "postinst" "postrm"; then for i in "${DUALLIFESCRIPTS[@]}"; do alternatives_auto_makesym "/${i}" "/${i}-[0-9]*"; done; for i in "${DUALLIFEMAN[@]}"; do ff=`echo "${EROOT}"/${i%.1}-${PV}-${P}.1*`; ff=${ff##*.1}; alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*"; done; else pushd "${ED}" > /dev/null; for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null); do mv ${i}{,-${PV}-${P}} || die; DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i}; done; for i in $(find usr/share/man/man1 -maxdepth 1 -type f 2>/dev/null); do mv ${i} ${i%.1}-${PV}-${P}.1 || die; DUALLIFEMAN[${#DUALLIFEMAN[*]}]=${i}; done; popd > /dev/null; fi } perl_remove_temppath () { debug-print-function ${FUNCNAME} "$@"; find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f; do if file "${f}" | grep -q -i " text"; then grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}"; sed -i -e "s:${D%/}/:/:g" "${f}"; fi; done } perl_rm_files () { debug-print-function ${FUNCNAME} "$@"; local skipfile="${T}/.gentoo_makefile_skip"; local manifile="${S}/MANIFEST"; local manitemp="${T}/.gentoo_manifest_temp"; oldifs="$IFS"; IFS="\n"; for filename in "$@"; do einfo "Removing un-needed ${filename}"; rm -f "${S}/${filename}"; [[ -e "${manifile}" ]] && echo "${filename}" >> "${skipfile}"; done; if [[ -e "${manifile}" && -e "${skipfile}" ]]; then einfo "Fixing Manifest"; grep -v -F -f "${skipfile}" "${manifile}" > "${manitemp}"; mv -f -- "${manitemp}" "${manifile}"; rm -- "${skipfile}"; fi; IFS="$oldifs" } perl_set_version () { debug-print-function ${FUNCNAME} "$@"; debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}"; ${perlinfo_done} && return 0; perlinfo_done=true; local f version install{{site,vendor}{arch,lib},archlib}; eval "$(perl -V:{version,install{{site,vendor}{arch,lib},archlib}} )"; PERL_VERSION=${version}; SITE_ARCH=${installsitearch}; SITE_LIB=${installsitelib}; ARCH_LIB=${installarchlib}; VENDOR_LIB=${installvendorlib}; VENDOR_ARCH=${installvendorarch} } pkg_nofetch () { default } post_src_configure () { if [[ -z ${OLD_PATH} ]]; then return; fi; export PATH="${OLD_PATH}"; if [[ -f "${T}"/clang14.log ]]; then mkdir -p /var/tmp/clang/${CATEGORY}/${PF}; cp -rv "${T}"/clang{14,15}.log /var/tmp/clang/${CATEGORY}/${PF}; diff -ruN "${T}"/clang{14,15}.log > /var/tmp/clang/${CATEGORY}/${PF}/clang.diff; fi } pre_src_configure () { if [[ -n ${CC} && ${CC} != *clang* ]]; then return; fi; if ! type -P ansifilter &> /dev/null; then return; fi; export ac_cv_c_undeclared_builtin_options="none needed"; export gl_cv_compiler_check_decl_option="-Werror=implicit-function-declaration"; if [[ ${CHOST} == *musl* ]]; then export ac_cv_func___fpurge="yes"; export ac_cv_func_fpurge="yes"; export ac_cv_have_decl_fpurge="no"; export gl_cv_func_fpurge_works="no"; export ac_cv_header_sys_types_h_makedev="no"; export gl_cv_minmax_in_limits_h="no"; fi; cat <<-EOF > "${T}"/clang #!/usr/bin/env bash # Need > /dev/null for sys-libs/musl clang-15 ${CFLAGS} -Wno-unused-command-line-argument -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=strict-prototypes \$@ 2>&1 | ansifilter | sed -e "s:14.0.6:14.ignoreme:g" -e "s:15.0.0:14.ignoreme:g" -e "s:conftest-.*\.o:conftest.o:g" -e "s_conftest\.c\:[0-9]\+\:[0-9]\+_ignoreme_g" -e '/[0-9]\+ \(warning\|error\) generated/d' | tee -a "${T}"/clang14.log > /dev/null # TODO: No -Werror=strict-prototypes here for now as AC_PROG_LEX, AC_CHECK_FUNCS rely on it # also, I think Clang 15.0.1 (which reverts the other bits) keeps that in anyway. clang-15 ${CFLAGS} -Wno-unused-command-line-argument -Werror=implicit-function-declaration -Werror=implicit-int \$@ 2>&1 | ansifilter | sed -e "s:14.0.6:14.ignoreme:g" -e "s:15.0.0:14.ignoreme:g" -e "s:15:14:g" -e "s:conftest-.*\.o:conftest.o:g" -e "s_conftest\.c\:[0-9]\+\:[0-9]\+_ignoreme_g" -e '/[0-9]\+ \(warning\|error\) generated/d' | tee -a "${T}"/clang15.log > /dev/null x=\${PIPESTATUS} # Non-Autoconf configure scripts might try to parse stderr/stdout, so just run # it again... if [[ -f configure ]] && ! grep -q "#.*Generated by Autoconf" configure ; then clang-15 \$@ else exit \${x[0]} fi EOF chmod +x "${T}"/clang; export CFLAGS="${CFLAGS} -Werror=implicit-function-declaration -Werror=implicit-int"; export OLD_PATH="${PATH}"; export PATH="${T}:${PATH}" } readme.gentoo_create_doc () { debug-print-function ${FUNCNAME} "${@}"; if [[ -n "${DOC_CONTENTS}" ]]; then if [[ -n "${DISABLE_AUTOFORMATTING}" ]]; then echo "${DOC_CONTENTS}" > "${T}"/README.gentoo || die; else local saved_flags=$-; set -f; echo -e ${DOC_CONTENTS} | fold -s -w 70 | sed 's/[[:space:]]*$//' > "${T}"/README.gentoo; assert; set +f -${saved_flags}; fi; else if [[ -f "${FILESDIR}/README.gentoo-${SLOT%/*}" ]]; then cp "${FILESDIR}/README.gentoo-${SLOT%/*}" "${T}"/README.gentoo || die; else if [[ -f "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" ]]; then cp "${FILESDIR}/README.gentoo${README_GENTOO_SUFFIX}" "${T}"/README.gentoo || die; else die "You are not specifying README.gentoo contents!"; fi; fi; fi; ( docinto .; dodoc "${T}"/README.gentoo ) || die; README_GENTOO_DOC_VALUE=$(< "${T}/README.gentoo") } readme.gentoo_print_elog () { debug-print-function ${FUNCNAME} "${@}"; if [[ -z "${README_GENTOO_DOC_VALUE}" ]]; then die "readme.gentoo_print_elog invoked without matching readme.gentoo_create_doc call!"; else if ! [[ -n "${REPLACING_VERSIONS}" ]] || [[ -n "${FORCE_PRINT_ELOG}" ]]; then echo -e "${README_GENTOO_DOC_VALUE}" | while read -r ELINE; do elog "${ELINE}"; done; elog ""; elog "(Note: Above message is only printed the first time package is"; elog "installed. Please look at ${EPREFIX}/usr/share/doc/${PF}/README.gentoo*"; elog "for future reference)"; fi; fi } source_profile () { set +u; source /etc/profile 2> /dev/null; set -u } declare -fx source_profile src_compile () { perl-module_src_compile "$@" } src_configure () { perl-module_src_configure "$@" } src_install () { perl-module_src_install "$@" } src_prepare () { perl-module_src_prepare "$@" } src_test () { perl-module_src_test "$@" } src_unpack () { default } syncRepo () { local synclog=/var/tmp/tb/sync.log; local curr_time=$EPOCHSECONDS; cd /var/db/repos/gentoo; if ! emaint sync --auto &> $synclog; then if grep -q -e 'git fetch error' -e ': Failed to connect to ' -e ': SSL connection timeout' -e ': Connection timed out' -e 'The requested URL returned error: 500' $synclog; then return 1; fi; if { echo -e "\nTrying to restore ...\n"; git stash; git stash drop; git restore . } &>> $synclog; then if ! emaint sync --auto &>> $synclog; then Finish 13 "still unfixed ::gentoo" $synclog; else Mail "INFO: fixed ::gentoo" $synclog; fi; else Finish 13 "cannot restore ::gentoo" $synclog; fi; fi; if grep -q -F '* An update to portage is available.' $synclog; then add2backlog "sys-apps/portage"; fi; if ! grep -B 1 '=== Sync completed for gentoo' $synclog | grep -q 'Already up to date.'; then git diff --diff-filter="ACM" --name-only "@{ $(( EPOCHSECONDS-last_sync+3600 )) second ago }".."@{ 1 hour ago }" | grep -F -e '/files/' -e '.ebuild' -e 'Manifest' | cut -f1-2 -d'/' -s | grep -v -f /mnt/tb/data/IGNORE_PACKAGES | sort -u > /tmp/syncRepo.upd; if [[ -s /tmp/syncRepo.upd ]]; then sort -u /tmp/syncRepo.upd /var/tmp/tb/backlog.upd | shuf > /tmp/backlog.upd; cp /tmp/backlog.upd /var/tmp/tb/backlog.upd; fi; fi; last_sync=$curr_time } declare -fx syncRepo ver_cut () { local range=${1}; local v=${2:-${PV}}; local start end; local -a comp; __eapi7_ver_split "${v}"; local max=$((${#comp[@]}/2)); __eapi7_ver_parse_range "${range}" "${max}"; local IFS=; if [[ ${start} -gt 0 ]]; then start=$(( start*2 - 1 )); fi; echo "${comp[*]:start:end*2-start}" } ver_rs () { local v; (( ${#} & 1 )) && v=${@: -1} || v=${PV}; local start end i; local -a comp; __eapi7_ver_split "${v}"; local max=$((${#comp[@]}/2 - 1)); while [[ ${#} -ge 2 ]]; do __eapi7_ver_parse_range "${1}" "${max}"; for ((i = start*2; i <= end*2; i+=2 )) do [[ ${i} -eq 0 && -z ${comp[i]} ]] && continue; comp[i]=${2}; done; shift 2; done; local IFS=; echo "${comp[*]}" } ver_test () { local va op vb; if [[ $# -eq 3 ]]; then va=${1}; shift; else va=${PVR}; fi; [[ $# -eq 2 ]] || die "${FUNCNAME}: bad number of arguments"; op=${1}; vb=${2}; case ${op} in -eq | -ne | -lt | -le | -gt | -ge) ;; *) die "${FUNCNAME}: invalid operator: ${op}" ;; esac; __eapi7_ver_compare "${va}" "${vb}"; test $? "${op}" 2 }