#!/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