-
Notifications
You must be signed in to change notification settings - Fork 13
/
dl_pkgs.sh
executable file
·44 lines (37 loc) · 1.14 KB
/
dl_pkgs.sh
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
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/bash
PROCESSORS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
DEFAULT_RELEASE="test/26_Alpha"
if [ x$1 == x ]; then
echo "No NVR file provided"
echo
echo "Usage `basename $0` <NVR file> [release]"
echo
echo "Default release: ${DEFAULT_RELEASE}"
exit 1
else
nvrfile=$(realpath $1)
fi
if [ x$2 == x ]; then
release="${DEFAULT_RELEASE}"
else
release=$2
fi
# Download all sources at same time
mkdir -p repo/$release/override/source-cache
pushd repo/$release/override/source-cache
cat $nvrfile | xargs --max-procs=$PROCESSORS -I NVR \
koji download-build --arch=src NVR
popd
for arch in "aarch64" "armv7hl" "i686" "ppc64" "ppc64le" "s390x" "x86_64"; do
mkdir -p repo/$release/override/$arch/os repo/$release/override/$arch/sources
pushd repo/$release/override/$arch/os/
cat $nvrfile | xargs --max-procs=$PROCESSORS -I NVR \
koji download-build --arch=noarch --arch=$arch NVR
popd
cat $nvrfile | while read NVR
do
cp -vf repo/$release/override/source-cache/$NVR.* repo/$release/override/$arch/sources/
done
done
# Cleanup all our sources
rm -rf repo/$release/override/source-cache