diff options
author | Erg <uinarf@autistici.org> | 2024-10-21 18:56:19 +0200 |
---|---|---|
committer | Erg <uinarf@autistici.org> | 2024-10-21 18:56:19 +0200 |
commit | d2f80432c8798afd3b8a2e471efb28316e163325 (patch) | |
tree | 0e1d484b09e19d2ef7d249e6fa5349ab1ba0cf11 | |
download | Bash-d2f80432c8798afd3b8a2e471efb28316e163325.tar.gz Bash-d2f80432c8798afd3b8a2e471efb28316e163325.tar.bz2 Bash-d2f80432c8798afd3b8a2e471efb28316e163325.zip |
Script creating new binhost directories if they don't exist after changing profile/gcc versions.master
-rw-r--r-- | emerge | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 "$@" |