From 640255572c30658ad75a7ed7948617dd56fdeaa4 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 10 Jul 2000 16:33:21 +0000 Subject: no_comment --- perl-install/Xconfig.pm | 1 + perl-install/Xconfigurator.pm | 8 ++++---- perl-install/common.pm | 5 +---- perl-install/fs.pm | 22 ++++++++++------------ perl-install/install2.pm | 13 ++++++++++--- perl-install/install_steps_auto_install.pm | 6 ++++++ perl-install/install_steps_gtk.pm | 9 +++++---- perl-install/mouse.pm | 7 ++++++- perl-install/network.pm | 2 +- perl-install/standalone/mousedrake | 10 +++++----- 10 files changed, 49 insertions(+), 34 deletions(-) (limited to 'perl-install') diff --git a/perl-install/Xconfig.pm b/perl-install/Xconfig.pm index 925c836e0..fb1b03cc4 100644 --- a/perl-install/Xconfig.pm +++ b/perl-install/Xconfig.pm @@ -30,6 +30,7 @@ sub getinfo { add2hash($o->{mouse}, mouse::detect()) unless $o->{mouse}{XMOUSETYPE}; $o->{mouse}{device} ||= "mouse" if -e "/dev/mouse"; + $o->{mouse}{nbuttons} ||= mouse::X2nbuttons($o->{mouse}{XMOUSETYPE}); $o; } diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 1de705d0f..c69a3c477 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -659,8 +659,8 @@ sub write_XF86Config { print F qq( Device "/dev/$O->{device}"\n); print G qq( Option "Device" "/dev/$O->{device}"\n); #- this will enable the "wheel" or "knob" functionality if the mouse supports it - print F " ZAxisMapping 4 5\n" if - member($O->{XMOUSETYPE}, qw(IntelliMouse IMPS/2 ThinkingMousePS/2 NetScrollPS/2 NetMousePS/2 MouseManPlusPS/2)); + print F " ZAxisMapping 4 5\n" if $O->{nbuttons} > 3; + print F " ZAxisMapping 6 7\n" if $O->{nbuttons} > 5; print F "#" unless $O->{XEMU3}; print G "#" unless $O->{XEMU3}; @@ -896,7 +896,7 @@ Section "ServerLayout" print G ' InputDevice "Keyboard1" "CoreKeyboard" EndSection -'; +'; #-" close F; close G; @@ -1015,7 +1015,7 @@ sub main { $in->ask_warn('', _("Please log out and then use Ctrl-Alt-BackSpace")) unless $found; } else { $in->set_help('configureXxdm') unless $::isStandalone; - my $run = $o->{xdm} || $::auto || $in->ask_yesorno(_("X at startup"), + my $run = exists $o->{xdm} ? $o->{xdm} : $::auto || $in->ask_yesorno(_("X at startup"), _("I can set up your computer to automatically start X upon booting. Would you like X to start when you reboot?"), 1); diff --git a/perl-install/common.pm b/perl-install/common.pm index 0a9a29271..cbbc79ff2 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -359,10 +359,7 @@ sub formatAlaTeX($) { sub formatLines($) { my ($t, $tmp); foreach (split "\n", $_[0]) { - if (/^$/) { - $t .= "$tmp\n"; - $tmp = ""; - } elsif (/^\s/) { + if (/^\s/) { $t .= "$tmp\n"; $tmp = $_; } else { diff --git a/perl-install/fs.pm b/perl-install/fs.pm index 2eb7c4bf9..9d3c38049 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -232,6 +232,14 @@ sub umount($) { sub mount_part($;$$) { my ($part, $prefix, $rdonly) = @_; + if ($part->{realMntpoint} eq "/tmp/hdimage") { + my $dir = "$prefix$part->{mntpoint}"; + $dir =~ s|/+$||; + log::l("special hd case ($dir)"); + rmdir $dir; + symlink "/tmp/hdimage", $dir; + return; + } #- root carrier's link can't be mounted loopback::carryRootCreateSymlink($part, $prefix); @@ -277,23 +285,13 @@ sub umount_part($;$) { } sub mount_all($;$$) { - my ($fstab, $prefix, $hd_dev) = @_; #- hd_dev is the device used for hd install + my ($fstab, $prefix) = @_; log::l("mounting all filesystems"); - $hd_dev ||= cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/hdimage| unless $::isStandalone; - #- order mount by alphabetical ordre, that way / < /home < /home/httpd... foreach (sort { $a->{mntpoint} cmp $b->{mntpoint} } grep { $_->{mntpoint} } @$fstab) { - if ($hd_dev && $_->{device} eq $hd_dev) { - my $dir = "$prefix$_->{mntpoint}"; - $dir =~ s|/+$||; - log::l("special hd case ($dir)"); - rmdir $dir; - symlink "/tmp/hdimage", $dir; - } else { - mount_part($_, $prefix); - } + mount_part($_, $prefix); } } diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 52fa053ca..b692650f0 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -298,8 +298,12 @@ sub selectInstallClass { sub partitionDisks { return install_any::searchAndMount4Upgrade($o) if $o->{isUpgrade}; - ($o->{hd_dev}) = cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/hdimage|; - + my $stage1_hd; + if (cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/hdimage\s+(\S+)|) { + $stage1_hd = { dev => $1, fs => $2 }; + install_any::getFile("XXX"); #- close still opened filehandle + fs::umount("/tmp/hdimage"); + } $::o->{steps}{formatPartitions}{done} = 0; eval { fs::umount_all($o->{fstab}, $o->{prefix}) } if $o->{fstab} && !$::testing; @@ -320,6 +324,8 @@ sub partitionDisks { unless ($::testing) { $o->rebootNeeded foreach grep { $_->{rebootNeeded} } @{$o->{hds}}; } + fs::mount($stage1_hd->{dev}, "/tmp/hdimage", $stage1_hd->{fs}) if $stage1_hd; + $o->{fstab} = [ fsedit::get_fstab(@{$o->{hds}}, $o->{raid}) ]; fsedit::get_root($o->{fstab}) or die _("You must have a root partition. @@ -421,6 +427,7 @@ sub miscellaneous { #------------------------------------------------------------------------------ sub configureNetwork { #- get current configuration of network device. + log::l("debugging: $o->{netc}{HOSTNAME}"); eval { $o->{netc} ||= {}; $o->{intf} ||= []; add2hash($o->{netc}, network::read_conf("$o->{prefix}/etc/sysconfig/network")) if -r "$o->{prefix}/etc/sysconfig/network"; @@ -670,7 +677,7 @@ sub main { $::o = $o = $o_; #- get stage1 network configuration if any. - $o->{netc} = network::read_conf("/tmp/network"); + $o->{netc} ||= network::read_conf("/tmp/network"); if (my ($file) = glob_('/tmp/ifcfg-*')) { log::l("found network config file $file"); my $l = network::read_interface_conf($file); diff --git a/perl-install/install_steps_auto_install.pm b/perl-install/install_steps_auto_install.pm index 83c19c007..71aac7080 100644 --- a/perl-install/install_steps_auto_install.pm +++ b/perl-install/install_steps_auto_install.pm @@ -28,6 +28,12 @@ sub new { } } +sub configureNetwork { + my ($o) = @_; + modules::load_thiskind('net', sub {}, $o->{pcmcia}); + install_steps::configureNetwork($o); +} + sub enteringStep($$$) { my ($o, $step) = @_; print _("Entering step `%s'\n", translate($o->{steps}{$step}{text})); diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index a7dd7621b..c4751a9d9 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -767,9 +767,10 @@ sub create_steps_window { $pixmap->signal_connect(enter_notify_event => sub { print "HERE\n" }); if ($step->{reachable}) { - gtksignal_connect(gtkadd(new Gtk::Button, $b), - clicked => sub { die "setstep $step_name\n" }); - } else { $b } + my $button = new Gtk::Button + $button->set_relief('none'); + gtksignal_connect(gtkadd($button, $b), clicked => sub { die "setstep $step_name\n" }); + $button; } grep { !eval $o->{steps}{$_}{hidden}; } @{$o->{orderedSteps}}), @@ -777,7 +778,7 @@ sub create_steps_window { my $t = $_; my $w = new Gtk::Button(''); $w->set_name($t); -# $w->set_usize(0, 7); + $w->set_usize(0, 7); gtksignal_connect($w, clicked => sub { $::setstep or return; #- just as setstep s install_theme($o, $t); die "theme_changed\n" diff --git a/perl-install/mouse.pm b/perl-install/mouse.pm index 1f9183462..5acd6dcd3 100644 --- a/perl-install/mouse.pm +++ b/perl-install/mouse.pm @@ -58,6 +58,7 @@ arch() =~ /^sparc/ ? ( [ 2, "ttyS", "Microsoft", "Microsoft", __("Generic Mouse (serial)") ], [ 2, "ttyS", "Microsoft", "Microsoft", __("Microsoft compatible (serial)") ], [ 3, "ttyS", "Microsoft", "Microsoft", __("Generic 3 Button Mouse (serial)") ], + [ 3, "ttyS", "Microsoft", "ThinkingMouse", __("Kensington Thinking Mouse (serial)") ], [ 2, "ttyS", "MouseSystems", "MouseSystems", __("Mouse Systems (serial)") ], ); map_index { @@ -75,6 +76,10 @@ sub name2mouse { die "$name not found"; } +sub X2nbuttons { + first(map { $_->{nbuttons} } grep { $_->{XMOUSETYPE} eq $_[0] } @mouses); +} + sub serial_ports_names() { map { "ttyS" . ($_ - 1) . " / COM$_" } 1..4; } @@ -92,7 +97,7 @@ sub read($) { sub write($;$) { my ($prefix, $mouse) = @_; - local $mouse->{FULLNAME} = qq("$mouse->{FULLNAME}"); + local $mouse->{FULLNAME} = qq("$mouse->{FULLNAME}"); #-" local $mouse->{WHEEL} = bool2yesno($mouse->{nbuttons} > 3); setVarsInSh("$prefix/etc/sysconfig/mouse", $mouse, qw(MOUSETYPE XMOUSETYPE FULLNAME XEMU3 WHEEL device)); symlinkf $mouse->{device}, "$prefix/dev/mouse" or log::l("creating $prefix/dev/mouse symlink failed"); diff --git a/perl-install/network.pm b/perl-install/network.pm index ac0610c21..7c5ca5056 100644 --- a/perl-install/network.pm +++ b/perl-install/network.pm @@ -19,7 +19,7 @@ use log; sub read_conf { my ($file) = @_; my %netc = getVarsFromSh($file); - $netc{dnsServer} = $netc{NS0}; + $netc{dnsServer} = delete $netc{NS0}; \%netc; } diff --git a/perl-install/standalone/mousedrake b/perl-install/standalone/mousedrake index ee5c72d54..d40bcff62 100755 --- a/perl-install/standalone/mousedrake +++ b/perl-install/standalone/mousedrake @@ -44,14 +44,14 @@ modules::write_conf('') if $mouse->{device} eq "usbmouse" && !$::testing; my $f = "/etc/X11/XF86Config"; my $g = "/etc/X11/XF86Config-4"; + +my $zaxis = "\n ZAxisMapping 4 5" if $mouse->{nbuttons} > 3; + $zaxis .= "\n ZAxisMapping 6 7" if $mouse->{nbuttons} > 5; substInFile { if (/^Section "Pointer"/ .. /^EndSection/) { + $_ = '' if /ZAxisMapping/; #- remove existing line s|^(\s*Protocol\s+).*|$1"$mouse->{XMOUSETYPE}"|; - s|^(\s*Device\s+).*|$1"/dev/mouse"|; -#- my $zaxis = "4 5" if $mouse->{nbuttons} > 3; -#- $zaxis .= " 6 7" if $mouse->{nbuttons} > 5; -#- s|^(\s*ZAxisMapping\s+).*|$1$zaxis| if $zaxis; -#- s|^([#]\s*ZAxisMapping\s+).*|# ZAxisMapping\t\n|; } + s|^(\s*Device\s+).*|$1"/dev/mouse"$zaxis|; } } $f if -e $f && !$::testing; substInFile { -- cgit v1.2.1