summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_build_rpm.sh
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-12-11 17:34:11 +0100
committerHolger Levsen <holger@layer-acht.org>2015-12-11 17:34:11 +0100
commit7278033f9ae9f2ced89c1801cb4e6b134913684d (patch)
treedbf578055dfdd39ee81b91e96c1eb55387b7fef3 /bin/reproducible_build_rpm.sh
parent84a77401e9d1f78e290caa1f3aa82bd3fdf64f0d (diff)
downloadjenkins.debian.net-7278033f9ae9f2ced89c1801cb4e6b134913684d.tar.xz
reproducible fedora: fixup some things from rebasing this of the archlinux build script…
Diffstat (limited to 'bin/reproducible_build_rpm.sh')
-rwxr-xr-xbin/reproducible_build_rpm.sh25
1 files changed, 12 insertions, 13 deletions
diff --git a/bin/reproducible_build_rpm.sh b/bin/reproducible_build_rpm.sh
index 37c74e6f..6c6ec2cf 100755
--- a/bin/reproducible_build_rpm.sh
+++ b/bin/reproducible_build_rpm.sh
@@ -14,7 +14,7 @@ set -e
cleanup_all() {
cd
- # delete makepkg build dir
+ # delete mock result dir
if [ ! -z $SRCPACKAGE ] && [ -d /tmp/$SRCPACKAGE-$(basename $TMPDIR) ] ; then
rm -r /tmp/$SRCPACKAGE-$(basename $TMPDIR)
fi
@@ -50,14 +50,13 @@ choose_package() {
if [ ! -d $BASE/rpm/$RELEASE/$ARCH/$PKG ] || [ ! -z $(find $BASE/rpm/$RELEASE/$ARCH/ -name $PKG -mtime +$MIN_AGE) ] ; then
SRCPACKAGE=$PKG
echo "$(date -u ) - building package $PKG from '$RELEASE' on '$ARCH' now..."
- # very simple locking…
- mkdir -p $BASE/rpm/$RELEASE/$ARCH/$PKG
- touch $BASE/rpm/$RELEASE/$ARCH/$PKG
- # break out of the loop and then out of this function too,
- # to build this package…
- break
- fi
- done
+ # very simple locking…
+ mkdir -p $BASE/rpm/$RELEASE/$ARCH/$PKG
+ touch $BASE/rpm/$RELEASE/$ARCH/$PKG
+ # break out of the loop and then out of this function too,
+ # to build this package…
+ break
+ fi
done
if [ -z $SRCPACKAGE ] ; then
echo "$(date -u ) - no package found to be build, sleeping 6h."
@@ -78,11 +77,11 @@ first_build() {
echo "============================================================================="
set -x
download_package
- local BUILDDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)"
+ local RESULTDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)"
local LOG=$TMPDIR/b1/$SRCPACKAGE/build1.log
# nicely run mock with a timeout of 4h
timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \
- mock -r $RELEASE-$ARCH --resultdir=. $SRC_RPM 2>&1 | tee -a $LOG
+ mock -r $RELEASE-$ARCH --resultdir=$RESULTDIR $SRC_RPM 2>&1 | tee -a $LOG
PRESULT=${PIPESTATUS[0]}
if [ $PRESULT -eq 124 ] ; then
echo "$(date -u) - mock was killed by timeout after 4h." | tee -a $LOG
@@ -98,12 +97,12 @@ second_build() {
echo "============================================================================="
set -x
download_package
- local BUILDDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)"
+ local RESULTDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)"
local LOG=$TMPDIR/b2/$SRCPACKAGE/build2.log
# NEW_NUM_CPU=$(echo $NUM_CPU-1|bc)
# nicely run mock with a timeout of 4h
timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \
- mock -r $RELEASE-$ARCH --resultdir=. $SRC_RPM 2>&1 | tee -a $LOG
+ mock -r $RELEASE-$ARCH --resultdir=$RESULTDIR $SRC_RPM 2>&1 | tee -a $LOG
PRESULT=${PIPESTATUS[0]}
if [ $PRESULT -eq 124 ] ; then
echo "$(date -u) - mock was killed by timeout after 4h." | tee -a $LOG