From b0eed42c569582facfb3078dfa04669155fef84a Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Wed, 21 Oct 2015 19:52:32 -0500 Subject: reproducible openwrt: add very simple safeguards against cleanup going wrong --- bin/reproducible_openwrt.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/reproducible_openwrt.sh b/bin/reproducible_openwrt.sh index ee800f0a..469c1775 100755 --- a/bin/reproducible_openwrt.sh +++ b/bin/reproducible_openwrt.sh @@ -15,6 +15,12 @@ set -e cleanup_tmpdirs() { cd + # (very simple) check we are deleting the right stuff + if [ "${TMPDIR:0:26}" != "/srv/reproducible-results/" ] || [ ${#TMPDIR} -le 26 ] || \ + [ "${TMPBUILDDIR:0:23}" != "/srv/workspace/chroots/" ] || [ ${#TMPBUILDDIR} -le 23 ] ; then + echo "Something very strange with \$TMPDIR=$TMPDIR or \$TMPBUILDDIR=$TMPBUILDDIR, exiting instead of doing cleanup." + exit 1 + fi rm -rf $TMPDIR rm -rf $TMPBUILDDIR } -- cgit v1.2.3-54-g00ecf