summaryrefslogtreecommitdiff
path: root/emerge
blob: 24d11f9c845c9e4d3374b41a85248c0b54288c43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 "$@"