From d2f80432c8798afd3b8a2e471efb28316e163325 Mon Sep 17 00:00:00 2001 From: Erg Date: Mon, 21 Oct 2024 18:56:19 +0200 Subject: Script creating new binhost directories if they don't exist after changing profile/gcc versions. --- emerge | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 emerge diff --git a/emerge b/emerge new file mode 100644 index 0000000..24d11f9 --- /dev/null +++ b/emerge @@ -0,0 +1,19 @@ +#!/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 "$@" -- cgit v1.2.3-65-gdbad