diff options
| author | Franoosh <uinarf@autistici.org> | 2025-11-17 17:16:48 +0100 |
|---|---|---|
| committer | Franoosh <uinarf@autistici.org> | 2025-11-17 17:16:48 +0100 |
| commit | 7d68eb43cfc9bd57768031d6e81192911dc09439 (patch) | |
| tree | 0ab189fc27a83b6d4669293f96bf983f17a5cc19 | |
| parent | d2f80432c8798afd3b8a2e471efb28316e163325 (diff) | |
| download | Bash-7d68eb43cfc9bd57768031d6e81192911dc09439.tar.gz Bash-7d68eb43cfc9bd57768031d6e81192911dc09439.tar.bz2 Bash-7d68eb43cfc9bd57768031d6e81192911dc09439.zip | |
Polished emerge script for the server and added script for a client
| -rwxr-xr-x[-rw-r--r--] | emerge | 9 | ||||
| -rwxr-xr-x | emerge-client | 30 |
2 files changed, 37 insertions, 2 deletions
@@ -1,12 +1,17 @@ #!/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. +# One needs to put it on $PATH before /usr/bin/emerge, for instance /usr/bin/local on the binhost user host. 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" +PKGDIR="/var/cache/binhost/rpi3/binpgs/$PKGDIR${PROFILE}/gcc-${GCC_VERSION}.x/armv8a" export BINHOST_DIR=${BINHOST_DIR} @@ -16,4 +21,4 @@ if [ ! -d "${BINHOST_DIR}" ]; then else echo "Binhost directory ${BINHOST_DIR} exists, proceeding" fi -PKGDIR="${BINHOST_DIR}" /usr/bin/emerge "$@" +PKGDIR="${PKGDIR}" /usr/bin/emerge "$@" diff --git a/emerge-client b/emerge-client new file mode 100755 index 0000000..eddfac1 --- /dev/null +++ b/emerge-client @@ -0,0 +1,30 @@ +#!/usr/bin/env bash + +# This script is for a binhost client. +# 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) +PKGDIR="${PROFILE}/gcc-${GCC_VERSION}.x/armv8a" +BINHOST_USER='example_user' +BINHOST_SERVER='example_binhost_server' +BINHOST_PATH='/var/www/binhost/rpi3/binpkgs/' + +export BINHOST_DIR=${BINHOST_DIR} + +NEW_PORTAGE_BINHOST="PORTAGE_BINHOST='ssh://$BINHOST_USER@$BINHOST_SERVER$BINHOST_PATH$PKGDIR'" +OLD_BINHOST=$(grep PORTAGE_BINHOST=\' make.conf) +if [ "$OLD_BINHOST" != "$NEW_PORTAGE_BINHOST" ];then + echo "Replacing old binhost value in make.conf with new" + echo "Old value: $OLD_BINHOST" + echo "New value: $NEW_PORTAGE_BINHOST" + sed -i '/^PORTAGE_BINHOST/i # Old PORTAGE_BINHOST:' make.conf + sed -i 's/^PORTAGE_BINHOST/# PORTAGE_BINHOST/' make.conf + sed -i "/^# PORTAGE_BINHOST/a $NEW_PORTAGE_BINHOST" make.conf + echo "Proceeding with emerge ..." +else + echo "Binhost value has not changed, proceeding with emerge ..." +fi + |
