summaryrefslogtreecommitdiffstats
path: root/auto/clean
blob: 3599eb14e9d4b28a81da5161ae8a6744fe92ebb3 (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

for dir in chroot/{dev/pts,proc,sys,var/lib/dpkg} ; do
   if mountpoint -q "$dir" ; then
      umount "$dir"
   fi
done

lb clean noauto ${@}

# 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

# files copied or created in the config stage
rm -f config/chroot_local-includes/etc/amnesia/environment
rm -f config/chroot_local-includes/etc/amnesia/version
rm -f config/chroot_local-includes/usr/share/doc/amnesia/Changelog
rm -f config/chroot_local-includes/usr/share/doc/amnesia/amnesia.asc
for list in config/chroot_local-packageslists/*.list ; do
   if [ "$list" != 'config/chroot_local-packageslists/tails-common.list' ]; then
      rm -f "$list"
   fi
done
rm -f config/chroot_local-includes/home/amnesia/.gnome2/nautilus-scripts/*

# files copied or created in the build stage
rm -f config/chroot_local-includes/usr/share/amnesia/build/variables

# static wiki
rm -rf config/binary_local-includes/doc wiki/src/.ikiwiki
find wiki/src -name *.pot -exec rm {} \;