# vim:ft=sh: source config DESTROOT="${CFG_DIR_WRKSPC}" PKGCMD=fedpkg BUILDSYS=koji POI=$(cat <<-EOF active/eot-utils closed/luci active/python-robofab EOF ) # grep: suppress also broken pipe message (?) yum list installed | grep -qs ${PKGCMD} || su -c "yum install ${PKGCMD}" mkdir -p "${DESTROOT}/g${BUILDSYS}" pushd "${DESTROOT}/g${BUILDSYS}" >/dev/null for pkg in ${POI}; do dname=$(dirname ${pkg}) bname=$(basename ${pkg}) mkdir -p ${dname} pushd ${dname} >/dev/null test -d ${bname} || ${PKGCMD} clone ${bname} cd ${bname} branch=$(${PKGCMD} switch-branch --list | tail -n2 | head -n1 | cut -d/ -f2) if [ "$(git rev-parse --abbrev-ref HEAD)" != "${BRANCH}" ]; then ${PKGCMD} switch-branch ${branch} ${PKGCMD} prep # incl. downloading source fi popd >/dev/null done popd >/dev/null unset local pkg bname dname branch unset DESTROOT PKGCMD BUILDSYS POI