summaryrefslogtreecommitdiffstats
path: root/tools/drakx-in-chroot
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-11-22 14:30:09 +0000
committerOlivier Blin <oblin@mandriva.org>2005-11-22 14:30:09 +0000
commit318ad752f331a6240577e57e89d2164ee2591975 (patch)
tree057f88961d48d5fbf1dc45c282fc8176efcc1c4c /tools/drakx-in-chroot
parentbbb3cb72b663d2708b9de07b1d96c517bc8f85b7 (diff)
downloaddrakx-backup-do-not-use-318ad752f331a6240577e57e89d2164ee2591975.tar
drakx-backup-do-not-use-318ad752f331a6240577e57e89d2164ee2591975.tar.gz
drakx-backup-do-not-use-318ad752f331a6240577e57e89d2164ee2591975.tar.bz2
drakx-backup-do-not-use-318ad752f331a6240577e57e89d2164ee2591975.tar.xz
drakx-backup-do-not-use-318ad752f331a6240577e57e89d2164ee2591975.zip
remove destination dir as root, and create it if not existent
Diffstat (limited to 'tools/drakx-in-chroot')
-rw-r--r--tools/drakx-in-chroot4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/drakx-in-chroot b/tools/drakx-in-chroot
index fe54207b7..8cce19859 100644
--- a/tools/drakx-in-chroot
+++ b/tools/drakx-in-chroot
@@ -29,11 +29,13 @@ if (-d $SLASH_LOCATION) {
umount_all() == 0 or die "$SLASH_LOCATION is busy\n";
sys("$sudo rm -rf $SLASH_LOCATION/var/lib/rpm $SLASH_LOCATION/dev/mapper");
rm_rf($SLASH_LOCATION);
- rm_rf(glob("$dir/*")) if $ENV{CLEAN};
}
mkdir_p("$SLASH_LOCATION$_") foreach '/dev', '/dev/usb', '/etc', '/var', '/proc', $STAGE2_LOCATION_ROOTED, $IMAGE_LOCATION_ROOTED, $prefix_ROOTED;
+sys("$sudo rm -rf $dir") if $ENV{CLEAN};
+-e $dir or sys("$sudo mkdir -p $dir");
+
if (-d "$repository/$LIVE_LOCATION_REL") {
sys("$sudo mount -o bind $repository/$LIVE_LOCATION_REL $STAGE2_LOCATION");
} elsif (-e "$repository/$CLP_FILE_REL") {