#!/bin/bash # Copyright 2014-2015 Holger Levsen # released under the GPLv=2 DEBUG=true . /srv/jenkins/bin/common-functions.sh common_init "$@" # common code defining db access . /srv/jenkins/bin/reproducible_common.sh cleanup_tmpdirs() { set +e cd $RSSH "sudo chflags -R noschg $TMPDIR" $RSSH "rm -r $TMPDIR" || true rm $TMPDIR -r $RSSH 'sudo rm -rf /usr/src' } create_results_dirs() { mkdir -p $BASE/freebsd/dbd } save_freebsd_results() { local RUN=$1 echo "=============================================================================" echo "$(date -u) - Saving FreeBSD (branch $FREEBSD_TARGET at ${FREEBSD_VERSION[$FREEBSD_TARGET]}) build results for $RUN run." echo "=============================================================================" mkdir -p $TMPDIR/$RUN/ # copy results over DUMMY_DATE="$(date -u +'%Y-%m-%d')T00:00:00Z" $RSSH "sudo find $TMPDIR -newer $TMPDIR -exec touch -d '$DUMMY_DATE' {} \;" $RSSH "sudo find $TMPDIR -print0 | LC_ALL=C sort -z | sudo tar --no-recursion --null -T - -cJf $TMPDIR.tar.xz" $RSCP:$TMPDIR.tar.xz $TMPDIR/$RUN/$TARGET_NAME.tar.xz # Copy packages back with a tar pipeline $RSSH "sudo tar -C /usr/obj/usr/src -cf - repo" | tar -x -C $TMPDIR/$RUN/ -f - $RSSH "sudo chflags -R noschg $TMPDIR ; sudo rm -r $TMPDIR $TMPDIR.tar.xz ; mkdir $TMPDIR" } run_diffoscope_on_results() { TIMEOUT="60m" DIFFOSCOPE="$(schroot --directory /tmp -c source:jenkins-reproducible-${DBDSUITE}-diffoscope diffoscope -- --version 2>&1)" echo "=============================================================================" echo "$(date -u) - Running $DIFFOSCOPE on FreeBSD (branch $FREEBSD_TARGET at ${FREEBSD_VERSION}) build results." echo "=============================================================================" mkdir -p $TMPDIR FILES_HTML[$FREEBSD_TARGET]=$(mktemp --tmpdir=$TMPDIR) #echo "