1
0
mirror of synced 2026-05-02 06:35:25 +00:00
Files
xen-tools.xen-tools/etc/hook.d/99-clean-image
steve 2862fb995d 2006-05-24 19:35:16 by steve
More updates.
2006-05-24 19:35:16 +00:00

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