summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/firstrun/20-fedpkg6
-rw-r--r--scripts/firstrun/23-repos40
-rw-r--r--scripts/firstrun/config2
3 files changed, 46 insertions, 2 deletions
diff --git a/scripts/firstrun/20-fedpkg b/scripts/firstrun/20-fedpkg
index 3cb349b..978e1cd 100644
--- a/scripts/firstrun/20-fedpkg
+++ b/scripts/firstrun/20-fedpkg
@@ -1,4 +1,6 @@
-DESTROOT="${HOME}/wrkspc"
+# vim:ft=sh:
+source config
+DESTROOT="${CFG_DIR_WRKSPC}"
PKGCMD=fedpkg
BUILDSYS=koji
POI=$(cat <<-EOF
@@ -19,7 +21,7 @@ for pkg in ${POI}; do
bname=$(basename ${pkg})
mkdir -p ${dname}
pushd ${dname} >/dev/null
- ${PKGCMD} clone ${bname}
+ 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
diff --git a/scripts/firstrun/23-repos b/scripts/firstrun/23-repos
new file mode 100644
index 0000000..a61c04d
--- /dev/null
+++ b/scripts/firstrun/23-repos
@@ -0,0 +1,40 @@
+# 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-1st-gen~~ssh://git.fedorahosted.org/git/conga-luci-1stgen.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
+EOF
+)
+
+# grep: suppress also broken pipe message (?)
+yum list installed | 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/)
+ ${VCSCMD} branch ${branch}
+ popd >/dev/null
+done
+
+popd >/dev/null
+unset local pkg dest bname dname branch
+unset DESTROOT PKGCMD BUILDSYS POI
diff --git a/scripts/firstrun/config b/scripts/firstrun/config
new file mode 100644
index 0000000..3cf3647
--- /dev/null
+++ b/scripts/firstrun/config
@@ -0,0 +1,2 @@
+# vim:ft=sh:
+CFG_DIR_WRKSPC="${HOME}/wrkspc"