declare -x ABI="amd64" declare -x ABI_MIPS="" declare -x ABI_S390="" declare -x ABI_X86="64" declare -x ADA_TARGET="" declare -x ALLOW_TEST="network" declare -x ALSA_CARDS="" declare -x APACHE2_MODULES="" declare -x APACHE2_MPMS="" declare -x ARCH="amd64" declare -x AUTOJUMP_ERROR_PATH="/root/.local/share/autojump/errors.log" declare -x AUTOJUMP_SOURCED="1" declare BDEPEND=">=dev-lang/go-1.16 app-arch/unzip" declare -x BOOTSTRAP_USE="unicode internal-glib pkg-config split-usr xml python_targets_python3_10 multilib" declare -x CALLIGRA_FEATURES="" declare -x CAMERAS="" declare -x CARGO_TERM_COLOR="never" declare -x CATKIN_PREFIX_PATH="/usr" declare -x CBUILD="x86_64-pc-linux-gnu" 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 -- COMMON_DEPEND=" app-crypt/gpgme:= app-containers/conmon app-containers/runc dev-libs/glib:= dev-libs/libassuan:= dev-libs/libgpg-error:= net-firewall/conntrack-tools net-firewall/iptables net-misc/cni-plugins net-misc/socat sys-apps/iproute2 sys-libs/libseccomp:= btrfs? ( sys-fs/btrfs-progs ) device-mapper? ( sys-fs/lvm2:= ) selinux? ( sys-libs/libselinux:= ) systemd? ( sys-apps/systemd:= )" declare -x CPU_FLAGS_ARM="" declare -x CPU_FLAGS_PPC="" declare -x CPU_FLAGS_X86="" declare -x CURL_SSL="" declare -x CXXFLAGS="-pipe -march=native -fno-diagnostics-color -O2" declare -x DCC_EMAILLOG_WHOM_TO_BLAME="" declare -x DEBUGBUILD="1" declare -x DEFAULT_ABI="amd64" declare -x DEFINED_PHASES=" compile install prepare unpack" declare DEPEND=" app-crypt/gpgme:= app-containers/conmon app-containers/runc dev-libs/glib:= dev-libs/libassuan:= dev-libs/libgpg-error:= net-firewall/conntrack-tools net-firewall/iptables net-misc/cni-plugins net-misc/socat sys-apps/iproute2 sys-libs/libseccomp:= btrfs? ( sys-fs/btrfs-progs ) device-mapper? ( sys-fs/lvm2:= ) selinux? ( sys-libs/libselinux:= ) systemd? ( sys-apps/systemd:= ) dev-go/go-md2man " declare DESCRIPTION="OCI-based implementation of Kubernetes Container Runtime Interface" declare -x DIALIGN2_DIR="/usr/share/dialign2" declare -x DIROPTIONS="-m0755" declare -x DSM_CONFIG="/etc/tivoli/dsm.opt" declare -x DSM_DIR="/opt/tivoli/tsm/client/ba/bin" declare -x DSM_LOG="/var/log/tsm" declare -x EAPI="7" declare -x EC2_AMITOOL_HOME="/usr" declare -- EGIT_COMMIT="a3bbde8a77c323aa6a485da9a9046299155c6016" declare -x EGO_BUILD_FLAGS="-p 4" declare -x ELIBC="glibc" declare -x EMBOSS_ACDROOT="/usr/share/EMBOSS/acd" declare -x EMBOSS_DATA="/usr/share/EMBOSS/data" 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="1657307789.911565" declare -- EPOCHSECONDS="1657307789" 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 FLTK_DOCDIR="/usr/share/doc/fltk-1.3.5-r4/html" declare -x GCC_COLORS="" declare -x GCC_SPECS="" declare -x GIT_PAGER="cat" declare -x GO111MODULE="on" declare -x GO19CONCURRENTCOMPILATION="0" declare -x GOCACHE="/var/tmp/portage/app-containers/cri-o-1.24.1/temp/go-build" declare -x GOFLAGS="-modcacherw -v -x" declare -x GOMAXPROCS="4" declare -x GOMODCACHE="/var/tmp/portage/app-containers/cri-o-1.24.1/work/go-mod" declare -x GPSD_PROTOCOLS="" declare -x GRUB_PLATFORMS="" declare -x GSETTINGS_BACKEND="dconf" declare HOMEPAGE="https://cri-o.io/" declare IDEPEND declare -x INHERITED=" go-module" declare -x INPUT_DEVICES="" declare -x INSOPTIONS="-m0644" declare IUSE="btrfs +device-mapper selinux systemd " declare -x IUSE_EFFECTIVE="abi_x86_64 alpha amd64 amd64-linux arm arm64 arm64-macos btrfs device-mapper 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 selinux sparc sparc-solaris sparc64-solaris systemd 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 ~arm64" declare -x L10N="" declare -x LADSPA_PATH="/usr/lib64/ladspa" 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="Apache-2.0 BSD BSD-2 CC-BY-SA-4.0 ISC MIT MPL-2.0" declare -x LLVM_TARGETS="" declare -x LMOD_CACHED_LOADS="yes" 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" 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 MULTITALK_DIR="/usr/share/multitalk" 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 ORACLE_HOME="/usr/lib64/oracle/client" 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:/usr/lib/llvm/12/bin" declare PDEPEND="" 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/cri-o-1.24.1/html") declare -a PORTAGE_DOSTRIP=() declare -a PORTAGE_DOSTRIP_SKIP=() declare -x PORTAGE_TMPFS="/dev/shm" declare -x PORT_LOGDIR="/var/log/portage" declare -x POSTGRES_TARGETS="" declare -x PRELINK_PATH_MASK="/usr/bin/bbkeys" 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 -- QA_FLAGS_IGNORED=".*" declare -x QEMU_SOFTMMU_TARGETS="" declare -x QEMU_USER_TARGETS="" declare -x QRNADB="/usr/share/qrna/data" declare RDEPEND=" app-crypt/gpgme:= app-containers/conmon app-containers/runc dev-libs/glib:= dev-libs/libassuan:= dev-libs/libgpg-error:= net-firewall/conntrack-tools net-firewall/iptables net-misc/cni-plugins net-misc/socat sys-apps/iproute2 sys-libs/libseccomp:= btrfs? ( sys-fs/btrfs-progs ) device-mapper? ( sys-fs/lvm2:= ) selinux? ( sys-libs/libselinux:= ) systemd? ( sys-apps/systemd:= ) ! ${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 } _go-module_gomod_encode () { debug-print-function "${FUNCNAME}" "$@"; re='(.*)([A-Z])(.*)'; input="${1}"; while [[ ${input} =~ ${re} ]]; do lower='!'"${BASH_REMATCH[2],}"; input="${BASH_REMATCH[1]}${lower}${BASH_REMATCH[3]}"; done; echo "${input}" } _go-module_gosum_synthesize_files () { local target=$1; local version=$2; cat > "${target}/${version}.info" <<-EOF { "Version": "${version}", "shortName": "${version}", "Name": "${version}" } EOF listfile="${target}"/list; if ! grep -sq -x -e "${version}" "${listfile}" 2> /dev/null; then echo "${version}" >> "${listfile}"; fi } _go-module_src_unpack_gosum () { debug-print-function "${FUNCNAME}" "$@"; if [[ ! -n ${_GO_MODULE_SET_GLOBALS_CALLED} ]]; then die "go-module_set_globals must be called in global scope"; fi; local goproxy_dir="${GOPROXY/file:\/\//}"; mkdir -p "${goproxy_dir}" || die; local f; local goproxy_mod_dir; for f in ${A}; do goproxy_mod_path="${_GOMODULE_GOSUM_REVERSE_MAP["${f}"]}"; if [[ -n "${goproxy_mod_path}" ]]; then debug-print-function "Populating go proxy for ${goproxy_mod_path}"; goproxy_mod_dir=$( dirname "${goproxy_dir}"/"${goproxy_mod_path}" ); mkdir -p "${goproxy_mod_dir}" || die; ln -sf "${DISTDIR}"/"${f}" "${goproxy_dir}/${goproxy_mod_path}" || die "Failed to ln"; local v=${goproxy_mod_path}; v="${v%.mod}"; v="${v%.zip}"; v="${v//*\/}"; _go-module_gosum_synthesize_files "${goproxy_mod_dir}" "${v}"; else unpack "$f"; fi; done; _go-module_src_unpack_verify_gosum } _go-module_src_unpack_verify_gosum () { debug-print-function "${FUNCNAME}" "$@"; if [[ ! -n ${_GO_MODULE_SET_GLOBALS_CALLED} ]]; then die "go-module_set_globals must be called in global scope"; fi; cd "${S}" || die "cd failed"; einfo "Tidying go.mod/go.sum"; nonfatal ego mod tidy > /dev/null } 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 } ego () { set -- go "$@"; echo "$@" 1>&2; "$@" || die -n "${*} failed" } 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}" } go-module_live_vendor () { debug-print-function "${FUNCNAME}" "$@"; has live ${PROPERTIES} || die "${FUNCNAME} only allowed in live ebuilds"; [[ "${EBUILD_PHASE}" == unpack ]] || die "${FUNCNAME} only allowed in src_unpack"; [[ -d "${S}"/vendor ]] && die "${FUNCNAME} only allowed when upstream isn't vendoring"; pushd "${S}" &> /dev/null || die; ego mod vendor; popd &> /dev/null || die } go-module_set_globals () { local line exts; local error_in_gosum=0; local -a gosum_errorlines; local newline=' '; for line in "${EGO_SUM[@]}"; do local module version modfile version_modfile kvs x; read -r module version_modfile kvs <<< "${line}"; IFS=/ read -r version modfile x <<< "${version_modfile}"; if [[ -n ${x} ]]; then error_in_gosum=1; gosum_errorlines+=("Bad version: ${version_modfile}"); continue; fi; exts=(); local errormsg=''; case "${modfile}" in '') exts=(zip) ;; 'go.mod' | '/go.mod') exts=(mod) ;; *) errormsg="Unknown modfile: line='${line}', modfile='${modfile}'" ;; esac; if [[ -n ${errormsg} ]]; then error_in_gosum=1; gosum_errorlines+=("${errormsg} line='${line}', modfile='${modfile}'"); continue; fi; _dir=$(_go-module_gomod_encode "${module}"); for _ext in "${exts[@]}"; do _reluri="${_dir}/@v/${version}.${_ext}"; _uri="${_GOMODULE_GOPROXY_BASEURI}/${_reluri}"; _distfile="${_reluri//\//%2F}"; EGO_SUM_SRC_URI+=" ${_uri} -> ${_distfile}${newline}"; _GOMODULE_GOSUM_REVERSE_MAP["${_distfile}"]="${_reluri}"; done; done; if [[ ${error_in_gosum} != 0 ]]; then eerror "Trailing information in EGO_SUM in ${P}.ebuild"; for line in "${gosum_errorlines[@]}"; do eerror "${line}"; done; die "Invalid EGO_SUM format"; fi; readonly EGO_SUM; readonly EGO_SUM_SRC_URI; readonly _GOMODULE_GOSUM_REVERSE_MAP; export GOPROXY="file://${T}/go-proxy"; _GO_MODULE_SET_GLOBALS_CALLED=1 } go-module_setup_proxy () { debug-print-function "${FUNCNAME}" "$@"; if [[ ! -n ${_GO_MODULE_SET_GLOBALS_CALLED} ]]; then die "go-module_set_globals must be called in global scope"; fi; local goproxy_dir="${GOPROXY/file:\/\//}"; mkdir -p "${goproxy_dir}" || die; local f; local goproxy_mod_dir; for f in ${A}; do goproxy_mod_path="${_GOMODULE_GOSUM_REVERSE_MAP["${f}"]}"; if [[ -n "${goproxy_mod_path}" ]]; then debug-print-function "Populating go proxy for ${goproxy_mod_path}"; goproxy_mod_dir=$( dirname "${goproxy_dir}"/"${goproxy_mod_path}" ); mkdir -p "${goproxy_mod_dir}" || die; ln -sf "${DISTDIR}"/"${f}" "${goproxy_dir}/${goproxy_mod_path}" || die "Failed to ln"; local v=${goproxy_mod_path}; v="${v%.mod}"; v="${v%.zip}"; v="${v//*\/}"; _go-module_gosum_synthesize_files "${goproxy_mod_dir}" "${v}"; fi; done; _go-module_src_unpack_verify_gosum } go-module_src_unpack () { if [[ "${#EGO_SUM[@]}" -gt 0 ]]; then eqawarn "This ebuild uses EGO_SUM which is deprecated"; eqawarn "Please migrate to a dependency tarball"; eqawarn "This will become a fatal error in the future"; _go-module_src_unpack_gosum; else if [[ "${#EGO_VENDOR[@]}" -gt 0 ]]; then eerror "${EBUILD} is using EGO_VENDOR which is no longer supported"; die "Please update this ebuild"; else default; fi; 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[@]#[+-]}" } pkg_nofetch () { default } source_profile () { set +u; source /etc/profile 2> /dev/null; set -u } declare -fx source_profile src_compile () { [[ -f hack/btrfs_installed_tag.sh ]] || die; use btrfs || { echo -e "#!/bin/sh\necho exclude_graphdriver_btrfs" > hack/btrfs_installed_tag.sh || die }; [[ -f hack/libdm_installed.sh ]] || die; use device-mapper || { echo -e "#!/bin/sh\necho exclude_graphdriver_devicemapper" > hack/libdm_installed.sh || die }; [[ -f hack/selinux_tag.sh ]] || die; use selinux || { echo -e "#!/bin/sh\ntrue" > hack/selinux_tag.sh || die }; mkdir -p bin || die; emake all GOBIN="${S}/bin" GO_BUILD="go build ${GOFLAGS}" GO_MD2MAN="$(which go-md2man)" } src_configure () { default } src_install () { emake install install.config install.systemd DESTDIR="${D}" GO_MD2MAN="$(which go-md2man)" PREFIX="${D}${EPREFIX}/usr"; keepdir /etc/crio; mv "${ED}/etc/crio/crio.conf"{,.example} || die; newinitd "${FILESDIR}/crio.initd" crio; insinto /etc/logrotate.d; newins "${FILESDIR}/${PN}.logrotated" "${PN}"; keepdir /etc/containers/oci/hooks.d; keepdir /usr/share/containers/oci/hooks.d; keepdir /etc/cni/net.d; insinto /etc/cni/net.d; doins contrib/cni/99-loopback.conf } src_prepare () { default; sed -e '/^export GOPROXY=/d' -e '/^GIT_.*/d' -e '/ git diff --exit-code/d' -e 's/$(GO) build -i/$(GO) build -v -work -x/' -e 's/\${GIT_COMMIT}/'${EGIT_COMMIT}'/' -e "s|^GIT_COMMIT := .*|GIT_COMMIT := ${EGIT_COMMIT}|" -e "s|^COMMIT_NO := .*|COMMIT_NO := ${EGIT_COMMIT}|" -i Makefile || die; echo ".NOTPARALLEL: binaries docs" >> Makefile || die; sed -e 's:/usr/local/bin:/usr/bin:' -i contrib/systemd/* || die } src_test () { default } src_unpack () { go-module_src_unpack "$@" } 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'; 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 }