summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-03-26 21:30:07 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-03-26 21:30:07 +0000
commit3600a1fd1e9398fad208e3e94c6def2a8e84314a (patch)
treed2a5701e3436aff6a7c61e29f8254164505f23f4 /perl-install/install_any.pm
parentaaab5d0fa8f4a6eef4c1d2ee6af9651f6e576db5 (diff)
downloaddrakx-3600a1fd1e9398fad208e3e94c6def2a8e84314a.tar
drakx-3600a1fd1e9398fad208e3e94c6def2a8e84314a.tar.gz
drakx-3600a1fd1e9398fad208e3e94c6def2a8e84314a.tar.bz2
drakx-3600a1fd1e9398fad208e3e94c6def2a8e84314a.tar.xz
drakx-3600a1fd1e9398fad208e3e94c6def2a8e84314a.zip
no_comment
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm37
1 files changed, 19 insertions, 18 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index f268fb81d..4c462f48d 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -112,8 +112,11 @@ sub rewindGetFile() {
#- Functions
#-######################################################################################
sub kernelVersion {
- local $_ = readlink("$::o->{prefix}/boot/vmlinuz") || $::testing && "vmlinuz-2.2.testversion" or die "I couldn't find the kernel package!";
- first(/vmlinuz-(.*)/);
+ my ($o) = @_;
+ local $_ = readlink("$::o->{prefix}/boot/vmlinuz") and return first(/vmlinuz-(.*)/);
+
+ my $p = pkgs::packageByName($o->{packages}, "kernel") or die "I couldn't find the kernel package!";
+ pkgs::packageVersion($p) . "-" . pkgs::packageRelease($p);
}
@@ -170,7 +173,7 @@ sub setPackages($) {
require pkgs;
if (!$o->{packages} || is_empty_hash_ref($o->{packages}[0])) {
- $o->{packages} = pkgs::psUsingHdlists($o->{prefix});
+ $o->{packages} = pkgs::psUsingHdlists($o->{prefix}, $o->{method});
push @{$o->{default_packages}}, "nfs-utils-clients" if $o->{method} eq "nfs";
push @{$o->{default_packages}}, "numlock" if $o->{miscellaneous}{numlock};
@@ -458,7 +461,7 @@ sub setupFB {
}
}
}
- if (lilo::add_kernel($o->{prefix}, $o->{bootloader}, kernelVersion(), 'fb',
+ if (lilo::add_kernel($o->{prefix}, $o->{bootloader}, kernelVersion($o), 'fb',
{
label => 'linux-fb',
root => lilo::get("/boot/vmlinuz", $o->{bootloader})->{root},
@@ -548,34 +551,32 @@ sub fsck_option() {
}
sub install_urpmi {
- my ($prefix, $method) = @_;
-
- (my $name = _("installation")) =~ s/\s/_/g; #- in case translators are too good :-/
-
- my $hdlist = "$prefix/var/lib/urpmi/hdlist";
- symlink "$hdlist.cz2", "hdlist.$name.cz2" or log::l("symlink failed " . __FILE__ . " " . __LINE__);
+ my ($prefix, $method, $mediums) = @_;
{
local *F = getFile("depslist");
output("$prefix/var/lib/urpmi/depslist", <F>);
}
- {
+ my @cfg = map_index {
+ my $name = $_->{fakemedium};
+
local *LIST;
open LIST, ">$prefix/var/lib/urpmi/list.$name" or log::l("failed to write list.$name"), return;
my $dir = ${{ nfs => "file://mnt/nfs",
- hd => "file:/" . hdInstallPath,
+ hd => "file:/" . hdInstallPath(),
ftp => $ENV{URLPREFIX},
http => $ENV{URLPREFIX},
- cdrom => "removable_cdrom_1://mnt/cdrom" }}{$method};
+ cdrom => "removable_cdrom_$::i://mnt/cdrom" }}{$method} . "/Mandrake/RPMS$_->{medium}";
- local *FILES; open FILES, "bzip2 -dc $hdlist.cz2 2>/dev/null | hdlist2names - |";
- chop, print LIST "$dir/Mandrake/RPMS/$_\n" foreach <FILES>;
+ local *FILES; open FILES, "bzip2 -dc /tmp/$_->{hdlist} 2>/dev/null | hdlist2names - |";
+ chop, print LIST "$dir/$_\n" foreach <FILES>;
close FILES or log::l("hdlist2names failed"), return;
- $dir .= "/Mandrake/RPMS with ../base/hdlist.cz2" if $method =~ /ftp|http/;
- eval { output "$prefix/etc/urpmi/urpmi.cfg", "$name $dir\n" };
- }
+ $dir .= " with ../base/$_->{hdlist}" if $method =~ /ftp|http/;
+ "$name $dir\n";
+ } values %$mediums;
+ eval { output "$prefix/etc/urpmi/urpmi.cfg", @cfg };
}
sub list_passwd() {