~cjwatson/launchpad-buildd/snap-default-branch

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
#!/bin/sh
#
# Copyright 2009 Canonical Ltd.  This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

# Buildd Slave tool to remove an unmounted chroot

# Expects build id as arg 1, makes build-id to contain the build

# Needs RM to be set to a gnu rm instance
# Needs SUDO to be set to a sudo instance for passwordless access

RM=/bin/rm
SUDO=/usr/bin/sudo
BUILDID="$1"

set -e

exec 2>&1

echo "Removing build $BUILDID"

cd $HOME

$SUDO $RM -rf "build-$BUILDID"