diff --git a/hooks/centos-4/99-clean-image b/hooks/centos-4/99-clean-image deleted file mode 100755 index 5540108..0000000 --- a/hooks/centos-4/99-clean-image +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# This script cleans the yum database on the new system. -# -# Steve -# -- -# http://www.steve.org.uk/ - - -prefix=$1 - -# -# Source our common functions -# -if [ -e /usr/lib/xen-tools/common.sh ]; then - . /usr/lib/xen-tools/common.sh -else - . ./hooks/common.sh -fi - - -# -# Log our start -# -logMessage Script $0 starting - - -# -# Clean up RPM files. -# -logMessage Cleaning .rpm* files. -find ${prefix}/ -name '*.rpmorig' -exec rm -f \{\} \; -find ${prefix}/ -name '*.rpmnew' -exec rm -f \{\} \; - -# -# Clean yum -# -logMessage Cleaning Yum Repository - -if [ ! -d ${prefix}/proc ]; then - mkdir -p ${prefix}/proc -fi -mount -o bind /proc ${prefix}/proc -chroot ${prefix} /usr/bin/yum clean all -umount ${prefix}/proc - -# -# Log our finish -# -logMessage Script $0 finished diff --git a/hooks/centos-4/99-clean-image b/hooks/centos-4/99-clean-image new file mode 120000 index 0000000..74c22e9 --- /dev/null +++ b/hooks/centos-4/99-clean-image @@ -0,0 +1 @@ +../common/99-clean-image-rpm \ No newline at end of file diff --git a/hooks/centos-5/99-clean-image b/hooks/centos-5/99-clean-image deleted file mode 100755 index 5540108..0000000 --- a/hooks/centos-5/99-clean-image +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# This script cleans the yum database on the new system. -# -# Steve -# -- -# http://www.steve.org.uk/ - - -prefix=$1 - -# -# Source our common functions -# -if [ -e /usr/lib/xen-tools/common.sh ]; then - . /usr/lib/xen-tools/common.sh -else - . ./hooks/common.sh -fi - - -# -# Log our start -# -logMessage Script $0 starting - - -# -# Clean up RPM files. -# -logMessage Cleaning .rpm* files. -find ${prefix}/ -name '*.rpmorig' -exec rm -f \{\} \; -find ${prefix}/ -name '*.rpmnew' -exec rm -f \{\} \; - -# -# Clean yum -# -logMessage Cleaning Yum Repository - -if [ ! -d ${prefix}/proc ]; then - mkdir -p ${prefix}/proc -fi -mount -o bind /proc ${prefix}/proc -chroot ${prefix} /usr/bin/yum clean all -umount ${prefix}/proc - -# -# Log our finish -# -logMessage Script $0 finished diff --git a/hooks/centos-5/99-clean-image b/hooks/centos-5/99-clean-image new file mode 120000 index 0000000..74c22e9 --- /dev/null +++ b/hooks/centos-5/99-clean-image @@ -0,0 +1 @@ +../common/99-clean-image-rpm \ No newline at end of file diff --git a/hooks/common/99-clean-image b/hooks/common/99-clean-image-deb similarity index 100% rename from hooks/common/99-clean-image rename to hooks/common/99-clean-image-deb diff --git a/hooks/common/99-clean-image-rpm b/hooks/common/99-clean-image-rpm new file mode 100755 index 0000000..5540108 --- /dev/null +++ b/hooks/common/99-clean-image-rpm @@ -0,0 +1,50 @@ +#!/bin/sh +# +# This script cleans the yum database on the new system. +# +# Steve +# -- +# http://www.steve.org.uk/ + + +prefix=$1 + +# +# Source our common functions +# +if [ -e /usr/lib/xen-tools/common.sh ]; then + . /usr/lib/xen-tools/common.sh +else + . ./hooks/common.sh +fi + + +# +# Log our start +# +logMessage Script $0 starting + + +# +# Clean up RPM files. +# +logMessage Cleaning .rpm* files. +find ${prefix}/ -name '*.rpmorig' -exec rm -f \{\} \; +find ${prefix}/ -name '*.rpmnew' -exec rm -f \{\} \; + +# +# Clean yum +# +logMessage Cleaning Yum Repository + +if [ ! -d ${prefix}/proc ]; then + mkdir -p ${prefix}/proc +fi +mount -o bind /proc ${prefix}/proc +chroot ${prefix} /usr/bin/yum clean all +umount ${prefix}/proc + +# +# Log our finish +# +logMessage Script $0 finished diff --git a/hooks/dapper/99-clean-image b/hooks/dapper/99-clean-image index f850fb0..1523ab6 120000 --- a/hooks/dapper/99-clean-image +++ b/hooks/dapper/99-clean-image @@ -1 +1 @@ -../common/99-clean-image \ No newline at end of file +../common/99-clean-image-deb \ No newline at end of file diff --git a/hooks/debian/99-clean-image b/hooks/debian/99-clean-image index f850fb0..1523ab6 120000 --- a/hooks/debian/99-clean-image +++ b/hooks/debian/99-clean-image @@ -1 +1 @@ -../common/99-clean-image \ No newline at end of file +../common/99-clean-image-deb \ No newline at end of file diff --git a/hooks/edgy/99-clean-image b/hooks/edgy/99-clean-image index f850fb0..1523ab6 120000 --- a/hooks/edgy/99-clean-image +++ b/hooks/edgy/99-clean-image @@ -1 +1 @@ -../common/99-clean-image \ No newline at end of file +../common/99-clean-image-deb \ No newline at end of file diff --git a/hooks/fedora-core-6/99-clean-image b/hooks/fedora-core-6/99-clean-image deleted file mode 100755 index 5540108..0000000 --- a/hooks/fedora-core-6/99-clean-image +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# This script cleans the yum database on the new system. -# -# Steve -# -- -# http://www.steve.org.uk/ - - -prefix=$1 - -# -# Source our common functions -# -if [ -e /usr/lib/xen-tools/common.sh ]; then - . /usr/lib/xen-tools/common.sh -else - . ./hooks/common.sh -fi - - -# -# Log our start -# -logMessage Script $0 starting - - -# -# Clean up RPM files. -# -logMessage Cleaning .rpm* files. -find ${prefix}/ -name '*.rpmorig' -exec rm -f \{\} \; -find ${prefix}/ -name '*.rpmnew' -exec rm -f \{\} \; - -# -# Clean yum -# -logMessage Cleaning Yum Repository - -if [ ! -d ${prefix}/proc ]; then - mkdir -p ${prefix}/proc -fi -mount -o bind /proc ${prefix}/proc -chroot ${prefix} /usr/bin/yum clean all -umount ${prefix}/proc - -# -# Log our finish -# -logMessage Script $0 finished diff --git a/hooks/fedora-core-6/99-clean-image b/hooks/fedora-core-6/99-clean-image new file mode 120000 index 0000000..74c22e9 --- /dev/null +++ b/hooks/fedora-core-6/99-clean-image @@ -0,0 +1 @@ +../common/99-clean-image-rpm \ No newline at end of file diff --git a/hooks/intrepid/99-clean-image b/hooks/intrepid/99-clean-image index f850fb0..1523ab6 120000 --- a/hooks/intrepid/99-clean-image +++ b/hooks/intrepid/99-clean-image @@ -1 +1 @@ -../common/99-clean-image \ No newline at end of file +../common/99-clean-image-deb \ No newline at end of file diff --git a/hooks/karmic/99-clean-image b/hooks/karmic/99-clean-image index f850fb0..1523ab6 120000 --- a/hooks/karmic/99-clean-image +++ b/hooks/karmic/99-clean-image @@ -1 +1 @@ -../common/99-clean-image \ No newline at end of file +../common/99-clean-image-deb \ No newline at end of file