Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 60 lines (52 sloc) 1.461 kb
#!/bin/bash
# Copyright (c) Paul Tagliamonte <paultag@ubuntu.com>, 2012, under the terms
# and conditions of the Expat license.
DIST="sid"
VARIANT="default"
SBUILD=/var/sbuild
if [ "x$1" != "x" ]; then
VARIANT=$1
fi
if [ "x$2" != "x" ]; then
DIST=$2
fi
if [ -e $SBUILD/$DIST.lock ]; then
PID=`cat $SBUILD/$DIST.lock`
echo "W: We *must* wait for the finish of PID $PID"
echo "W: Blocking execution until this file is removed."
if [ -e $SBUILD/$DIST.wait ]; then
ps --no-header `cat $SBUILD/$DIST.wait` > /dev/null
RET=$?
if [ $RET -eq 0 ]; then
echo "E: Someone else is waiting. Bombing out."
exit 2
else
echo "I: Somone else was waiting, but their PID is gone."
fi
fi
echo $$ > $SBUILD/$DIST.wait
while [ -e $SBUILD/$DIST.lock ]; do
sleep 1
done
echo "I: Dropping out of lock. Purging wait."
rm $SBUILD/$DIST.wait
fi
echo "I: Aquiring lock"
echo $$ > $SBUILD/$DIST.lock
OVERLAY=$SBUILD/$DIST.overlay.d/$DIST-$VARIANT
if [ -d $OVERLAY ]; then
echo "I: Cleaning. Profile:"
echo "I:"
echo "I: dist: $DIST"
echo "I: variant: $VARIANT"
echo "I:"
echo "I: If this is OK, hit enter."
read foo
echo "I: If you see the prompt, please auth."
sudo rm -rf $OVERLAY/*
echo "I: overlay cleaned."
else
echo "E: No overlay found. Quitting."
fi
echo "I: Releasing lock"
rm $SBUILD/$DIST.lock
Jump to Line
Something went wrong with that request. Please try again.