diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-02-21 18:10:24 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-02-21 18:10:24 +0000 |
commit | a21d9a0dd774f6d0ce98e8e9953dce02994ab218 (patch) | |
tree | 0e830d386e86b21224db3546f7518609327b3005 /perl-install | |
parent | 21b1ff0a989115a4c42defbac7d7da5f19add768 (diff) | |
download | drakx-backup-do-not-use-a21d9a0dd774f6d0ce98e8e9953dce02994ab218.tar drakx-backup-do-not-use-a21d9a0dd774f6d0ce98e8e9953dce02994ab218.tar.gz drakx-backup-do-not-use-a21d9a0dd774f6d0ce98e8e9953dce02994ab218.tar.bz2 drakx-backup-do-not-use-a21d9a0dd774f6d0ce98e8e9953dce02994ab218.tar.xz drakx-backup-do-not-use-a21d9a0dd774f6d0ce98e8e9953dce02994ab218.zip |
(g_auto_install): use selected_leaves for default_packages to reduce the
list of packages (aka cleanup auto_inst.cfg)
(g_default_packages): created
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install_any.pm | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index b6f429763..566a7b70c 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -515,12 +515,12 @@ sub kdemove_desktop_file { #-############################################################################### sub auto_inst_file() { ($::g_auto_install ? "/tmp" : "$::o->{prefix}/root") . "/auto_inst.cfg.pl" } -sub g_auto_install(;$) { +sub g_auto_install { my ($f) = @_; $f ||= auto_inst_file; my $o = {}; require pkgs; - $o->{default_packages} = [ map { pkgs::packageName($_) } grep { pkgs::packageFlagSelected($_) && !pkgs::packageFlagBase($_) } values %{$::o->{packages}{names}} ]; + $o->{default_packages} = pkgs::selected_leaves($::o->{packages}); my @fields = qw(mntpoint type size); $o->{partitions} = [ map { my %l; @l{@fields} = @$_{@fields}; \%l } grep { $_->{mntpoint} } @{$::o->{fstab}} ]; @@ -544,11 +544,32 @@ sub g_auto_install(;$) { $_ = { %{$_ || {}} }, delete @$_{qw(oldu oldg password password2)} foreach $o->{superuser}, @{$o->{users} || []}; + require Data::Dumper; output($f, "# You should always check the syntax with 'perl -cw auto_inst.cfg.pl' before testing\n", Data::Dumper->Dump([$o], ['$o']), "\0"); } + +sub g_default_packages { + my ($o) = @_; + + my $floppy = detect_devices::floppy(); + + $o->ask_warn('', _("Insert a FAT formatted floppy in drive %s", $floppy)); + + fs::mount(devices::make($floppy), "/floppy", "vfat", 0); + + require Data::Dumper; + output('/floppy/auto_inst.cfg', + "# You should always check the syntax with 'perl -cw auto_inst.cfg.pl' before testing\n", + "# To use it, boot with ``linux defcfg=floppy''\n", + Data::Dumper->Dump([ { default_packages => pkgs::selected_leaves($o->{packages}) } ], ['$o']), "\0"); + fs::umount("/floppy"); + + $o->ask_warn('', _("To use this saved packages selection, boot installation with ``linux defcfg=floppy''")); +} + sub loadO { my ($O, $f) = @_; $f ||= auto_inst_file; my $o; @@ -724,4 +745,5 @@ sub log_sizes { formatXiB(sum(`rpm --root $o->{prefix}/ -qa --queryformat "%{size}\n"`))) if -x "$o->{prefix}/bin/rpm"; } + 1; |