summaryrefslogtreecommitdiffstats
path: root/scripts/firstrun/20-fedpkg
blob: 01fdabafda7e1d5fb0577ad71bbd03fa3159ee45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
DESTROOT="${HOME}/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
	${PKGCMD} clone ${bname}
	cd ${bname}
	branch=$(${PKGCMD} switch-branch --list | tail -n2 | head -n1 | cut -d/ -f2)
	${PKGCMD} switch-branch ${branch}
	${PKGCMD} prep  # incl. downloading source
	popd >/dev/null
done

popd >/dev/null
unset local pkg bname dname branch
unset DESTROOT PKGCMD BUILDSYS POI