jtc-overlay/sys-fs/bees/update_ebuild.sh
2022-08-30 15:46:53 -04:00

46 lines
718 B
Bash
Executable File

#!/bin/bash
GIT_URL="https://github.com/Zygo/bees.git"
GIT_COMMIT=
EBUILD="bees-9999.ebuild"
BASE_DIR="/usr/local/jtc-overlay/sys-fs/bees"
git_clone() {
mkdir -p "${BASE_DIR}/git"
if [ -d "${BASE_DIR}/git/bees" ]
then
cd "${BASE_DIR}/git/bees"
git checkout master
git pull
else
cd "${BASE_DIR}/git"
git clone "${GIT_URL}"
fi
if [ -n "${GIT_COMMIT}" ]
then
cd "${BASE_DIR}/git/bees"
git checkout "${GIT_COMMIT}"
fi
}
git_cleanup() {
rm -rf "${BASE_DIR}/git"
}
update() {
cd "${BASE_DIR}"
rsync -av --delete --exclude git --exclude Manifest --exclude "${0##*/}" ./git/bees/contrib/gentoo/ ./
ebuild ${EBUILD} manifest digest
}
git_clone
update
git_cleanup