summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_build.sh
blob: 07f4056fc1a9ab40f6c1ed80f8cc8c0d62aa8df2 (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
#!/bin/bash

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

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

if [ -d misc.git ] ; then
	cd misc.git
	git pull
	cd ..
else
	git clone git://git.debian.org/git/reproducible/misc.git misc.git
fi

for PACKAGE in "$@" ; do
	rm b1 b2 -rf
	apt-get source --download-only ${PACKAGE}
	sudo pbuilder --build --basetgz /var/cache/pbuilder/base-reproducible.tgz ${PACKAGE}_*.dsc
	mkdir b1 b2
	dcmd cp /var/cache/pbuilder/result/${PACKAGE}_*.changes b1
	sudo dcmd rm /var/cache/pbuilder/result/${PACKAGE}_*.changes
	sudo pbuilder --build --basetgz /var/cache/pbuilder/base-reproducible.tgz ${PACKAGE}_*.dsc
	dcmd cp /var/cache/pbuilder/result/${PACKAGE}_*.changes b2
	sudo dcmd rm /var/cache/pbuilder/result/${PACKAGE}_*.changes

	TMPFILE=$(mktemp)
	./misc.git/diffp b1/*.changes b2/*.changes | tee $TMPFILE
	grep -qv '^\*\*\*\*\*' $TMPFILE && figlet ${PACKAGE}_&& echo && echo "${PACKAGE} build successfull."

	rm b1 b2 $TMPFILE -rf
done