#!/usr/bin/env bash # Script creating new binhost directories if they don't exist # after changing profile/gcc versions. # To be placed in $PATH before /usr/bin/emerge, for instance /usr/bin/local PROFILE=$(eselect profile show|sed -n 2p|cut -d '/' -f4) GCC_VERSION=$(eselect gcc show|cut -d '-' -f5) BINHOST_DIR="/var/cache/binpkgs/${PROFILE}/gcc-${GCC_VERSION}.x/armv8a" export BINHOST_DIR=${BINHOST_DIR} if [ ! -d "${BINHOST_DIR}" ]; then echo "${BINHOST_DIR} does not exist, creating" mkdir -p "${BINHOST_DIR}" else echo "Binhost directory ${BINHOST_DIR} exists, proceeding" fi PKGDIR="${BINHOST_DIR}" /usr/bin/emerge "$@"