From 0c928ac011478e29c10950a8f21e4bd7140e2a63 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Fri, 1 Sep 2000 12:36:09 +0000 Subject: *** empty log message *** --- perl-install/ChangeLog | 10 ++++++++ perl-install/Xconfigurator.pm | 40 +++++++++++++++---------------- perl-install/install_steps.pm | 19 ++++++++++----- perl-install/install_steps_interactive.pm | 4 +++- perl-install/network.pm | 2 +- perl-install/printer.pm | 7 +++--- perl-install/printerdrake.pm | 2 +- perl-install/standalone/printerdrake | 9 +++---- 8 files changed, 57 insertions(+), 36 deletions(-) diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog index 2cd256f53..974ed80da 100644 --- a/perl-install/ChangeLog +++ b/perl-install/ChangeLog @@ -1,3 +1,13 @@ +2000-09-01 François Pons + + * Xconfigurator.pm: fixes to configure XF86Config-4 when XFree-3.3 + is installed, make 16bits by default on 3D hardware acceleration, + fixed selection of hardware for hardware acceleration. + * install_steps.pm: add cups for printer configuration, used for + auto_install. added new function to add packages only if requires + are already satisfied. + * standalone/printerdrake: updated. + 2000-08-31 dam's * moved many things to network.pm and any.pm diff --git a/perl-install/Xconfigurator.pm b/perl-install/Xconfigurator.pm index 30c8cdedf..ebabc5830 100644 --- a/perl-install/Xconfigurator.pm +++ b/perl-install/Xconfigurator.pm @@ -183,20 +183,21 @@ sub cardConfiguration(;$$$) { add2hash($card, { vendor => "Unknown", board => "Unknown" }); #- 3D acceleration configuration for XFree 3.3 using Utah-GLX. - $card->{Utah_glx} = ($card->{identifier} =~ /MGA G[24]00/ || + $card->{Utah_glx} = ($card->{identifier} =~ /MGA G[24]00/ || #- 8bpp does not work. $card->{identifier} =~ /3D Rage Pro AGP/ || #- by default only such card are supported, with AGP ? - $card->{type} =~ /RIVA TNT/ || + $card->{type} =~ /RIVA TNT/ || $card->{type} =~ /RIVA128/ || $card->{type} =~ /GeForce 256/ || #- $card->{type} =~ /SiS / || #- EXPERIMENTAL - #- $card->{type} =~ /S3 ViRGE/ || #- EXPERIMENTAL + #- $card->{type} =~ /S3 ViRGE/ || #- EXPERIMENTAL, 15bits only (!). + #- $card->{type} =~ /S3 Savage3D/ || #- EXPERIMENTAL, use no_pixmap_cache, 16bit only. $card->{type} =~ /Intel 810/); #- 3D acceleration configuration for XFree 4.0 using DRI. - $card->{DRI_glx} = ($card->{type} =~ /Voodoo3 / || $card->{type} =~ /Voodoo Banshee / || - $card->{identified} =~ /MGA G[24]00/ || - $card->{type} =~ /Intel 810/ || - $card->{type} =~ /ATI Rage 128/); + $card->{DRI_glx} = ($card->{identifier} =~ /Voodoo [35]/ || #- 16bit only #- NOT YET $card->{identifier} =~ /Voodoo Banshee/ || + $card->{identifier} =~ /MGA G[24]00/ || #- prefer 16bit (24bit not well tested according to DRI) + $card->{type} =~ /Intel 810/ || #- 16bit + $card->{type} =~ /ATI Rage 128/); #- 16 and 32 bits, prefer 16bit as no DMA. #- check to use XFree 4.0 or XFree 3.3. - !$::force_xf3 && $card->{driver} && !$card->{flags}{unsupported} or $card->{driver} = ''; #- disable XFree 4.0 + $card->{use_xf4} = !$::force_xf3 && $card->{driver} && !$card->{flags}{unsupported}; #- ask the expert user if he want 3D acceleration. if ($::expert && ($card->{Utah_glx} || $card->{DRI_glx})) { @@ -206,19 +207,19 @@ sub cardConfiguration(;$$$) { #- try to figure if 3D acceleration is supported #- by XFree 3.3 but not XFree 4.0 then ask user to keep XFree 3.3 ? - if ($card->{driver} && $card->{Utah_glx} && !$card->{DRI_glx}) { + if ($card->{use_xf4} && $card->{Utah_glx} && !$card->{DRI_glx}) { $::beginner || $in->ask_yesorno('', _("Your card can have 3D acceleration but only with XFree 3.3. -Do You want to use XFree 3.3 instead of XFree 4.0?"), 1) and $card->{driver} = ''; +Do You want to use XFree 3.3 instead of XFree 4.0?"), 1) and $card->{use_xf4} = ''; } - $card->{prog} = "/usr/X11R6/bin/" . ($card->{driver} ? 'XFree86' : $card->{server} =~ /Sun (.*)/x ? + $card->{prog} = "/usr/X11R6/bin/" . ($card->{use_xf4} ? 'XFree86' : $card->{server} =~ /Sun (.*)/x ? "Xsun$1" : "XF86_$card->{server}"); -x "$prefix$card->{prog}" or $install && do { $in->suspend if ref($in) =~ /newt/; - &$install($card->{server}, $card->{Utah_glx} ? 'Mesa' : ()) if !$card->{driver}; - &$install('server') if $card->{driver}; #- add XFree86-libs-DRI here if using DRI (future split of XFree86 TODO) + &$install($card->{server}, $card->{Utah_glx} ? 'Mesa' : ()) if !$card->{use_xf4}; + &$install('server') if $card->{use_xf4}; #- add XFree86-libs-DRI here if using DRI (future split of XFree86 TODO) $in->resume if ref($in) =~ /newt/; }; -x "$prefix$card->{prog}" or die "server $card->{server} is not available (should be in $prefix$card->{prog})"; @@ -252,7 +253,7 @@ Do You want to use XFree 3.3 instead of XFree 4.0?"), 1) and $card->{driver} = ' if (!$::isStandalone && $card->{driver} eq "i810") { require modules; - modules::load("agpgart"); eval { modules::load("i810"); }; + modules::load("agpgart"); }; } $card; } @@ -313,7 +314,7 @@ sub testConfig($) { unlink "/tmp/.X9-lock"; #- restart_xfs; - my $f = $tmpconfig . ($o->{card}{driver} && "-4"); + my $f = $tmpconfig . ($o->{card}{use_xf4} && "-4"); local *F; open F, "$prefix$o->{card}{prog} :9 -probeonly -pn -xf86config $f 2>&1 |"; foreach () { @@ -350,7 +351,7 @@ sub testFinalConfig($;$$) { #- needed for bad cards not restoring cleanly framebuffer my $bad_card = $o->{card}{identifier} =~ /i740|ViRGE/; $bad_card ||= $o->{card}{identifier} eq "ATI|3D Rage P/M Mobility AGP 2x"; - $bad_card ||= $o->{card}{driver}; #- TODO obsoleted to check, when using fbdev of XFree 4.0! + $bad_card ||= $o->{card}{use_xf4}; #- TODO obsoleted to check, when using fbdev of XFree 4.0! log::l("the graphic card does not like X in framebuffer") if $bad_card; my $mesg = _("Do you want to test the configuration?"); @@ -380,7 +381,7 @@ sub testFinalConfig($;$$) { open STDERR, ">$f_err"; chroot $prefix if $prefix; exec $o->{card}{prog}, - ($o->{card}{prog} !~ /Xsun/ ? ("-xf86config", ($::testing ? $tmpconfig : $f) . ($o->{card}{driver} && "-4")) : ()), + ($o->{card}{prog} !~ /Xsun/ ? ("-xf86config", ($::testing ? $tmpconfig : $f) . ($o->{card}{use_xf4} && "-4")) : ()), ":9" or c::_exit(0); } @@ -473,9 +474,8 @@ sub autoDefaultDepth($$) { my ($card, $wres_wanted) = @_; my ($best, $depth); - return 24 if $card->{identifier} =~ /SiS/; - - return 16 if $card->{type} =~ /Voodoo (?!5)/x; + return 24 if $card->{identifier} =~ /SiS/; #- assume 24 bit event for 3D acceleration (not enabled currently). + return 16 if $card->{Utah_glx} || $card->{DRI_glx}; #- assume 16bit as most of them need 16. for ($card->{server}) { /FBDev/ and return 16; #- this should work by default, FBDev is allowed only if install currently uses it at 16bpp. diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index e21957845..2d1cd8aa1 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -521,16 +521,23 @@ sub configureServices { #------------------------------------------------------------------------------ sub configurePrinter { my($o) = @_; - if ($o->{printer}{configured}) { - require pkgs; - pkgs::selectPackage($o->{packages}, pkgs::packageByName($o->{packages}, 'rhs-printfilters')); - $o->installPackages($o->{packages}); + my ($use_cups, $use_lpr) = (0, 0); + foreach (values %{$o->{printer}{configured} || {}}) { + for ($_->{mode}) { + /cups/ and $use_cups++; + /lpr/ and $use_lpr++; + } + } + #- if at least one queue is configured, configure it. + if ($use_cups || $use_lpr) { + $o->pkg_install(($use_cups ? ('cups-drivers') : ()), ($use_lpr ? ('rhs-printfilters') : ())); require printer; eval { add2hash($o->{printer}, printer::getinfo($o->{prefix})) }; #- get existing configuration. - printer::read_printer_db(); #- load printer db, else configuration will fails. + $use_cups and printer::poll_ppd_base(); + $use_lpr and printer::read_printer_db(); foreach (keys %{$o->{printer}{configured} || {}}) { - log::l("configuring printer queue $_->{queue}"); + log::l("configuring printer queue $_->{queue} for $_->{mode}"); printer::copy_printer_params($_, $o->{printer}); #- setup all configured queues, which is not the case interactively where #- only the working queue is setup on configuration. diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 09ed55085..2ed1858c1 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -578,7 +578,9 @@ sub configurePrinter { } $o->{printer}{PAPERSIZE} = $o->{lang} eq 'en' ? 'letter' : 'a4'; - printerdrake::main($o->{printer}, $o, sub { $o->pkg_install($_[0]) }, sub { install_interactive::upNetwork($o, 'pppAvoided') }); + printerdrake::main($o->{printer}, $o, sub { $o->pkg_install(@_) }, sub { install_interactive::upNetwork($o, 'pppAvoided') }); + + $o->pkg_install_if_requires_satisfied('xpp', 'kups'); } #------------------------------------------------------------------------------ diff --git a/perl-install/network.pm b/perl-install/network.pm index 7b9558e44..d099ec309 100644 --- a/perl-install/network.pm +++ b/perl-install/network.pm @@ -117,7 +117,7 @@ sub add2hosts { local *F; if (-e $file) { open F, $file or die "cannot open $file: $!"; - /\s*(\S+)(.*)/ and $l{$1} = $2 foreach ; + /\s*(\S+)(.*)/ and $l{$1} ||= $2 foreach ; } log::l("writing host information to $file"); open F, ">$file" or die "cannot write $file: $!"; diff --git a/perl-install/printer.pm b/perl-install/printer.pm index ad6e46359..40c034282 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -129,6 +129,7 @@ sub read_configured_queue($) { if (/^##PRINTTOOL3##\s+$p\s+$p\s+$p\s+$p\s+$p\s+$p\s+$p(?:\s+$p)?/) { &$flush_current; $current = { + mode => 'lpr', TYPE => $1 || $2, GSDRIVER => $3 || $4, RESOLUTION => $5 || $6, @@ -238,8 +239,8 @@ sub read_configured_queue($) { } } - #- assume this printing system. - $printer->{mode} ||= 'lpr'; + #- assume this printing system, but only if some queue are defined. + scalar(keys %{$printer->{configured}}) > 0 and $printer->{mode} ||= 'lpr'; } sub read_printer_db(;$) { @@ -320,7 +321,7 @@ sub read_printers_conf { foreach () { chomp; /^\s*#/ and next; - if (/^\s*<(?:DefaultPrinter|Printer)\s+([^>]*)>/) { $current = { QUEUE => $1, } } + if (/^\s*<(?:DefaultPrinter|Printer)\s+([^>]*)>/) { $current = { mode => 'cups', QUEUE => $1, } } elsif (/\s*<\/Printer>/) { $current->{QUEUE} && $current->{DeviceURI} or next; #- minimal check of synthax. add2hash($printer->{configured}{$current->{QUEUE}} ||= {}, $current); $current = undef } elsif (/\s*(\S*)\s+(.*)/) { $current->{$1} = $2 } diff --git a/perl-install/printerdrake.pm b/perl-install/printerdrake.pm index cd8ee038b..f7bbb254a 100644 --- a/perl-install/printerdrake.pm +++ b/perl-install/printerdrake.pm @@ -346,7 +346,7 @@ You can add some more or change the existing ones."), #- switch according to what is being installed: cups, lpr or other. for ($printer->{mode}) { - /cups/ && do { &$install('cups') unless $::testing; + /cups/ && do { &$install('cups-drivers') unless $::testing; printer::poll_ppd_base(); last }; /lpr/ && do { &$install('rhs-printfilters') unless $::testing; printer::read_printer_db(); last }; diff --git a/perl-install/standalone/printerdrake b/perl-install/standalone/printerdrake index 4903e3bc4..14715e8e3 100755 --- a/perl-install/standalone/printerdrake +++ b/perl-install/standalone/printerdrake @@ -37,12 +37,13 @@ $::skiptest = /-skiptest/; $::testing = /-testing/; $::isStandalone = 1; -my $f = "/usr/lib/rhs/rhs-printfilters"; --e $f or system("urpmi --auto rhs-printfilters"); --e $f or die "install rhs-printfilters first!\n"; +my $printer; eval { $printer = printer::getinfo('') }; +/-lpr/ and $printer->{mode} = 'lpr'; +/-cups/ and $printer->{mode} = 'cups'; +$printer->{mode} ||= 'cups'; #- assume this default if nothing found. my $in = vnew interactive('su'); -printerdrake::main(eval { printer::getinfo('') } || {}, $in, sub { `urpmi --auto $_[0]` }); +printerdrake::main(eval { printer::getinfo('') } || {}, $in, sub { my $l = join(' ', @_); `urpmi --auto $l` }); $in->exit(0); -- cgit v1.2.1