summaryrefslogtreecommitdiffstats
path: root/perl-install/install_steps_auto_install.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-07-19 00:05:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-07-19 00:05:25 +0000
commit65c4cf5a5db0dc5e8900256960960a54fdec0b69 (patch)
tree1af06108ec5fad6dca8c9821b8c3b2003f6dc394 /perl-install/install_steps_auto_install.pm
parent4239729f41a697b744609b24993e756ec48a1303 (diff)
downloaddrakx-backup-do-not-use-65c4cf5a5db0dc5e8900256960960a54fdec0b69.tar
drakx-backup-do-not-use-65c4cf5a5db0dc5e8900256960960a54fdec0b69.tar.gz
drakx-backup-do-not-use-65c4cf5a5db0dc5e8900256960960a54fdec0b69.tar.bz2
drakx-backup-do-not-use-65c4cf5a5db0dc5e8900256960960a54fdec0b69.tar.xz
drakx-backup-do-not-use-65c4cf5a5db0dc5e8900256960960a54fdec0b69.zip
based on Michael Brown <mbrown@fensystems.co.uk> patch:
- enables graphical steps in auto_installs for more than gtk - various cleanup
Diffstat (limited to 'perl-install/install_steps_auto_install.pm')
-rw-r--r--perl-install/install_steps_auto_install.pm42
1 files changed, 28 insertions, 14 deletions
diff --git a/perl-install/install_steps_auto_install.pm b/perl-install/install_steps_auto_install.pm
index f72565fd4..256f19ed2 100644
--- a/perl-install/install_steps_auto_install.pm
+++ b/perl-install/install_steps_auto_install.pm
@@ -7,8 +7,6 @@ use vars qw(@ISA $graphical @graphical_steps);
@ISA = qw(install_steps);
-@graphical_steps = qw(enteringStep beforeInstallPackages installPackages);
-
use modules;
@@ -22,19 +20,35 @@ use log;
sub new {
my ($type, $o) = @_;
- if ($graphical) {
- require install_steps_gtk;
- push @ISA, 'interactive_gtk';
- foreach my $f (@graphical_steps) {
- no strict 'refs';
- my $pkg = $install_steps_gtk::{$f} ? 'install_steps_gtk' : 'install_steps_interactive';
- log::l("install_steps_auto_install: adding function ", $pkg, "::", $f);
- *{"install_steps_auto_install::$f"} = sub {
- local @ISA = ('install_steps_gtk', @ISA);
- &{$pkg . '::' . $f};
- };
+ # Handle legacy options
+ $o->{interactive} ||= 'gtk' if $graphical;
+ $o->{interactiveSteps} ||= [ @graphical_steps ];
+ push @{$o->{interactiveSteps}}, qw(enteringStep formatMountPartitions beforeInstallPackages installPackages);
+
+ if ($o->{interactive}) {
+ push @ISA, "interactive_$o->{interactive}";
+
+ my $interactiveClass = "install_steps_$o->{interactive}";
+ require"$interactiveClass.pm"; #- no space to skip perl2fcalls
+
+ #- remove the empty wait_message
+ undef *wait_message;
+
+ foreach my $f (@{$o->{interactiveSteps}}) {
+ foreach my $pkg ($interactiveClass, 'install_steps_interactive') {
+ if ($::{$pkg . "::"}{$f}) {
+ log::l("install_steps_auto_install: adding function ", $pkg, "::", $f);
+
+ no strict 'refs';
+ *{"install_steps_auto_install::$f"} = sub {
+ local @ISA = ($interactiveClass, @ISA);
+ &{$::{$pkg . "::"}{$f}};
+ };
+ last;
+ }
+ }
}
- goto &install_steps_gtk::new;
+ goto &{$::{$interactiveClass . "::"}{new}};
} else {
(bless {}, ref $type || $type)->SUPER::new($o);
}