summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install/any.pm133
1 files changed, 133 insertions, 0 deletions
diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm
index 0cfffad1a..675203c59 100644
--- a/perl-install/install/any.pm
+++ b/perl-install/install/any.pm
@@ -23,8 +23,24 @@ use lang;
use any;
use log;
+=head1 SYNOPSYS
+
+Misc installer specific functions
+
+=head1 Functions
+
+=over
+
+=cut
+
our @advertising_images;
+=item drakx_version($o)
+
+Returns DrakX version as stored in C<install/stage2/VERSION> file
+
+=cut
+
sub drakx_version {
my ($o) = @_;
@@ -39,11 +55,23 @@ sub dont_run_directly_stage2() {
readlink("/usr/bin/runinstall2") eq "runinstall2.sh";
}
+=item is_network_install($o)
+
+Is it a network install?
+
+=cut
+
sub is_network_install {
my ($o) = @_;
member($o->{method}, qw(ftp http nfs));
}
+=item spawnShell()
+
+Starts a shell on tty2
+
+=cut
+
sub spawnShell() {
return if $::local_install || $::testing;
@@ -84,6 +112,12 @@ cant_spawn:
c::_exit(1);
}
+=item getAvailableSpace($o)
+
+Returns available space
+
+=cut
+
sub getAvailableSpace {
my ($o) = @_;
fs::any::getAvailableSpace($o->{fstab});
@@ -103,6 +137,12 @@ sub preConfigureTimezone {
add2hash_($o->{timezone}, { UTC => $utc, ntp => $ntp });
}
+=item ask_suppl_media_method($o)
+
+Enables to add supplementary media
+
+=cut
+
sub ask_suppl_media_method {
my ($o) = @_;
our $suppl_already_asked;
@@ -171,6 +211,12 @@ sub prep_net_suppl_media {
sleep(3);
}
+=item ask_url($in, $o_url)
+
+Asks URL of the mirror
+
+=cut
+
sub ask_url {
my ($in, $o_url) = @_;
@@ -186,6 +232,13 @@ sub ask_url {
}
} } ]) && $url;
}
+
+=item ask_mirror($o, $type, $o_url)
+
+Retrieves list of mirrors and offers to pick one
+
+=cut
+
sub ask_mirror {
my ($o, $type, $o_url) = @_;
@@ -255,6 +308,14 @@ sub ask_suppl_media_url {
"nfs://$host$dir";
} else { internal_error("bad method $method") }
}
+
+
+=item selectSupplMedia($o)
+
+Offers to add a supplementary media. If yes, ask which mirror to use, ...
+
+=cut
+
sub selectSupplMedia {
my ($o) = @_;
my $url;
@@ -309,6 +370,15 @@ sub selectSupplMedia {
goto ask_url;
}
+=item load_rate_files($o)
+
+Loads the package rates file (C<rpmsrate>) as well as the C<compssUsers.pl>
+file which contains the package groups GUI.
+
+Both files came from the C<meta-task> package.
+
+=cut
+
sub load_rate_files {
my ($o) = @_;
#- must be done after getProvides
@@ -345,6 +415,12 @@ sub is_firmware_needed_ {
@need || @xpkgs || $need_microcode;
}
+=item is_firmware_needed($o)
+
+Is a firmware needed by some HW?
+
+=cut
+
sub is_firmware_needed {
my ($o) = @_;
state $res;
@@ -362,6 +438,12 @@ sub msg_if_firmware_needed {
);
}
+=item enable_nonfree_media($medium)
+
+Enable a disabled Nonfree medium.
+
+=cut
+
sub enable_nonfree_media {
my ($medium) = @_;
return if $medium->{name} !~ /Nonfree/ || !$medium->{ignore};
@@ -369,6 +451,13 @@ sub enable_nonfree_media {
$medium->{temp_enabled} = 1;
}
+=item media_screen($o)
+
+Lists available media with their status (enabled/disabled).
+Suggests to enable Nonfree media if needed.
+
+=cut
+
sub media_screen {
my ($o) = @_;
@@ -441,6 +530,28 @@ sub media_screen {
);
}
+=item setPackages($o)
+
+=over 4
+
+=item * Initialize urpmi
+
+=item * Retrieves media.cfg
+
+=item * Offers to add supplementary media (according to the install method)
+
+=item * Offers to enable some disabled media
+
+=item * Ensure we have a kernel and basesystem
+
+=item * Flags package rates
+
+=item * Select default packages according to the computer
+
+=back
+
+=cut
+
sub setPackages {
my ($o) = @_;
@@ -525,6 +636,12 @@ sub setPackages {
}
}
+=item remove_package_for_upgrade($o)
+
+Removes packages that must be uninstalled prior to upgrade
+
+=cut
+
sub remove_package_for_upgrade {
my ($o) = @_;
my $extension = $o->{upgrade_by_removing_pkgs_matching};
@@ -547,6 +664,12 @@ sub remove_package_for_upgrade {
log::l("Removing packages took: ", formatTimeRaw(time() - $time));
}
+=item count_files($dir)
+
+Returns the number of files in $dir
+
+=cut
+
sub count_files {
my ($dir) = @_;
-d $dir or return 0;
@@ -673,6 +796,12 @@ sub rpmsrate_always_flags {
$rpmsrate_flags_chosen;
}
+=item default_packages($o)
+
+Selects default packages to install according to configuration (FS, HW, ...)
+
+=cut
+
sub default_packages {
my ($o) = @_;
my @l;
@@ -1561,4 +1690,8 @@ sub configure_pcmcia {
run_program::run("/lib/udev/pcmcia-socket-startup");
}
+=back
+
+=cut
+
1;