diff options
author | Francois Pons <fpons@mandriva.com> | 2003-09-18 13:11:58 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-09-18 13:11:58 +0000 |
commit | a4df177f59ae4653740f693a37274b2ad7858848 (patch) | |
tree | 124d02f485089a1c4152f3f79df344440996adc1 /rescue | |
parent | 24be4ada220130df4a8269d6bf8326efbbec9bf9 (diff) | |
download | drakx-a4df177f59ae4653740f693a37274b2ad7858848.tar drakx-a4df177f59ae4653740f693a37274b2ad7858848.tar.gz drakx-a4df177f59ae4653740f693a37274b2ad7858848.tar.bz2 drakx-a4df177f59ae4653740f693a37274b2ad7858848.tar.xz drakx-a4df177f59ae4653740f693a37274b2ad7858848.zip |
fixed for %{ARCH} used in hdlists.
Diffstat (limited to 'rescue')
-rwxr-xr-x | rescue/tree/etc/oem | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/rescue/tree/etc/oem b/rescue/tree/etc/oem index 3c97ec134..8bbbc5663 100755 --- a/rescue/tree/etc/oem +++ b/rescue/tree/etc/oem @@ -552,8 +552,10 @@ foreach my $medium (@media) { foreach (@{$packer->{files}}) { $packer->{data}{$_}[0] eq 'f' or next; my ($fullname, $file) = /([^:]*):(.*)/ ? ($1, "$2.rpm") : ($_, "$_.rpm"); - $files{$fullname} = $file; - $rpms{$file} = $medium->{rpmsdir}; + $files{$fullname} = "$medium->{rpmsdir}/$file"; + #- convert %{ARCH} to effective arch of the given package. + my ($arch) = $fullname =~ /\.([^\.\-]*)$/; + $files{$fullname} =~ s|%{ARCH}|$arch|g; } } @@ -562,7 +564,9 @@ system "rpm", "--root", "/mnt", "--initdb"; #- copy and install from each cd image. foreach my $medium (@media) { - while ($cd && ! -d "/cdrom/$medium->{rpmsdir}") { + my $rpmsidr = $medium->{rpmsdir}; + $rpmsdir =~ s|%{ARCH}.*||; #- only for checking directory presence... + while ($cd && ! -d "/cdrom/$rpmsdir") { system "unmount", "/dev/$cd"; system "eject", "/dev/$cd"; print "Please insert the cdrom labeled \"$medium->{descr}\"\n and press [enter] when done\n"; @@ -571,15 +575,18 @@ foreach my $medium (@media) { } print "Copying packages from medium labeled \"$medium->{descr}\" to hard disk\n"; - system "mkdir", "-p", "/hd/$medium->{rpmsdir}"; foreach my $pkg (@{$packages->{depslist}}) { $files{rpm_fullname($pkg)} or next; - my $file = "/cdrom/$medium->{rpmsdir}/" . $files{rpm_fullname($pkg)}; + my ($arch) = rpm_fullname($pkg) =~ /\.([^\.\-]*)$/; + $rpmsdir = $medium->{rpmsdir}; + $rpmsdir =~ s|%{ARCH}|$arch|g; + system "mkdir", "-p", "/hd/$rpmsdir"; + my $file = "/cdrom/" . $files{rpm_fullname($pkg)}; if (-e $file) { print " copying " . rpm_fullname($pkg) . "\n"; - system "cp", "-a", $file, "/hd/$medium->{rpmsdir}"; + system "cp", "-a", $file, "/hd/$rpmsdir"; if (rpm_fullname($pkg) =~ /mandrake-release/) { - system "rpm", "-Uvh", "--root", "/mnt", "--nodeps", "--force", "/hd/$medium->{rpmsdir}/" . $files{rpm_fullname($pkg)}; + system "rpm", "-Uvh", "--root", "/mnt", "--nodeps", "--force", "/hd/" . $files{rpm_fullname($pkg)}; } } } |