diff options
Diffstat (limited to 'rescue/tree/etc/oem')
-rwxr-xr-x | rescue/tree/etc/oem | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/rescue/tree/etc/oem b/rescue/tree/etc/oem index fb056d1d7..3e865a92f 100755 --- a/rescue/tree/etc/oem +++ b/rescue/tree/etc/oem @@ -488,7 +488,7 @@ foreach (<F>) { /^\s*$/ and next; m/^\s*(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file"; - push @media, { rpmsdir => $2, descr => $3 }; + push @media, { hdlist => $1, rpmsdir => $2, descr => $3 }; } close F; @@ -527,8 +527,19 @@ if (${pkgs::packageByName($packages, 'psacct') || {}}{selected}) { system "rpm", "--root", "/mnt", "--initdb"; +#- keep in mind all the rpm files available (according to hdlists). +my (%files, %rpms); + #- copy and install from each cd image. foreach my $medium (@media) { + my $packer = new packdrake("/cdrom/Mandrake/base/$medium->{hdlist}"); + foreach (@{$packer->{files}}) { + $packer->{data}{$_}[0] eq 'f' or next; + my ($fullname, $file) = /([^:]*):(.*)/ ? ($1, "$2.rpm") : ($_, "$_.rpm"); + $files{$fullname} = $file; + $rpms{$file} = $medium->{rpmsdir}; + } + while ($cd && ! -d "/cdrom/$medium->{rpmsdir}") { system "unmount", "/dev/$cd"; system "eject", "/dev/$cd"; @@ -541,9 +552,9 @@ foreach my $medium (@media) { system "mkdir", "-p", "/hd/$medium->{rpmsdir}"; foreach my $pkg (@{$packages->{depslist}}) { $pkg->{closure} && !$pkg->{selected} or next; - my $file = "/cdrom/$medium->{rpmsdir}/" . rpm_filename($pkg); + my $file = "/cdrom/$medium->{rpmsdir}/" . $files{rpm_fullname($pkg)}; if (-e $file) { - print " copying " . rpm_filename($pkg) . "\n"; + print " copying " . rpm_fullname($pkg) . "\n"; system "cp", "-a", $file, "/hd/$medium->{rpmsdir}"; delete $pkg->{closure}; } @@ -552,7 +563,7 @@ foreach my $medium (@media) { print "Installing packages from medium labeled \"$medium->{descr}\"\n"; if (my $pkg = pkgs::packageByName($packages, 'glibc')) { #- HACK FOR GLIBC if (delete $pkg->{selected}) { - my $file = "/cdrom/$medium->{rpmsdir}/" . rpm_filename($pkg); + my $file = "/cdrom/$medium->{rpmsdir}/" . $files{rpm_fullname($pkg)}; if (-e $file) { system "rpm", "-ivh", "--root", "/mnt", "--nodeps", "--force", "--noscripts", $file; } @@ -563,7 +574,7 @@ foreach my $medium (@media) { my @files; foreach my $pkg (@{$packages->{depslist}}) { $pkg->{selected} or next; - my $file = "/cdrom/$medium->{rpmsdir}/" . rpm_filename($pkg); + my $file = "/cdrom/$medium->{rpmsdir}/" . $files{rpm_fullname($pkg)}; if (-e $file) { push @files, $file; delete $pkg->{selected}; @@ -676,7 +687,7 @@ sub select_packages { #- INSTALL class need to be copied as closure (unless installed after). #- but we have to remove kernel22 and kernel22-smp now obsolete for oem. foreach (@{$o->{packages}{needToCopy}}) { - /^(kernel22.*|raidtools|lvm|reiserfsprogs|xfsprogs|jfsprogs|XFree86-(Mach8|Mach32|Mono))$/ and next; + /^(kernel22.*|raidtools|lvm|reiserfsprogs|xfsprogs|jfsprogs|XFree86-(Mach8|Mach32|Mono|W32|3DLabs|P9000|8514|VGA16|I128|AGX))$/ and next; my $pkg = pkgs::packageByName($o->{packages}, $_); pkgs::selectPackage($o->{packages}, $pkg); } @@ -700,8 +711,8 @@ sub select_packages { } #- special packages that are to be move to closure always ... - foreach (qw(nfs-utils-client numlock usbd hotplug alsa alsa-utils), - exists $options{server} ? qw(Aurora Aurora-Monitor-NewStyle-Categorizing-WsLib bootsplash) : ()) { + foreach (qw(nfs-utils-client numlock usbd hotplug alsa alsa-utils + Aurora Aurora-Monitor-NewStyle-Categorizing-WsLib bootsplash)) { my $pkg = pkgs::packageByName($o->{packages}, $_); if ($pkg) { pkgs::selectPackage($o->{packages}, $pkg); @@ -725,8 +736,8 @@ sub select_packages { sub chop_version { ($_[0] =~ /^([^:\s]*)-[^:\-\s]+-[^:\-\s]+\.[^:\.\-\s]*(?::\S*)?/)[0] || die "unable to parse $_[0]"; } -sub rpm_filename { - (($_[0]{name} =~ /^([^:\s]*-[^:\-\s]+-[^:\-\s]+\.[^:\.\-\s]*)(?::\S*)?/)[0] || die "unable to parse $_[0]") . ".rpm"; +sub rpm_fullname { + ($_[0]{name} =~ /^([^:\s]*-[^:\-\s]+-[^:\-\s]+\.[^:\.\-\s]*)(?::\S*)?/)[0] || die "unable to parse $_[0]"; } sub read_depslist { |