From 528338fa75e8ceedbf17763bf5a5c094e92d0fe8 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Sun, 19 Aug 2001 23:20:19 +0000 Subject: rename isCdNotEjectable in usingRamdisk, ensure no files are removed unless we're in ramdisk --- perl-install/common.pm | 4 ++-- perl-install/fs.pm | 4 ++-- perl-install/install2.pm | 2 +- perl-install/install_any.pm | 2 ++ perl-install/install_steps.pm | 4 ++-- perl-install/install_steps_interactive.pm | 2 +- perl-install/lang.pm | 2 +- perl-install/pkgs.pm | 2 +- perl-install/standalone/diskdrake | 2 +- 9 files changed, 13 insertions(+), 11 deletions(-) diff --git a/perl-install/common.pm b/perl-install/common.pm index 80b406780..e08f754ee 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -8,7 +8,7 @@ use vars qw(@ISA @EXPORT $SECTORSIZE); @ISA = qw(Exporter); # no need to export ``_'' -@EXPORT = qw($SECTORSIZE __ translate untranslate formatXiB removeXiBSuffix formatTime setVirtual makedev unmakedev salt isCdNotEjectable); +@EXPORT = qw($SECTORSIZE __ translate untranslate formatXiB removeXiBSuffix formatTime setVirtual makedev unmakedev salt); # perl_checker: RE-EXPORT-ALL push @EXPORT, @MDK::Common::EXPORT; @@ -114,7 +114,7 @@ sub formatTime { } } -sub isCdNotEjectable { scalar(grep { /ram3/ } cat_("/proc/mounts")) == 0 } +sub usingRamdisk { scalar(grep { /ram3/ } cat_("/proc/mounts")) } sub sync { &MDK::Common::System::sync } diff --git a/perl-install/fs.pm b/perl-install/fs.pm index ef520d5a9..d4e9a53fc 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -62,8 +62,8 @@ sub merge_fstabs { $p->{mntpoint} = $p2->{mntpoint} if delete $p->{unsafeMntpoint}; - $p->{type} = $p2->{type} if $p->{type} eq 'defaults'; - $p->{options} = $p2->{options}; + $p->{type} ||= $p2->{type}; + $p->{options} = $p2->{options} if $p->{type} eq 'defaults'; add2hash($p, $p2); } @l; diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 3ceedd2b8..db48f2d60 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -537,7 +537,7 @@ sub main { add2hash($o->{netc}, network::read_resolv_conf($file)); } } - install_any::remove_unused(); + install_any::remove_unused() if common::usingRamdisk(); #-the main cycle my $clicked = 0; diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index e5bb280fa..bba61987d 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -1007,6 +1007,8 @@ sub check_prog { $f; return if grep { -x $_ } @l; + common::usingRamdisk() or log::l("ERROR: check_prog can't find the program $f and we're not using ramdisk"), return; + my ($f_) = map { m|^/| ? $_ : "/usr/bin/$_" } $f; remove_bigseldom_used(); foreach (@bigseldom_used_groups) { diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 29e7d5464..8cc7e7175 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -183,8 +183,8 @@ sub doPartitionDisksAfter { } cat_("/proc/mounts") =~ m|(\S+)\s+/tmp/image nfs| && - !grep { $_->{mntpoint} eq "/mnt/nfs" } @{$o->{manualFstab} || []} and - push @{$o->{manualFstab}}, { type => "nfs", mntpoint => "/mnt/nfs", device => $1, options => "noauto,ro,nosuid,rsize=8192,wsize=8192" }; + !grep { $_->{mntpoint} eq "/mnt/nfs" } @{$o->{all_hds}{nfss}} and + push @{$o->{all_hds}{nfss}}, { type => 'nfs', mntpoint => "/mnt/nfs", device => $1, options => "noauto,ro,nosuid,rsize=8192,wsize=8192" }; } #------------------------------------------------------------------------------ diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 77691020c..39e32856b 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -654,7 +654,7 @@ sub chooseCD { my @mediumsDescr = (); my %mediumsDescr = (); - if (isCdNotEjectable()) { + if (!common::usingRamdisk()) { #- mono-cd in case of no ramdisk undef $packages->{mediums}{$_}{selected} foreach @mediums; log::l("low memory install, using single CD installation (as it is not ejectable)"); diff --git a/perl-install/lang.pm b/perl-install/lang.pm index 053e7048c..178671070 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -487,7 +487,7 @@ sub get_x_fontset { my $c = $charsets{$l->[1]} or return; if (my $f = $bigfonts{$l->[1]}) { my $dir = "/usr/X11R6/lib/X11/fonts"; - if (! -e "$dir/$f" && $::isInstall) { + if (! -e "$dir/$f" && $::isInstall && common::usingRamdisk()) { unlink "$dir/$_" foreach values %bigfonts; install_any::remove_bigseldom_used (); install_any::getAndSaveFile ("$dir/$f"); diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index 8bb0763a3..0bcd9d28a 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -423,7 +423,7 @@ sub psUsingHdlist { #- avoid using more than one medium if Cd is not ejectable. #- but keep all medium here so that urpmi has the whole set. - $method eq 'cdrom' && $medium > 1 && isCdNotEjectable() and return; + $method eq 'cdrom' && $medium > 1 && !common::usingRamdisk() and return; #- extract filename from archive, this take advantage of verifying #- the archive too. diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake index 049e9e3fa..639c19b49 100755 --- a/perl-install/standalone/diskdrake +++ b/perl-install/standalone/diskdrake @@ -70,7 +70,7 @@ fs::get_raw_hds('', $all_hds); fs::merge_info_from_fstab([ fsedit::get_really_all_fstab($all_hds) ]); fs::merge_info_from_mtab([ fsedit::get_really_all_fstab($all_hds) ]); -if ($ENV{TEST_DEFAULT_OPTIONS})) { +if ($ENV{TEST_DEFAULT_OPTIONS}) { fs::set_default_options($all_hds); fs::set_removable_mntpoints($all_hds); } -- cgit v1.2.1