# vim:ft=sh: source config DESTROOT="${CFG_DIR_WRKSPC}" VCSCMD=git POI=$(cat <<-EOF gwork/cluster~~~~~~~~~~~~~ssh://git.fedorahosted.org/git/cluster.git gwork/cluster-overview~~~~ssh://fedorapeople.org/home/fedora/jpokorny/public_git/cluster-overview.git gwork/conga-luci-1stgen~~~ssh://git.fedorahosted.org/git/conga-luci-1stgen.git gwork/conga~~~~~~~~~~~~~~~ssh://git.fedorahosted.org/git/conga.git gwork/luci~~~~~~~~~~~~~~~~ssh://git.fedorahosted.org/git/luci.git gwork/resource-agents~~~~~git://github.com/ClusterLabs/resource-agents.git gwork/resource-agents-my~~git@jnpkrn.github.com:jnpkrn/resource-agents.git gwork/fence-agents~~~~~~~~git://git.fedorahosted.org/fence-agents.git gwork/libqb~~~~~~~~~~~~~~~git://github.com/asalkeld/libqb.git gwork/corosync~~~~~~~~~~~~git://github.com/corosync/corosync.git EOF ) # grep: suppress also broken pipe message (?) yum list installed 2>/dev/null | grep -qs ${VCSCMD} \ || su -c "yum install ${VCSCMD}" mkdir -p "${DESTROOT}" pushd "${DESTROOT}" >/dev/null for pkg in ${POI}; do dest=$(echo ${pkg} | tr -s '~' | cut -d~ -f1) dname=$(dirname ${dest}) bname=$(basename ${dest}) mkdir -p ${dname} pushd ${dname} >/dev/null echo "bname: ${bname}" test -d ${bname} \ || ${VCSCMD} clone "$(echo ${pkg} | tr -s '~' | cut -d~ -f2)" ${bname} cd ${bname} branch=$(${VCSCMD} for-each-ref --count=1 --sort=-committerdate \ --format='%(refname:short)' refs/heads/) if [ "$(${VCSCMD} rev-parse --abbrev-ref HEAD)" != "${BRANCH}" ]; then ${VCSCMD} checkout ${branch} fi popd >/dev/null done popd >/dev/null unset local pkg dest bname dname branch unset DESTROOT PKGCMD BUILDSYS POI