diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/Makefile | 7 | ||||
-rw-r--r-- | perl-install/common.pm | 3 | ||||
-rw-r--r-- | perl-install/fsedit.pm | 6 | ||||
-rw-r--r-- | perl-install/install2.pm | 4 | ||||
-rw-r--r-- | perl-install/install_steps.pm | 7 | ||||
-rw-r--r-- | perl-install/lang.pm | 8 | ||||
-rw-r--r-- | perl-install/pkgs.pm | 5 |
7 files changed, 22 insertions, 18 deletions
diff --git a/perl-install/Makefile b/perl-install/Makefile index ccd410301..3b401fa1e 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -1,10 +1,10 @@ SO_FILES = c/blib/arch/auto/c/c.so -PMS = *.pm c/*.pm resize_fat/*.pm commands install2 diskdrake +PMS = *.pm c/*.pm resize_fat/*.pm po/*.pm commands install2 diskdrake DEST = /tmp/t/Mandrake/instimage DESTREP4PMS = $(DEST)/usr/bin/perl-install PERL = perl LOCALFILES = $(PERL) mouseconfig -EXCLUDE = $(LOCALFILES) boot-hd.img keymaps xmodmaps +EXCLUDE = $(LOCALFILES) boot-hd.img keymaps xmodmaps consolefonts .PHONY: all po tags install clean verify_c @@ -50,7 +50,7 @@ test_pms: verify_c verify_c: ./verify_c $(PMS) -install_pms: $(SO_FILES) +install_pms: all for i in `perl -ne 's/sub (\w+?)_? {.*/$$1/ and print' commands.pm`; do ln -sf commands $(DEST)/usr/bin/$$i; done install -d $(DESTREP4PMS) @@ -108,6 +108,7 @@ get_needed_files: $(SO_FILES) cp -a xmodmaps $(DEST)/usr/share cp -a keymaps $(DEST)/usr/share + cp -a consolefonts $(DEST)/usr/share echo -e "#!/usr/bin/perl\n\nsymlink '/tmp/rhimage/usr/lib/perl5', '/usr/lib/perl5';\nexec '/usr/bin/sh'" > $(DEST)/usr/bin/runinstall2 chmod a+x $(DEST)/usr/bin/runinstall2 diff --git a/perl-install/common.pm b/perl-install/common.pm index 1d7b8730f..c15aafdae 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -85,7 +85,8 @@ sub translate { my ($s) = @_; unless (defined %po::I18N::I18N) { if (my ($lang) = ($ENV{LC_ALL} || $ENV{LANGUAGE} || $ENV{LC_MESSAGES} || $ENV{LANG}) =~ /(..)/) { - eval { require "po/$lang.pm" }; $@ and warn "no translation in $lang available\n"; + local $SIG{__DIE__} = 'none'; + eval { require "po/$lang.pm" }; } } $po::I18N::I18N{$s} || $s; diff --git a/perl-install/fsedit.pm b/perl-install/fsedit.pm index aaef30baf..8e511c8b9 100644 --- a/perl-install/fsedit.pm +++ b/perl-install/fsedit.pm @@ -183,6 +183,10 @@ sub allocatePartitions($$) { sub auto_allocate($;$) { my ($hds, $suggestions) = @_; - allocatePartitions($hds, $suggestions || \@suggestions); + my %mntpoints; map { $mntpoints{$_->{mntpoint}} = 1 } get_fstab(@$hds); + allocatePartitions($hds, [ + grep { ! $mntpoints{$_->{mntpoint}} } + @{ $suggestions || \@suggestions } + ]); map { partition_table::assign_device_numbers($_) } @$hds; } diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 9b7a42865..442ad4cf0 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -19,7 +19,7 @@ use pkgs; use smp; use lang; -$::testing = 1;#$ENV{PERL_INSTALL_TEST}; +$::testing = $ENV{PERL_INSTALL_TEST}; $INSTALL_VERSION = 0; my @installStepsFields = qw(text help skipOnCancel skipOnLocal prev next); @@ -93,7 +93,7 @@ my $default = { # display => "jaba:1", user => { name => 'foo', password => 'foo', shell => '/bin/bash', realname => 'really, it is foo' }, rootPassword => 'toto', - lang => 'us', + lang => 'fr', isUpgrade => 0, installClass => 'Server', bootloader => { onmbr => 1, linear => 0 }, diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index ace94a692..ceef9a294 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -40,7 +40,6 @@ sub leavingStep($$) { } sub chooseLanguage($) { -# eval { run_program::run('loadkeys', "/tmp/$o->{default}->{lang}) }; $@ and log::l("loadkeys failed"); $o->{default}->{lang}; } sub selectInstallOrUpgrade($) { @@ -78,8 +77,6 @@ sub choosePackages($$$) { sub beforeInstallPackages($) { - $o->{method}->prepareMedia($o->{prefix}, $o->{fstab}) unless $::testing; - foreach (qw(dev etc home mnt tmp var var/tmp var/lib var/lib/rpm)) { mkdir "$o->{prefix}/$_", 0755; } @@ -96,7 +93,7 @@ sub beforeInstallPackages($) { sub installPackages($$) { my ($o, $packages) = @_; my $toInstall = [ grep { $_->{selected} } values %$packages ]; - pkgs::install($o->{prefix}, $o->{method}, $toInstall, $o->{isUpgrade}, 0); + pkgs::install($o->{prefix}, $toInstall, $o->{isUpgrade}, 0); } sub afterInstallPackages($) { @@ -205,7 +202,7 @@ sub setupXfree { $o->{packages}->{$x} or die "can't find X server $x"; log::l("I will install the $x package"); - pkgs::install($o->{prefix}, $o->{method}, $o->{packages}->{$x}, $o->{isUpgrade}, 0); + pkgs::install($o->{prefix}, $o->{packages}->{$x}, $o->{isUpgrade}, 0); #TODO } diff --git a/perl-install/lang.pm b/perl-install/lang.pm index c7d8ed25e..54e75bcd8 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -19,7 +19,7 @@ my %languages = ( "ro" => [ "Romanian", "lat2-sun16", "iso02", "ro_RO" ], "sk" => [ "Slovak", "lat2-sun16", "iso02", "sk_SK" ], "ru" => [ "Russian", "Cyr_a8x16", "koi2alt", "ru_SU" ], -"uk_UA"=> [ "Ukrainian", "RUSCII_8x16", "koi2alt", "uk_UA" ], +"uk_UA"=> [ "Ukrainian", "ruscii_8x16", "koi2alt", "uk_UA" ], ); 1; @@ -39,7 +39,7 @@ sub set { if ($lang) { $ENV{LANG} = $ENV{LINGUAS} = $lang; $ENV{LC_ALL} = $languages{$lang}->[3]; - my $f = $languages{$lang}->[1]; $f and load_font($f); + #if (my $f = $languages{$lang}->[1]) { load_font($f) } } else { # stick with the default (English) */ delete $ENV{LANG}; @@ -74,7 +74,7 @@ sub write { sub load_font { my ($fontFile) = @_; - cpio::installCpioFile("/etc/fonts.cgz", $fontFile, "/tmp/font", 1) or die "error extracting $fontFile from /etc/fonts.cfz"; - c::loadFont('/tmp/font') or log::l("error in loadFont: one of PIO_FONT PIO_UNIMAPCLR PIO_UNIMAP PIO_UNISCRNMAP failed: $!"); + log::l("loading font /usr/share/consolefonts/$fontFile.psf"); + c::loadFont("/tmp/$fontFile") or log::l("error in loadFont: one of PIO_FONT PIO_UNIMAPCLR PIO_UNIMAP PIO_UNISCRNMAP failed: $!"); print STDERR "\033(K"; } diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 060add8c5..34a5774c9 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -5,6 +5,7 @@ use strict; use vars qw($fd); use common qw(:common :file); +use install_any; use log; use smp; use fs; @@ -119,7 +120,7 @@ sub init_db { } sub install { - my ($prefix, $method, $toInstall, $isUpgrade, $force) = @_; + my ($prefix, $toInstall, $isUpgrade, $force) = @_; my $db = c::rpmdbOpen($prefix) or die "error opening RPM database: ", c::rpmErrorString(); log::l("opened rpm database"); @@ -131,7 +132,7 @@ sub install { foreach my $p (@$toInstall) { my $fullname = sprintf "%s-%s-%s.%s.rpm", map { c::headerGetEntry($p->{header}, $_) } qw(name version release arch); - c::rpmtransAddPackage($trans, $p->{header}, $method->getFile($fullname) , $isUpgrade); + c::rpmtransAddPackage($trans, $p->{header}, install_any::imageGetFile($fullname) , $isUpgrade); $nb++; $total += $p->{size}; } |