52 lines
751 B
Bash
Executable File
52 lines
751 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# This script cleans the newly created image appropriately both for
|
|
# RPM based systems and for APT systems.
|
|
#
|
|
# Steve
|
|
# --
|
|
# http://www.steve.org.uk/
|
|
|
|
|
|
prefix=$1
|
|
dist=$2
|
|
|
|
|
|
#
|
|
# Clean the APT package cache for Debian GNU/Linux.
|
|
#
|
|
function setupDebian
|
|
{
|
|
chroot ${prefix} /usr/bin/apt-get clean
|
|
}
|
|
|
|
|
|
#
|
|
# Clean a new image of CentOS4.
|
|
#
|
|
function setupCentOS4
|
|
{
|
|
find ${prefix}/ -name '*.rpmorig' -exec rm -f \{\} \;
|
|
find ${prefix}/ -name '*.rpmnew' -exec rm -f \{\} \;
|
|
chroot ${prefix}/usr/bin/yum clean all
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
# Entry point to the script.
|
|
#
|
|
case "${dist}" in
|
|
sarge|etch|sid)
|
|
setupDebianSources
|
|
;;
|
|
centos4)
|
|
setupCentOS4
|
|
;;
|
|
*)
|
|
echo "Unknown distribution '${dist}'. Fixme";
|
|
exit;
|
|
;;
|
|
esac
|