summaryrefslogtreecommitdiffstats
ModeNameSize
-rw-r--r--.perl_checker277logstatsplain
-rw-r--r--ChangeLog1206398logstatsplain
-rw-r--r--MANIFEST10307logstatsplain
-rw-r--r--778logstatsplain
-rw-r--r--META.yml414logstatsplain
-rw-r--r--Makefile.PL5130logstatsplain
-rw-r--r--NEWS33884logstatsplain
-rwxr-xr-xgurpmi3645logstatsplain
-rw-r--r--gurpmi.pm4657logstatsplain
-rwxr-xr-xgurpmi212287logstatsplain
-rw-r--r--inst.list87logstatsplain
d---------po2311logstatsplain
d---------pod603logstatsplain
-rw-r--r--rpm-find-leaves1214logstatsplain
-rw-r--r--rurpme604logstatsplain
-rw-r--r--rurpmi640logstatsplain
-rw-r--r--skip.list134logstatsplain
d---------t2067logstatsplain
-rw-r--r--urpm.pm12571logstatsplain
d---------urpm1029logstatsplain
-rw-r--r--urpme5497logstatsplain
-rwxr-xr-xurpmf11501logstatsplain
-rwxr-xr-xurpmi26670logstatsplain
-rwxr-xr-xurpmi.addmedia7194logstatsplain
-rw-r--r--urpmi.bash-completion7341logstatsplain
-rw-r--r--urpmi.recover5973logstatsplain
-rwxr-xr-xurpmi.removemedia2542logstatsplain
-rw-r--r--urpmi.schema4309logstatsplain
-rwxr-xr-xurpmi.update4101logstatsplain
-rwxr-xr-xurpmq21327logstatsplain
>407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794
package install::steps_gtk; # $Id: steps_gtk.pm 266069 2010-02-09 19:47:35Z pterjan $

use diagnostics;
use strict;
use feature 'state';
use vars qw(@ISA);

@ISA = qw(install::steps_interactive interactive::gtk);

#-######################################################################################
#- misc imports
#-######################################################################################
use install::pkgs;
use install::steps_interactive;
use interactive::gtk;
use xf86misc::main;
use common;
use mygtk2;
use ugtk2 qw(:helpers :wrappers :create);
use devices;
use modules;
use install::gtk;
use install::any;
use mouse;
use install::help::help;
use log;

#-######################################################################################
#- In/Out Steps Functions
#-######################################################################################
sub new($$) {
    my ($type, $o) = @_;

    $ENV{DISPLAY} ||= $o->{display} || ":0";
    my $wanted_DISPLAY = $::testing && -x '/usr/bin/Xnest' ? ':9' : $ENV{DISPLAY};

    if (!$::local_install && 
	($::testing ? $ENV{DISPLAY} ne $wanted_DISPLAY : $ENV{DISPLAY} =~ /^:\d/)) { #- is the display local or distant?
        _setup_and_start_X($o, $wanted_DISPLAY);
    }

    $ENV{DISPLAY} = $wanted_DISPLAY;
    require detect_devices;
    if (detect_devices::is_xbox()) {
        modules::load('xpad');
        run_program::run('xset', 'm', '1/8', '1');
    }
    any::disable_x_screensaver();
    run_program::raw({ detach => 1 }, 'drakx-matchbox-window-manager');
    install::gtk::init_gtk($o);
    install::gtk::init_sizes($o);
    install::gtk::install_theme($o);
    install::gtk::create_steps_window($o);
    _may_configure_framebuffer_640x480($o);

    $ugtk2::grab = 1;

    $o = (bless {}, ref($type) || $type)->SUPER::new($o);
    $o->interactive::gtk::new;
    $o;
}

