summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emerge19
1 files changed, 19 insertions, 0 deletions
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 "$@"