summaryrefslogtreecommitdiff
path: root/emerge
blob: 33def2bf19573f92c6cf629468f54e3274c75363 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
#############################################################################
#               This script is for a binhost server.                        #
#                                                                           #
# 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 #
#                                                                           #
# For a binhost client you need this defined:                               #
# PORTAGE_BINHOST="ssh://user@binhost_server/path/to/binary/host/$PKGDIR"   #
#                                                                           #
# There is an accompanying script emerge-client in the repo.                #
#############################################################################

PROFILE=$(eselect profile show|sed -n 2p|cut -d '/' -f4)
GCC_VERSION=$(eselect gcc show|cut -d '-' -f5)
PKGDIR="/var/cache/binhost/rpi3/binpgs/$PKGDIR${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="${PKGDIR}" /usr/bin/emerge "$@"