diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-11-22 14:38:57 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-11-22 14:38:57 +0000 |
commit | 7d6d36ce2d6c5fc460a0b5114db60d5b39c1fb10 (patch) | |
tree | fc94cbee7b7a1448b4927f5f537e3f11657d857d | |
parent | 6610142c12d88c13b8c8c1ed7216b9a08aabbe9d (diff) | |
download | drakx-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
-rw-r--r-- | tools/drakx-in-chroot | 22 |
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; +} |