clean 1.13 KB
Newer Older
amnesia's avatar
amnesia committed
1
2
#!/bin/sh

3
4
set -e
set -u
5
6
set -x

7
for dir in chroot/{dev/pts,proc,sys,var/lib/dpkg} ; do
amnesia's avatar
amnesia committed
8
9
10
11
12
   if mountpoint -q "$dir" ; then
      umount "$dir"
   fi
done

13
lb clean noauto "${@}"
amnesia's avatar
amnesia committed
14
15
16
17
18
19
20
21
22
23

# rm -f build-*.log

# Remove generated files
rm -f config/binary config/bootstrap config/chroot config/common config/source

# Remove empty directories in config tree
if ls config/*/ > /dev/null 2>&1 ; then
	rmdir --ignore-fail-on-non-empty config/*/
fi
24

25
# files copied or created in the config stage
26
rm -f config/chroot_local-includes/etc/amnesia/environment
27
rm -f config/chroot_local-includes/etc/amnesia/version
28
rm -f config/chroot_local-includes/usr/share/doc/amnesia/Changelog
29
for list in config/chroot_local-packageslists/*.list ; do
30
   if [ "$list" != 'config/chroot_local-packageslists/tails-common.list' ]; then
31
32
33
      rm -f "$list"
   fi
done
34

35
# files copied or created in the build stage
36
rm -f config/chroot_local-includes/usr/share/tails/build/variables
37

38
# static wiki
39
rm -rf config/chroot_local-includes/usr/share/doc/tails/website wiki/src/.ikiwiki
40
find wiki/src -name *.pot -exec rm {} \;
41
42
43

# workarounds
rm -rf config/chroot_local-includes/tmp/tails-workarounds