From f52b04d53163c49a008a1560cab96b6fff729a0d Mon Sep 17 00:00:00 2001 From: steve Date: Tue, 23 May 2006 20:24:47 +0000 Subject: [PATCH] 2006-05-23 20:24:47 by steve Clean RPM scattered files for rpmstrap installations. --- etc/hook.d/99-clean-image | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/etc/hook.d/99-clean-image b/etc/hook.d/99-clean-image index 44dcf14..ff94bb8 100755 --- a/etc/hook.d/99-clean-image +++ b/etc/hook.d/99-clean-image @@ -1,7 +1,7 @@ #!/bin/sh # -# This script runs 'apt-get clean' on the freshly created image, -# to make sure it has the maximum available amount of free space. +# This script cleans the newly created image appropriately both for +# RPM based systems and for APT systems. # # Steve # -- @@ -10,11 +10,19 @@ prefix=$1 -# -# Don't run apt-get if we're running under rpmstrap. -# -if [ -z "${rpmstrap}" ]; then +if [ "${rpmstrap}" ]; then + # + # Clean the crazy RPM scattered files. + # + find ${prefix}/etc -name '*.rpmorig' -exec rm -f \{\} \; + find ${prefix}/etc -name '*.rpmnew' -exec rm -f \{\} \; + +else + + # + # Clean APT cache + # chroot ${prefix} /usr/bin/apt-get clean fi