sub _setup_and_start_X {
    my ($o, $wanted_DISPLAY) = @_;
    my $f = "/tmp/Xconf";
    if (!$::testing) {
        devices::make("/dev/kbd");
    }

    #- /tmp is mostly tmpfs, but not fully, since it doesn't allow: mount --bind /tmp/.X11-unix /mnt/tmp/.X11-unix
    mkdir '/tmp/.X11-unix';
    run_program::run('mount', '-t', 'tmpfs', 'none', '/tmp/.X11-unix');


    my @servers = qw(Driver:fbdev Driver:vesa); #-)
    if ($::testing) {
        @servers = 'Xnest';
    } elsif (arch() =~ /ia64/) {
        require Xconfig::card;
        my ($card) = Xconfig::card::probe();
        @servers = map { if_($_, "Driver:$_") } $card && $card->{Driver}, 'fbdev';
    } elsif (arch() =~ /i.86/) {
        require Xconfig::card;
        my ($card) = Xconfig::card::probe();
        if ($card && $card->{card_name} eq 'i810') {
            # early i810 do not support VESA:
            log::l("graphical installer not supported on early i810");
            undef @servers;
        }
    }

    foreach (@servers) {
        log::l("Trying with server $_");
        my ($prog, $Driver) = /Driver:(.*)/ ? ('Xorg', $1) : /Xsun|Xnest|^X_move$/ ? $_ : "XF86_$_";
        if (/FB/i) {
            !$o->{vga16} && $o->{allowFB} or next;

            $o->{allowFB} = _launchX($o, $f, $prog, $Driver, $wanted_DISPLAY) #- keep in mind FB is used.
              and return;
        } else {
            $o->{vga16} = 1 if /VGA16/;
            _launchX($o, $f, $prog, $Driver, $wanted_DISPLAY) and return;
        }
    }
    return undef;
}

sub _launchX {
    my ($o, $f, $server, $Driver, $wanted_DISPLAY) = @_;

    mkdir '/var/log' if !-d '/var/log';

    my @options = $wanted_DISPLAY;
    if ($server eq 'Xnest') {
        push @options, '-ac', '-geometry', $o->{vga} || ($o->{vga16} ? '640x480' : '800x600');
    } else {
        install::gtk::createXconf($f, @{$o->{mouse}}{'Protocol', 'device'}, $o->{mouse}{wacom}[0], $Driver);

        push @options, '-allowMouseOpenFail', '-xf86config', $f if arch() !~ /^sparc/;
        push @options, 'vt7', '-dpi', '75';
        push @options, '-nolisten', 'tcp';

        #- old weird servers: Xsun
        push @options, '-fp', '/usr/share/fonts:unscaled' if $server =~ /Xsun/;
    }

    if (!fork()) {
        c::setsid();
        exec $server, @options or c::_exit(1);
    }

    #- wait for the server to start
    foreach (1..5) {
        sleep 1;
        last if fuzzy_pidofs(qr/\b$server\b/);
        log::l("$server still not running, trying again");
    }
    my $nb;
    my $start_time = time();
    foreach (1..60) {
        log::l("waiting for the server to start ($_ $nb)");
        log::l("Server died"), return 0 if !fuzzy_pidofs(qr/\b$server\b/);
        $nb++ if xf86misc::main::Xtest($wanted_DISPLAY);
        if ($nb > 2) {         #- one succeeded test is not enough :-(
            log::l("AFAIK X server is up");
            return 1;
        }
        time() - $start_time < 60 or last;
        time() - $start_time > 8 and print N("Xorg server is slow to start. Please wait..."), "\n";
        sleep 1;
    }
    log::l("Timeout!!");
    0;
}

#- if we success to start X in 640x480 using driver "vesa", 
#- we configure to use fb on installed system (to ensure splashy works)
#- (useful on 800x480 netbooks)
sub _may_configure_framebuffer_640x480 {
    my ($o) = @_;

    if ($::rootwidth == 640 && !$o->{allowFB}) {
	$o->{vga} = 785;
	$o->{allowFB} = 1;
    }
}

sub enteringStep {
    my ($o, $step) = @_;

    printf "Entering step `%s'\n", common::remove_translate_context($o->{steps}{$step}{text});
    if (my $banner_title = $o->{steps}{$step}{banner_title}) {
        set_default_step_items($banner_title);
    }
    $o->SUPER::enteringStep($step);
    install::gtk::update_steps_position($o);
}
sub leavingStep {
    my ($o, $step) = @_;
    $o->SUPER::leavingStep($step);
}


sub charsetChanged {
    my ($o) = @_;
    Gtk2->set_locale;
    install::gtk::load_font($o);
    install::gtk::create_steps_window($o);
}


