summaryrefslogtreecommitdiffstats
path: root/tools/drakx-in-chroot
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-11-22 14:38:57 +0000
committerOlivier Blin <oblin@mandriva.org>2005-11-22 14:38:57 +0000
commit7d6d36ce2d6c5fc460a0b5114db60d5b39c1fb10 (patch)
treefc94cbee7b7a1448b4927f5f537e3f11657d857d /tools/drakx-in-chroot
parent6610142c12d88c13b8c8c1ed7216b9a08aabbe9d (diff)
downloaddrakx-7d6d36ce2d6c5fc460a0b5114db60d5b39c1fb10.tar
drakx-7d6d36ce2d6c5fc460a0b5114db60d5b39c1fb10.tar.gz
drakx-7d6d36ce2d6c5fc460a0b5114db60d5b39c1fb10.tar.bz2
drakx-7d6d36ce2d6c5fc460a0b5114db60d5b39c1fb10.tar.xz
drakx-7d6d36ce2d6c5fc460a0b5114db60d5b39c1fb10.zip
contatenate auto_install and defcfg files into a new auto_install file in install root
Diffstat (limited to 'tools/drakx-in-chroot')
-rw-r--r--tools/drakx-in-chroot22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/drakx-in-chroot b/tools/drakx-in-chroot
index db521ca77..10ae26e27 100644
--- a/tools/drakx-in-chroot
+++ b/tools/drakx-in-chroot
@@ -11,6 +11,7 @@ my $STAGE2_LOCATION_ROOTED = '/tmp/stage2';
my $LIVE_LOCATION_REL = 'install/stage2/live/';
my $CLP_LOCATION_REL = 'install/stage2/';
my $CLP_FILE_REL = $CLP_LOCATION_REL . 'mdkinst.clp';
+my $AUTO_INSTALL_ROOTED = '/tmp/drakx-in-chroot.cfg.pl';
@ARGV >= 2 or die "usage: drakx-in-chroot <repository> <dir to install to> [options]\n";
@@ -36,6 +37,8 @@ mkdir_p("$SLASH_LOCATION$_") foreach '/dev', '/dev/usb', '/etc', '/var', '/proc'
sys("$sudo rm -rf $dir") if $ENV{CLEAN};
-e $dir or sys("$sudo mkdir -p $dir");
+copy_auto_install_files();
+
if (-d "$repository/$LIVE_LOCATION_REL") {
sys("$sudo mount -o bind $repository/$LIVE_LOCATION_REL $STAGE2_LOCATION");
} elsif (-e "$repository/$CLP_FILE_REL") {
@@ -129,3 +132,22 @@ sub umount_all() {
}
$err;
}
+
+sub copy_auto_install_files() {
+ my ($opt);
+ my ($auto_install, $defcfg);
+ each_index {
+ if ($opt eq 'auto_install' && -f $_) {
+ $auto_install = $_;
+ $_ = $AUTO_INSTALL_ROOTED;
+ } elsif ($opt eq 'defcfg' && -f $_) {
+ $defcfg = $_;
+ $ARGV[$::i-1] = $ARGV[$::i] = undef;
+ }
+ undef $opt;
+ /^--?(.*)/ and $opt = $1;
+ } @ARGV;
+ #- contatenate auto_install and defcfg files into a new auto_install file in install root
+ my @auto_inst = grep { -f $_ } $auto_install, $defcfg;
+ output($SLASH_LOCATION . $AUTO_INSTALL_ROOTED, cat_(@auto_inst)) if @auto_inst;
+}