From: Andrea R. <ar...@sy...> - 2006-09-22 17:09:42
|
Author: arighi Date: 2006-09-22 12:09:34 -0500 (Fri, 22 Sep 2006) New Revision: 3753 Modified: trunk/sbin/si_rmimage Log: fix: remove also the override when removing an image Modified: trunk/sbin/si_rmimage =================================================================== --- trunk/sbin/si_rmimage 2006-09-22 14:50:58 UTC (rev 3752) +++ trunk/sbin/si_rmimage 2006-09-22 17:09:34 UTC (rev 3753) @@ -31,6 +31,7 @@ my $autoinstall_script_dir = $config->autoinstall_script_dir(); my $rsyncd_conf = $config->rsyncd_conf(); my $rsync_stub_dir = $config->rsync_stub_dir(); +my $default_override_dir = $config->default_override_dir(); if (!$autoinstall_script_dir) { die "AUTOINSTALL_SCRIPT_DIR not defined in the config file."; @@ -141,6 +142,15 @@ rmtree($file, 0, 0) or die "FATAL: Can't remove $file!\n"; } +# remove override +if($verbose) {print " Removing override $image.\n";} +$file="$default_override_dir/$image"; +if($force) { + if($file) { rmtree($file, 0, 0); } +} else { + rmtree($file, 0, 0) or die "FATAL: Can't remove $file!\n"; +} + # remove BitTorrent files if($verbose) {print " Removing BitTorrent files for $image.\n";} $file = $config->autoinstall_tarball_dir() . "/image-" . $image . ".tar.gz"; |