sub interactive_help_has_id {
    my ($_o, $id) = @_;
    exists $install::help::help::{$id};
}

sub interactive_help_get_id {
    my ($_o, @l) = @_;
    @l = map { 
	join("\n\n", map { s/\n/ /mg; $_ } split("\n\n", translate($install::help::help::{$_}->())));
    } grep { exists $install::help::help::{$_} } @l;
    join("\n\n\n", @l);
}

#-######################################################################################
#- Steps Functions
#-######################################################################################
sub selectLanguage {
    my ($o) = @_;
    $o->SUPER::selectLanguage;
  
    $o->ask_warn('',
formatAlaTeX(N("Your system is low on resources. You may have some problem installing
%s. If that occurs, you can try a text install instead. For this,
press `F1' when booting on CDROM, then enter `text'.", N("Mageia")))) if availableRamMB() < 70; # 70MB

}

#------------------------------------------------------------------------------
sub selectMouse {
    my ($o, $force) = @_;
    my %old = %{$o->{mouse}};
    $o->SUPER::selectMouse($force) or return;
    my $mouse = $o->{mouse};
    $mouse->{type} eq 'none' ||
      $old{type}   eq $mouse->{type}   && 
      $old{name}   eq $mouse->{name}   &&
      $old{device} eq $mouse->{device} and return;

    while (1) {
	my $x_protocol_changed = mouse::change_mouse_live($mouse, \%old);
	mouse::test_mouse_install($mouse, $x_protocol_changed) and return;

	%old = %$mouse;
	$o->SUPER::selectMouse;
	$mouse = $o->{mouse};
    } 
}

sub reallyChooseDesktop {
    my ($o, $title, $message, $choices, $choice) = @_;

    my $w = ugtk2->new($title);

    my %tips = (
        KDE    => N("Install %s KDE Desktop", N("Mageia")),
        GNOME  => N("Install %s GNOME Desktop", N("Mageia")),
        Custom => N("Custom install"),
    );
    my $prev;
    my @l = map {
	my $val = $_;
	$prev = gtknew('RadioButton', child =>
                          gtknew('Label', text => $val->[1]),
                       tip => $tips{$val->[0]},
		       toggled => sub { $choice = $val if $_[0]->get_active },
                       active => $choice == $val,
		       $prev ? (group => $prev->get_group) : ());
	$prev->signal_connect(key_press_event => sub {
				  my (undef, $event) = @_;
				  if (!$event || ($event->keyval & 0x7f) == 0xd) {
				      Gtk2->main_quit;
				  }
			      });
        my $img = gtksignal_connect(
            gtkadd(Gtk2::EventBox->new, gtknew('Image', file => "desktop-$val->[0]")),
            'button-press-event' => sub {
                my %title = (
                    KDE    => N("KDE Desktop"),
                    GNOME  => N("GNOME Desktop"),
                    Custom => N("Custom Desktop"),
                );

                my $wp = ugtk2->new($title{$val->[0]}, transient => $w->{real_window}, modal => 1);
                gtkadd($wp->{rwindow},
                       gtkpack_(Gtk2::VBox->new,
                                0, gtknew('Title2', label => N("Here's a preview of the '%s' desktop.", $val->[1]),
                                          # workaround infamous 6 years old gnome bug #101968:
                                          width => mygtk2::get_label_width(), 
                                      ),
                                1, gtknew('Image', file => "desktop-$val->[0]-big"),
                                0, Gtk2::HSeparator->new,
                                0, gtkpack(create_hbox('end'),
                                           gtknew('Button', text => N("Close"), clicked => sub { Gtk2->main_quit })
                                       ),
                            ),
                   );
                $wp->{real_window}->set_size_request(-1, -1);
                $wp->{real_window}->grab_focus;
                $wp->{real_window}->show_all;
                $wp->main;
            });
        gtknew('VBox', border_width => 15, spacing => 10, children_tight => [ 
            $img,
            $prev,
        ]);
    } @$choices;

    ugtk2::gtkadd($w->{window},
	   gtknew('VBox', children => [
		    0, gtknew('Title2',
                              # workaround infamous 6 years old gnome bug #101968:
                              width => mygtk2::get_label_width(), label => $message . ' ' .