2007-09-23 08:04:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# /usr/share/live-helper/hooks/minimal - hook list for live-helper(7)
|
2008-03-06 14:43:00 -01:00
|
|
|
# Copyright (C) 2006-2008 Daniel Baumann <daniel@debian.org>
|
2007-09-23 08:04:48 +00:00
|
|
|
#
|
|
|
|
# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
|
|
|
# This is free software, and you are welcome to redistribute it
|
|
|
|
# under certain conditions; see COPYING for details.
|
|
|
|
|
|
|
|
set -e
|
2007-09-23 08:04:46 +00:00
|
|
|
|
2008-04-16 05:53:34 +00:00
|
|
|
Purge() {
|
|
|
|
PACKAGE="${1}"
|
|
|
|
|
2007-09-23 08:05:14 +00:00
|
|
|
if ! apt-get remove --purge --yes "${PACKAGE}"
|
|
|
|
then
|
|
|
|
echo "WARNING: ${PACKAGE} isn't installed"
|
|
|
|
fi
|
2008-04-16 05:53:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Removing unused packages
|
|
|
|
for PACKAGE in aptitude man-db manpages info wget
|
|
|
|
do
|
|
|
|
Purge ${PACKAGE}
|
2007-09-23 08:05:14 +00:00
|
|
|
done
|
|
|
|
|
2008-04-16 05:53:34 +00:00
|
|
|
# Remove apt-utils if we do not require it for lh_chroot_sources
|
|
|
|
if [ ! -e chroot/root/local-packages/Packages.gz ]
|
|
|
|
then
|
|
|
|
Purge apt-utils
|
|
|
|
fi
|
|
|
|
|
2008-01-15 00:34:01 -01:00
|
|
|
apt-get autoremove --yes || true
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Removing unused files
|
2008-04-16 05:19:44 +00:00
|
|
|
find . -name *~ -print0 | xargs -0 rm -f
|
2007-09-23 08:04:50 +00:00
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
rm -rf /var/cache/man/*
|
|
|
|
|
2007-11-12 20:51:27 -01:00
|
|
|
# Cleaning apt lists
|
2007-09-23 08:04:46 +00:00
|
|
|
rm -rf /var/lib/apt/lists
|
|
|
|
mkdir -p /var/lib/apt/lists/partial
|
|
|
|
|
2007-11-12 20:51:27 -01:00
|
|
|
# Cleaning apt cache
|
|
|
|
rm -rf /var/cache/apt
|
|
|
|
mkdir -p /var/cache/apt/archives/partial
|
|
|
|
|
2007-09-23 08:04:46 +00:00
|
|
|
# Truncating logs
|
2007-09-24 06:47:42 +00:00
|
|
|
for FILE in $(find /var/log/ -type f)
|
2007-09-23 08:04:46 +00:00
|
|
|
do
|
2007-11-10 13:40:53 -01:00
|
|
|
: > ${FILE}
|
2007-09-23 08:04:46 +00:00
|
|
|
done
|