diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-04-05 10:35:23 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-04-05 10:35:23 +0000 |
commit | ab72206afef20f95422a6c901a6ff8ec04e18429 (patch) | |
tree | 606485067bf5603bd8734ef3f1ef8db15581c60b /perl-install | |
parent | 934ae5ea0ccdb31df19a82577dc3877973cb857a (diff) | |
download | drakx-backup-do-not-use-ab72206afef20f95422a6c901a6ff8ec04e18429.tar drakx-backup-do-not-use-ab72206afef20f95422a6c901a6ff8ec04e18429.tar.gz drakx-backup-do-not-use-ab72206afef20f95422a6c901a6ff8ec04e18429.tar.bz2 drakx-backup-do-not-use-ab72206afef20f95422a6c901a6ff8ec04e18429.tar.xz drakx-backup-do-not-use-ab72206afef20f95422a6c901a6ff8ec04e18429.zip |
- move report_bug in install_any
- g_auto_install generates the auto_inst.cfg string without output'ing it
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/commands.pm | 31 | ||||
-rw-r--r-- | perl-install/install_any.pm | 33 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 2 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 4 |
4 files changed, 36 insertions, 34 deletions
diff --git a/perl-install/commands.pm b/perl-install/commands.pm index 6300b315a..c4dd279d2 100644 --- a/perl-install/commands.pm +++ b/perl-install/commands.pm @@ -569,34 +569,6 @@ sub install_cpio($$;@) { "$dir/$name"; } -sub report_bug { - my ($prefix) = @_; - - sub header { " -******************************************************************************** -* $_[0] -********************************************************************************"; - } - - join '', map { chomp; "$_\n" } - header("lspci"), detect_devices::stringlist(), - header("pci_devices"), cat_("/proc/bus/pci/devices"), - header("fdisk"), arch() =~ /ppc/ ? `$ENV{LD_LOADER} pdisk -l` : `$ENV{LD_LOADER} fdisk -l`, - header("scsi"), cat_("/proc/scsi/scsi"), - header("lsmod"), cat_("/proc/modules"), - header("cmdline"), cat_("/proc/cmdline"), - header("pcmcia: stab"), cat_("/var/run/stab"), - header("usb"), cat_("/proc/bus/usb/devices"), - header("partitions"), cat_("/proc/partitions"), - header("cpuinfo"), cat_("/proc/cpuinfo"), - header("syslog"), cat_("/tmp/syslog"), - header("ddcxinfos"), `$ENV{LD_LOADER} ddcxinfos`, - header("ddebug.log"), cat_("/tmp/ddebug.log"), - header("install.log"), cat_("$prefix/root/install.log"), - header("fstab"), cat_("$prefix/etc/fstab"), - ; -} - sub bug { my ($h) = getopts(\@_, "h"); $h and die "usage: bug\nput file report.bug on fat formatted floppy\n"; @@ -604,7 +576,8 @@ sub bug { require detect_devices; mount devices::make(detect_devices::floppy()), "/fd0"; - output "/fd0/report.bug", report_bug("/mnt"); #- no other way :-( + require install_any; + output "/fd0/report.bug", install_any::report_bug("/mnt"); #- no other way :-( umount "/fd0"; sync; } diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index f946806ab..e87116a3e 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -566,8 +566,37 @@ sub kdemove_desktop_file { #-############################################################################### sub auto_inst_file() { ($::g_auto_install ? "/tmp" : "$::o->{prefix}/root") . "/auto_inst.cfg.pl" } +sub report_bug { + my ($prefix) = @_; + + sub header { " +******************************************************************************** +* $_[0] +********************************************************************************"; + } + + join '', map { chomp; "$_\n" } + header("lspci"), detect_devices::stringlist(), + header("pci_devices"), cat_("/proc/bus/pci/devices"), + header("fdisk"), arch() =~ /ppc/ ? `$ENV{LD_LOADER} pdisk -l` : `$ENV{LD_LOADER} fdisk -l`, + header("scsi"), cat_("/proc/scsi/scsi"), + header("lsmod"), cat_("/proc/modules"), + header("cmdline"), cat_("/proc/cmdline"), + header("pcmcia: stab"), cat_("/var/run/stab"), + header("usb"), cat_("/proc/bus/usb/devices"), + header("partitions"), cat_("/proc/partitions"), + header("cpuinfo"), cat_("/proc/cpuinfo"), + header("syslog"), cat_("/tmp/syslog"), + header("ddcxinfos"), `$ENV{LD_LOADER} ddcxinfos`, + header("ddebug.log"), cat_("/tmp/ddebug.log"), + header("install.log"), cat_("$prefix/root/install.log"), + header("fstab"), cat_("$prefix/etc/fstab"), + header("auto_inst"), g_auto_install(), + ; +} + sub g_auto_install { - my ($f, $replay) = @_; $f ||= auto_inst_file; + my ($replay) = @_; my $o = {}; require pkgs; @@ -596,7 +625,7 @@ sub g_auto_install { $_ = { %{$_ || {}} }, delete @$_{qw(oldu oldg password password2)} foreach $o->{superuser}, @{$o->{users} || []}; require Data::Dumper; - output($f, + join('', "# You should always check the syntax with 'perl -cw auto_inst.cfg.pl' before testing\n", Data::Dumper->Dump([$o], ['$o']), if_($replay, qq(\npackage install_steps_auto_install;), q( diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 4d2c1544a..e3a3cb625 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -50,7 +50,7 @@ sub leavingStep { if (-d "$o->{prefix}/root") { eval { commands::cp('-f', "/tmp/ddebug.log", "$o->{prefix}/root") }; - install_any::g_auto_install(); + output(install_any::auto_inst_file(), install_any::g_auto_install()); } for (my $s = $o->{steps}{first}; $s; $s = $o->{steps}{$s}{next}) { diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 0690ccb1d..34d9d943c 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -1097,7 +1097,7 @@ sub generateAutoInstFloppy { ", "7m\n"; local $o->{partitioning}{clearall} = 1; - install_any::g_auto_install("$workdir/auto_inst.cfg"); + output("$workdir/auto_inst.cfg", install_any::g_auto_install()); run_program::run("genromfs", "-d", $workdir, "-f", "/dev/ram", "-A", "2048,/..", "-a", "512", "-V", "DrakX autoinst"); fs::mount("/dev/ram", $mountdir, 'romfs', 0); @@ -1126,7 +1126,7 @@ sub generateAutoInstFloppy { ", "07\n" if !$replay; local $o->{partitioning}{clearall} = !$replay; - install_any::g_auto_install("/floppy/auto_inst.cfg", $replay); + output("/floppy/auto_inst.cfg", install_any::g_auto_install($replay)); fs::umount("/floppy"); } |