summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_setup_mock.sh
blob: 1ee8b95effc3207d6e83b3778bf5b3c82f42f103 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

# Copyright 2015 Holger Levsen <holger@layer-acht.org>
# released under the GPLv=2

#
# configure mock for a given release and architecture
#

DEBUG=false
. /srv/jenkins/bin/common-functions.sh
common_init "$@"

if [ -z "$1" ] || [ -z "$2" ] ; then
	echo "Need release and architecture as params."
	exit 1
fi
RELEASE=$1
ARCH=$2

echo "$(date -u) - showing setup."
dpkg -l mock
id
echo "$(date -u) - cleaning ~/.rpmdb"
rm ~/.rpmdb -rf
echo "$(date -u) - cleaning yum"
yum -v --releasever=23 clean all
echo "$(date -u) - initialising yum for $RELEASE"
yum -v --releasever=23 check
yum -v --releasever=23 repolist all

for i in 1 2 ; do
	UNIQUEEXT="mock_$i"
	echo "$(date -u) - starting to cleanly configure mock for $RELEASE on $ARCH using unique extension $UNIQUEEXT."
	echo "$(date -u) - mock --clean"
	mock -r $RELEASE-$ARCH --uniqueext=$UNIQUEEXT --resultdir=. -v --clean
	echo "$(date -u) - mock --scrub=all"
	mock -r $RELEASE-$ARCH --uniqueext=$UNIQUEEXT --resultdir=. -v --scrub=all
	echo "$(date -u) - mock --init"
	mock -r $RELEASE-$ARCH --uniqueext=$UNIQUEEXT --resultdir=. -v --init
	echo "$(date -u) - mock --install rpm-build yum"
	mock -r $RELEASE-$ARCH --uniqueext=$UNIQUEEXT --resultdir=. -v --install rpm-build yum
	echo "$(date -u) - mock --update"
	mock -r $RELEASE-$ARCH --uniqueext=$UNIQUEEXT --resultdir=. -v --update
done

# finally
echo "$(date -u) - mock configured for $RELEASE on $ARCH."