summaryrefslogtreecommitdiffstats
path: root/mdkapplet
blob: 80aee53910fae457c6229a757053030c9145540b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
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
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
#!/usr/bin/perl
################################################################################
# Mandriva Online                                                              # 
#                                                                              #
# Copyright (C) 2003-2010 Mandriva                                             #
#                                                                              #
# Daouda Lo                                                                    #
# Thierry Vignaud <tvignaud at mandriva dot com>                               #
#                                                                              #
# This program is free software; you can redistribute it and/or modify         #
# it under the terms of the GNU General Public License Version 2 as            #
# published by the Free Software Foundation.                                   #
#                                                                              #
# This program is distributed in the hope that it will be useful,              #
# but WITHOUT ANY WARRANTY; without even the implied warranty of               #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                #
# GNU General Public License for more details.                                 #
#                                                                              #
# You should have received a copy of the GNU General Public License            #
# along with this program; if not, write to the Free Software                  #
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.   #
################################################################################

use strict;
use POSIX ":sys_wait_h";
use lib qw(/usr/lib/libDrakX);
use standalone; # for explanations
use common;
use run_program;

BEGIN { unshift @::textdomains, 'mdkonline' }

use mygtk2 qw(gtknew); #- do not import gtkadd which conflicts with ugtk2 version
use ugtk2 qw(:all);
use lib qw(/usr/lib/libDrakX/drakfirsttime);
use mdkonline;
use mdkapplet_gui;
use Gtk2::Notify '-init', 'mdkapplet';
use Rpmdrake::open_db;

if (!find { $_ eq '--auto-update' } @ARGV) {
    if (my $pid = mdkonline::is_running('mdkapplet')) {
        if ($::testing) {
            warn "mdkapplet already running ($pid)\n";
        } else {
            die "mdkapplet already running ($pid)\n";
        }
    }
}


my $online_site = "http://www.mandrivalinux.com/";
my ($menu, $timeout, $network_timeout, $state_global, $sub_state);

read_config();
$config{UPDATE_FREQUENCY} ||= 3*60*60; # default to 3hours
if ($::testing) {
    $config{FIRST_CHECK_DELAY} =  1 * 1000; # 1 second
} else {
    $config{FIRST_CHECK_DELAY} ||= 5 * 60 * 1000; # default to 5 minutes
}
$config{DISTRO_CHECK_DELAY} ||= 60*60*24; # default : one day

my %state = (
	     delayed => {
		      colour => [ 'busy' ],
		      menu => [ 'check' ],
 		      do_not_use_bubble => 1,
		      tt => [
                    #-PO: here %s will be replaced by the local time (eg: "Will check updates at 14:03:50"
                    N("Will check updates at %s", POSIX::strftime("%T", localtime(time() + $config{FIRST_CHECK_DELAY}/1000)))
                ],
		     },
    
	     okay => {
		      colour => [ 'okay' ],
		      menu => [ 'check' ],
 		      do_not_use_bubble => 1,
		      tt => [ N_("Your system is up-to-date") ]
		     },
 	     critical => {
		      colour => [ 'noconf' ],
		      menu => [ 'check' ],
		      tt => [ N_("Service configuration problem. Please check logs and send mail to support\@mandrivaonline.com") ]
		     },
	     busy => {
		      colour => [ 'busy' ], 
		      menu => [],
 		      do_not_use_bubble => 1,
		      tt => [ N_("Please wait, finding available packages...") ]
		     },
	     updates => {
		      colour => [ 'error' ],
		      menu => [ 'update', 'check' ],
		      tt => [ N_("New updates are available for your system") ]
		     },
             new_distribution => {
                 colour => [ 'bundle' ],
                 menu => [ 'upgrade_distro', 'check' ],
                 urgency => 'low',
                 tt => [ N("A new version of Mandriva Linux distribution has been released") ]
             },
             no_more_supported => {
                 colour => [ 'disabled' ],
                 menu => [ 'upgrade_distro', 'check' ],
                 urgency => 'low',
                 tt => []
             },
             unconfigured_restricted_media => {
                 colour => [ 'bundle' ],
                 menu => [ 'add_restricted_media', 'check' ],
                 urgency => 'low',
                 tt => [ N("An additional package medium is available for your distribution.") ]
             },
	     disconnected => {
		      colour => [ 'disconnect' ],
		      menu => [ 'confNetwork' ],
		      tt => [ N_("Network is down. Please configure your network") ],
 		      do_not_use_bubble => mdkonline::is_running('net_applet'),
		     },
	     disabled => {
		      colour => [ 'disabled' ],
		      menu => [],
		      tt => [ N_("Service is not activated. Please click on \"Online Website\"") ]
		     },
          locked => {
		      colour => [ 'noconf' ],
		      menu => [ 'check' ],
                tt => [ N_("urpmi database locked") ],
 		      do_not_use_bubble => 1,
          },
          loop_locked => {
		      colour => [ 'noconf' ],
		      menu => [ 'check' ],
                tt => [ N_("urpmi database locked") ],
          },
	     notsupported => {
		      colour => [ 'disabled' ],
		      menu => [],
		      tt => [ N_("Release not supported (too old release, or development release)") ]
		     },
          no_update_medium => {
		      colour => [ 'noconf' ],
		      menu => [ 'check' ],
                tt => [ N_("No medium found. You must add some media through 'Software Media Manager'.") ],
          },
          no_enterprise_update_medium => {
		      colour => [ 'noconf' ],
		      menu => [ 'add_enterprise_update_medium' , 'check' ],
		      tt => [ N("An additional package medium is available for your distribution.") ]
          },
          no_enabled_medium => {
		      colour => [ 'noconf' ],
		      menu => [ 'check' ],
                tt => [ N("You already have at least one update medium configured, but
all of them are currently disabled. You should run the Software
Media Manager to enable at least one (check it in the \"%s\"
column).

Then, restart \"%s\".", N("Enabled"), 'mdkapplet') ],
          },
	    );

my %comm_codes = (
    locked => {
        code => 2,
        status => 'locked',
        log => "urpmi database locked, skipping updating urpmi database",
    },
    error_updating => {
        code => 3,
        status => 'critical',
        log => N_("Error updating media"),
    },
    no_update_medium => {
        code => 4,
        status => 'no_update_medium',
        log => "no update media configured",
    },
    no_enabled_medium => {
        code => 5,
        status => 'no_enabled_medium',
        log => "all update media are disabled",
    },
    updates => {
        code => 6,
        status => 'updates',
        log => "Checking... Updates are available\n\n",
    },
    uptodate => {
        code => 7,
        status => 'okay',
        log => "Packages are up to date\n",
    },
    db_not_open => {
        code => 8,
        status => 'critical',
        log => "Failed to open urpmi database\n",
    },
    unconfigured_restricted_media => {
        code => 9,
        status => 'unconfigured_restricted_media',
        log => "Missing restricted media\n",
    },
    no_enterprise_update_medium => {
        code => 10,
        status => 'no_enterprise_update_medium',
        log => "Missing enterprise update media\n",
    },
);

my %actions = (
	       'update' => { name => N("Install updates"), launch => sub { installUpdates() } },
	       'add_restricted_media' => { name => N("Add additional package medium"), launch => \&prepare_add_restricted },
	       'add_enterprise_update_medium' => { name => N("Add additional package medium"), launch => \&prepare_add_enterprise_update_media },
	       'check' => { name => N("Check Updates"), launch => \&checkUpdates },
	       'confNetwork' => { name => N("Configure Network"), launch => sub { configNetwork() } },
	       'upgrade_distro' => { name => N("Upgrade the system"), launch => \&upgrade },
	      );

my $icon = Gtk2::StatusIcon->new;
#$icon->shape_combine_mask($img, 0, 0);
$icon->signal_connect(popup_menu => sub {
                          my ($_icon, $button, $time) = @_;
                          $menu and $menu->popup(undef, undef, undef, undef, $button, $time);
                      });
$icon->signal_connect(activate => sub {
                          my %actions = (
                              unconfigured_restricted_media => \&prepare_add_restricted,
                              no_update_medium => \&add_media,
                              no_enterprise_update_medium => \&prepare_add_enterprise_update_media,
                              no_enabled_medium => \&add_media,
                              updates => \&installUpdates,
                              new_distribution => \&upgrade,
                              no_more_supported => \&no_more_supported,
                          );
                          my $action = $state_global;
                          # default to updates rather than distro upgrade:
                          if ($action eq 'new_distribution' && $sub_state eq 'updates') {
                              $action = 'updates';
                          }

                          $actions{$action}->() if ref $actions{$action};
			  });
foreach my $opt (@ARGV) {
    if ($opt eq '--force' || $opt eq '-f') { setAutoStart('TRUE') }
    if ($opt =~ /--(rpm-root|urpmi-root)=(.*)/) {
        $::rpmdrake_options{$1}[0] = $2;
    }
}

my ($download_dir, $download_all);
{
    my $temp_urpm = Rpmdrake::open_db::fast_open_urpmi_db();
    $root = $temp_urpm->{root};
    $download_dir = $temp_urpm->{cachedir};
}

my ($new_distro, $no_more_supported, $extended_maintenance_url, $extended_maintenance_end);
get_product_id();

shouldStart() or die "$localfile should be set to TRUE: please use --force or -f option to launch applet\n";

go2State('delayed');

Glib::Timeout->add_seconds($config{FIRST_CHECK_DELAY}/1000, sub {
                       # schedule future checks:
                       setup_cyclic_check();
                       # perform a test after initial delay:
                       checkNetwork();
                       checkUpdates();
                       0;
                   });


$SIG{USR1} = 'IGNORE';
$SIG{USR2} = 'IGNORE';
$SIG{CHLD} = \&harvester;

run_program::raw({ detach => 1 }, 'ionice', '-p', $$, '-n7');


Gtk2->main;

ugtk2::exit(0);

sub is_there_a_new_distributions() {
    # sanity check for cooker:
    # (2008.0 wrongly reports 'Devel' instead of 'Official'):
    return if $product_id->{branch} eq 'Devel' && !is_it_2008_0();

    my @distros = get_distro_list();
    return if !@distros;

    # do not do anything if current distribution isn't listed on api.mdv.com:
    return if !member($product_id->{version}, map { $_->{version} } @distros);

    # only compare first distro: if it's not the same as the currently installed one,
    # then it's the most recent release:
    my $new_distribution = $distros[0];

    if (-e get_stale_upgrade_filename()) {
        $new_distro = $new_distribution;
        return 1;
    }

    my $current_apimdv_distro = find_current_distro(@distros);
    $no_more_supported = $current_apimdv_distro->{obsoleted_by};
    ($extended_maintenance_url, $extended_maintenance_end) = @$current_apimdv_distro{qw(extended-maintenance extended-maintenance-end)};
    refresh_no_more_supported_msg();
    if ($no_more_supported) {
        $new_distro = find { $_->{version} eq $no_more_supported } @distros;
        return;
    }

    if ($new_distribution && $new_distribution->{version} ne $product_id->{version}) {
        $new_distro = $new_distribution;
        log::explanations(sprintf("new '%s' distribution was released on %s", $new_distro->{version}, $new_distro->{release_date}));
        return 1;
    }
}


my ($mdv_update_pid, $checker_pid, $media_manager_pid, $locked_count);

# FIXME: flushing a hash would be less error prone when adding new stuff:
sub clean_distro_cache() {
    undef $new_distro;
    undef $no_more_supported;
    undef $extended_maintenance_url;
    undef $extended_maintenance_end;
 }

sub is_false {
    my ($s) = @_;
    !text2bool($s) && $s != 1;
}

# Signal management 
sub harvester {
    my ($_signame, $_clean) = @_;
    my ($childpid, @pids);
    my $schedule_checks;
    do {
        $childpid = waitpid(-1, &WNOHANG);
        my $status = $? >> 8;
        if ($mdv_update_pid && $mdv_update_pid == $childpid) {
            undef $mdv_update_pid;
            # make sure to not report new distro after distro upgrade:
            clean_distro_cache();
            $schedule_checks = 1;
        } elsif ($checker_pid && $checker_pid == $childpid) {
            undef $checker_pid;
            my ($state) = grep { $_->{code} eq $status } values %comm_codes;
            if ($state) {
                log::explanations($state->{log});
                $sub_state = $state->{status};
                if ($sub_state eq 'locked') {
                    $locked_count++;
                    $sub_state = 'loop_locked' if $locked_count > 10;
                } else {
                    $locked_count = 0;
                }
                # busy critical delayed disabled disconnected locked loop_locked new_distribution no_enabled_medium no_enterprise_update_medium no_more_supported no_update_medium notsupported okay unconfigured_restricted_media update
                if (!member($sub_state, qw(okay))) {
                    go2State($sub_state);
                } elsif ($no_more_supported) {
                    go2State('no_more_supported');
                } elsif ($new_distro && is_false($config{DO_NOT_ASK_FOR_DISTRO_UPGRADE})
                      && is_false($local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE})) {
                    go2State('new_distribution');
                } else {
                    go2State($sub_state);
                }
            }
        } elsif ($media_manager_pid && $media_manager_pid == $childpid) {
            undef $media_manager_pid;
            $schedule_checks = 1;
        }
        push @pids, $childpid;
    } while $childpid > 0;
    Glib::Timeout->add(200, sub { silentCheck(); 0 }) if $schedule_checks;
    return @pids;
}

sub configNetwork() {
    log::explanations(N_("Launching drakconnect\n"));
    fork_exec("/usr/sbin/drakconnect");
}

# only enable 'download all packages at once' on 2010.1 and further:
sub is_download_all_enabled() {
    # prevent crashing on 2008.1 and 2009.0:
    eval { is_it_a_devel_distro() } || !member($product_id->{version}, qw(2008.1 2009.0 2009.1));
}

sub confirm_upgrade() {
    local $mygtk2::left_padding = 0;
    my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE});
    my $w = new_portable_dialog(N("New version of Mandriva Linux distribution"));
    my ($temp_dir, $box);
    
    my $browse;
    $browse = gtksignal_connect(
        Gtk2::FileChooserButton->new(N("Browse"), 'select-folder'),
        'current-folder-changed' => sub {
            $temp_dir = $_[0]->get_current_folder;
        });
    $browse->set_current_folder($download_dir);

    my $res = fill_n_run_portable_dialog($w,
                                      [
               get_banner(),
               gtknew('Label_Left', text => N("A new version of Mandriva Linux distribution has been released."), @common),
               gtknew('HButtonBox', layout => 'start', children_tight => [
                   new_link_button($new_distro->{url}, N("More info about this new version")),
               ]),
               gtknew('Label_Left', text => N("Do you want to upgrade to the '\%s' distribution?", 
                                              $new_distro->{name} || $new_distro->{version}), @common),
               gtknew('CheckButton', text => N("Do not ask me next time"), active_ref => \$warn_me),
               if_(is_download_all_enabled(),
                   gtknew('CheckButton', text => N("Download all packages at once") . "\n" .
                            N("(Warning: You will need quite a lot of free space)"),
                          active_ref => \$download_all, sensitive_ref => \$browse,
                          toggled => sub { $box and $box->set_sensitive($download_all) },
                      ),
                   $box = gtknew('HBox', sensitive => $download_all,
                                 children => [
                                     0, gtknew('Label_Left', text => N("Where to download packages:")),
                                     1 , $browse,
                                 ]),
               ),
               create_okcancel($w, N("Next"), N("Cancel")),
                                      ]);

    setVar('DO_NOT_ASK_FOR_DISTRO_UPGRADE', bool2text($warn_me));
    $local_config{DO_NOT_ASK_FOR_DISTRO_UPGRADE} = bool2text($warn_me);
    if ($res) {
        $download_dir = $temp_dir;
        really_confirm_upgrade();
    } else {
        return 0;
    }
}


sub get_obsolete_message_() {
    N("This Mandriva Linux system maintenance has ended. It means it will not receive any new software update.");
}

sub get_obsolete_message() {
    join("\n\n",
         get_obsolete_message_(),
          N("In order to keep your system secure, you can:"),
     );
}
      
sub refresh_no_more_supported_msg() {
    my $basic_msg = get_obsolete_message_();
    my $distro = N("Mandriva Linux");
    my $msg;

    # is extended maintenance available?
    if (is_extmaint_supported()) {
        if ($no_more_supported eq 'none') {
            $msg = N("You should get extended maintenance.");
        } else {
            $msg = N("You should either get extended maintenance or upgrade to a newer version of the %s distribution.",
                 $distro);
        }
    } else {
        $msg = N("You should upgrade to a newer version of the %s distribution.", $distro);
    }
    $state{no_more_supported}{tt}[0] = join(' ', $basic_msg, $msg);
}

sub no_more_supported_choice() {
    local $mygtk2::left_padding = 0;
    my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_NO_MORE_SUPPORTED});
    # FIXME: just tell radio buttons' children to wrap instead:
    local $mdkapplet_gui::width = 580;
    my $w = new_portable_dialog(N("Your distribution is no longer supported"));
    my ($b1, $b2, $b3);
    my $choice = is_extmaint_supported() ? 'extended' : ($no_more_supported ne 'none' ? 'upgrade' : undef);

    my @widgets = (
        get_banner(),
        gtknew('Label_Left', 
               text => get_obsolete_message() . "\n", @common),
        if_(is_extmaint_supported(),
            $b1 = gtknew('RadioButton',
                         text => N("Purchase a maintenance extension for this version (%s) and keep it running until.", $product_id->{version}),
                         toggled => sub {
                             ($choice, $warn_me) = ('extended', undef) if $_[0]->get_active;
                         },

                     ),
            gtknew('HSeparator'),
        ),
        if_($no_more_supported ne 'none',
            $b2 = gtknew('RadioButton', child => gtknew('VButtonBox', layout => 'start', children_tight => [
                gtknew('Label_Left',
                       text => N("Do you want to upgrade to the '\%s' distribution?", 
                                 $new_distro->{name} || $new_distro->{version}), @common),
                new_link_button($new_distro->{url}, N("More info about this new version")),
            ]),
                         toggled => sub {
                             ($choice, $warn_me) = ('upgrade', undef) if $_[0]->get_active;
                         },
                         if_($b1, group => $b1)),
            gtknew('HSeparator'),
        ),
        $b3 = gtknew('RadioButton', text => N("Do not ask me next time"),
                     toggled => sub {
                         $choice = 'nothing' if $_[0]->get_active;
                         $warn_me = $_[0]->get_active },
                     group => $b1 || $b2),
        create_okcancel($w, N("Next"), N("Cancel")),
    );

    #$_ and $_->set_border_width(8) foreach $b1, $b2, $b3;

    # explicitely wrap too long message:
    $b1->child->set_line_wrap(1);

    my $res = fill_n_run_portable_dialog($w, \@widgets);

    setVar('DO_NOT_ASK_FOR_NO_MORE_SUPPORTED', bool2text($warn_me));
    $local_config{DO_NOT_ASK_FOR_NO_MORE_SUPPORTED} = bool2text($warn_me);
    if ($res) {
        return $choice;
    } else {
        return 0;
    }
}


sub no_more_supported() {
    return if $mdv_update_pid;
    my $choice = no_more_supported_choice();
    if ($choice eq 'upgrade') {
        really_confirm_upgrade() and real_upgrade();
    } elsif ($choice eq 'extended') {
        get_extended_maintenance();
    }
}


sub get_extended_maintenance() {
    $mdv_update_pid = fork_exec('mdkapplet-extended-maintenance-helper', $product_id->{version},
                                if_($download_all, "--download-all=$download_dir"),
                                if_($root, "--urpmi-root=$root"));
}


sub really_confirm_upgrade() {
    local $mygtk2::left_padding = 0;
    my $w = ugtk2->new(N("New version of Mandriva Linux distribution"), width => $width + 20);

    # estimated package size:
    my $c;
    foreach (run_program::get_stdout('rpm', '-qa', '--qf', '%{Archivesize}\n')) {
        $c += $_;
    }
    $c = formatXiB($c);

    {
        # use wizard button order (for both 2008.1 & 2009.0):
        local $::isWizard = 1;
        local $w->{pop_it} = 0;
        local $::isInstall = 1;
    gtkadd($w->{window},
           gtknew('VBox', children_tight => [
               get_banner(),
               gtknew('Label_Left', text => N("This upgrade requires high bandwidth network connection (cable, xDSL, ...)  and may take several hours to complete."),
                      @common),
               gtknew('Label_Left', text => N("Estimated download data will be %s", $c), @common),
               gtknew('Label_Left', text => N("You should close all other running applications before continuing.") .
                        (detect_devices::isLaptop() ?
                           ' ' .
                             N("You should put your laptop on AC and favor ethernet connection over wifi, if available.")
                               : ''),
                      @common),
               create_okcancel($w, N("Next"), N("Cancel")),
           ]),
       );
    }
    $w->{ok}->grab_focus;
    return $w->main;
}

sub upgrade() {
    return if $mdv_update_pid;
    return if !confirm_upgrade();
    real_upgrade();
}

sub real_upgrade() {
    $mdv_update_pid = fork_exec('mdkapplet-upgrade-helper', "--new_distro_version=$new_distro->{version}",
                                if_($download_all, "--download-all=$download_dir"),
                                if_($root, "--urpmi-root=$root"));
}

sub add_media() {
    return if $media_manager_pid;
    log::explanations("Launching 'Software Media Manager'");
    $media_manager_pid = fork_exec('/usr/sbin/edit-urpm-sources.pl', '--no-splash', if_($root, "--urpmi-root=$root"));
}

sub installUpdates() {
    return if $mdv_update_pid;
    log::explanations(N_("Launching MandrivaUpdate\n"));
    $mdv_update_pid = fork_exec('MandrivaUpdate', '--no-media-update', '--no-confirmation', '--no-splash',
                                if_($root, "--urpmi-root=$root"));
    silentCheck(); gtkflush();
}

sub checker_exit {
    my ($state) = @_;
    POSIX::_exit($comm_codes{$state}{code});
}

sub update_backport_media {
    my ($urpm) = @_;
    # update inactive backport media:
    my @inactive_backport_media = Rpmdrake::open_db::get_inactive_backport_media($urpm);
    return if !@inactive_backport_media;
    log::explanations("updating inactive backport media " . join(', ', @inactive_backport_media));
    foreach (@inactive_backport_media) {
        run_program::run('urpmi.update', if_($root, "--urpmi-root=$root"), $_);
    }
}

sub silentCheck() {
    my $check_time if 0;
    my $new_time = time();
    if (!$check_time || $new_time - $check_time > $config{DISTRO_CHECK_DELAY}) {
        clean_distro_cache();
        $check_time = $new_time;
        is_there_a_new_distributions();
    }

    return if $mdv_update_pid || $checker_pid;
    log::explanations(N_("Computing new updates...\n"));
    my $w = $::main_window ? $::main_window->window : undef;
    go2State('busy');

    # are there any updates ?

    $checker_pid = fork();
    if (defined $checker_pid) {
        return if $checker_pid; # parent

        # immediate exit, else forked gtk+ object destructors will badly catch up parent applet
        my $_safe = before_leaving {
            my $err = $@;
            log::explanations("mdkapplet check crashed: $err ");
            warn "Error: $err\n" . common::backtrace();
            POSIX::_exit(0);
        };

        # be nice with other processes:
        setpriority(0, $$, 7);  # 0 is PRIO_PROCESS

        my $will_not_update_media;
        require urpm;
        require urpm::lock;
        # so that get_inactive_backport_media() doesn't vivify $urpm->{media}:
        my $urpm = Rpmdrake::open_db::fast_open_urpmi_db();
        {
            local $urpm->{fatal} = sub {
                print "Fatal: @_\n";
                $will_not_update_media = 1;
            };
            local $urpm->{error} = $urpm->{fatal};

            urpm::lock::urpmi_db($urpm, 'exclusive', 1);
        }
        checker_exit('locked') if $will_not_update_media;

        # prevent crashing on 2008.1 and 2009.0:
        my $is_it_a_devel_distro = eval { is_it_a_devel_distro() };

        my $media = $is_it_a_devel_distro ? '-a' : '--update';
        if (!run_program::run('urpmi.update', $media, if_($root, "--urpmi-root=$root"))) {
            checker_exit('error_updating') if $will_not_update_media;
        }

        if (!is_it_2008_0()) {
            update_backport_media($urpm);
        }
        
        require urpm::select;
        require urpm::media;
        # this eats 52Mb of RAM on 64bit:
        # (hence we do it in the forked helper so that the applet doesn't eat too much RAM)
        urpm::media::configure($urpm, if_(!$is_it_a_devel_distro, update => 1));

        # prevent crashing on 2008.1 and 2009.0:
        my @update_medias = eval { get_update_medias($urpm) };
        if ($@) {
            @update_medias = grep { $_->{update} } @{$urpm->{media}};
        }

        if (!@update_medias) {
	    if (is_enterprise_media_supported()) {
		checker_exit('no_enterprise_update_medium');
	    } else {
		checker_exit('no_update_medium');
	    }
        } elsif (!any { ! $_->{ignore} } @update_medias) {
            checker_exit('no_enabled_medium');
        }

        if (my $_db = urpm::db_open_or_die($urpm)) {
            my $requested = {};
            my $state = {};
            my $need_restart = urpm::select::resolve_dependencies(
                $urpm, $state, $requested,
                callback_choices => sub { 0 },
                priority_upgrade => $urpm->{options}{'priority-upgrade'},
                auto_select => 1,
            );
            my @requested_strict = map { scalar $_->fullname } @{$urpm->{depslist}}[keys %{$state->{selected}}];

            if ($need_restart || @requested_strict) {
                # FIXME: log first found pkgs?
                warn ">> need_restart=$need_restart, updates=" . join(', ', @requested_strict) . "\n";
                checker_exit('updates');
            } else {
                if (!text2bool($local_config{DO_NOT_ASK_FOR_RESTRICTED})) {
                    if (is_restricted_media_configured($urpm)) {
                        checker_exit('uptodate');
                    } else {
                        checker_exit('unconfigured_restricted_media');
                    }
                } else {
                    checker_exit('uptodate');
                }
            }
        } else {
            checker_exit('db_not_open');
        }
        checker_exit('updates');
    } else {
        log::explanations("cannot fork: %s", "update checker ($!)");
        go2State('critical');
    }
}

sub okState() { log::explanations(N_("System is up-to-date\n")); go2State('okay') }


sub setup_cyclic_check() {
    $network_timeout = Glib::Timeout->add(2000, sub { checkNetwork(); 1 });
    $timeout = Glib::Timeout->add_seconds($config{UPDATE_FREQUENCY}, sub {
           checkUpdates();
           1;
       });
}

sub getTime() {
    my $d = localtime();
    $d =~ s/\s+/_/g;
    $d;
}

sub setLastTime() {
    my $date = getTime();
    setVar('LASTCHECK', $date);
}

sub has_network_connection_2008() {
    require network::network;
    require network::tools;
    my $net = {};
    network::network::read_net_conf($net);
    my ($_gw_intf, $_is_up, $gw_address, $_dns_server) = network::tools::get_internet_connection($net);
    to_bool($gw_address);
}

sub checkNetwork() {
    return if $checker_pid;
    require network::tools;
    # alternatively we could have used 2008.0's network::tools::connected()
    my $has_network = is_it_2008_0() ? has_network_connection_2008()
      : network::tools::has_network_connection();
    if (!$has_network) {
        # do not notify if already done:
        return if member($state_global, qw(disconnected));
	log::explanations(N_("Checking Network: seems disabled\n"));
	go2State('disconnected');
    } elsif (member($state_global, qw(disconnected))) {
	silentCheck(); #- state has changed, update
    }
}

sub checkUpdates() {
    member($state_global, qw(disconnected)) or silentCheck();
}

sub go2State {
    my ($state) = @_;
    $menu->destroy if $menu;
    $menu = setState($state);
    $state_global = $state;
    gtkflush();
}

sub shouldStart() {
    to_bool($local_config{AUTOSTART} ne 'FALSE');
}

sub about_dialog() {
    my $ver = 1;                # automatically set from spec file
    my $url = $online_site;
    $url =~ s/^https:/http:/;
    my $w = gtknew('AboutDialog', name => N("Mandriva Online %s", $ver),
                   copyright => N("Copyright (C) %s by Mandriva", '2001-2010'),
                   license => join('', cat_('/usr/share/common-licenses/GPL')),
                   icon => '/usr/share/icons/mini/mdkonline.png',
                   comments => N("Mandriva Online gives access to Mandriva web services."),
                   website => $url,
                   website_label => N("Online WebSite"),
                   authors => 'Thierry Vignaud <vignaud@mandriva.com>',
                   artists => 'Hélène Durosini',
                   translator_credits =>
                     #-PO: put here name(s) and email(s) of translator(s) (eg: "John Smith <jsmith@nowhere.com>")
                     N("_: Translator(s) name(s) & email(s)\n"),
                   transient_for => $::main_window, modal => 1, position_policy => 'center-on-parent',
               );

    $w->show_all;
    $w->run;
    return 1;
}

sub setState {
    my ($state) = @_;
    my $checkme;
    my $previous_state if 0;
    my @arr = @{$state{$state}{menu}};
    my $tmp = eval { gtkcreate_pixbuf($state{$state}{colour}[0]) };
    $icon->set_from_pixbuf($tmp) if $tmp;
    $icon->set_tooltip(formatAlaTeX(translate($state{$state}{tt}[0])));
    my @invisible_states = qw(delayed okay disconnected locked);
    $icon->set_visible(!member($state, @invisible_states));

    # do not show icon while checking if previously hidden:
    $icon->set_visible(0) if $state eq 'busy' && member($previous_state, @invisible_states);

    $previous_state = $state;

    gtkflush(); # so that bubbles are displayed on right icon

    if ($state{$state}{tt}[0] && $icon->isa('Gtk2::StatusIcon') && !$state{$state}{do_not_use_bubble}) {
        my $bubble = Gtk2::Notify->new_with_status_icon(N("Warning"), formatAlaTeX(translate($state{$state}{tt}[0])) . "\n",
                                                        '/usr/share/icons/mdkonline.png', $icon);
        if (member($state, qw(new_distribution no_more_supported))) {
            $bubble->add_action('clicked', N("More Information"), \&no_more_supported);
            if ($sub_state eq 'updates') {
                push @arr, 'update';
            }
        } elsif ($state eq 'updates') {
            unshift @arr, 'upgrade_distro' if $new_distro;
            $bubble->add_action('clicked', N("Install updates"), \&installUpdates);
        } elsif ($state eq 'unconfigured_restricted_media') {
            $bubble->add_action('clicked', N("More Information"), \&prepare_add_restricted);
        } elsif ($state eq 'no_enterprise_update_medium') {
            $bubble->add_action('clicked', N("More Information"), \&prepare_add_enterprise_update_media);
        } elsif (member($state, qw(no_enabled_medium no_update_medium))) {
            $bubble->add_action('clicked', N("Add media"), \&add_media);
        }

        $bubble->set_urgency($state{$state}{urgency}) if $state{$state}{urgency};
        $bubble->set_timeout(5000);
        eval { $bubble->show };
    }

    my $menu = Gtk2::Menu->new;
    foreach (@arr) { 
	my $action = $actions{$_};
	next if !ref($action->{launch});
	$menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label($action->{name})), activate => $action->{launch}));
    }
    $menu->append(gtkshow(Gtk2::SeparatorMenuItem->new));
    $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label(N("About..."))),
                                    activate => \&about_dialog));
    $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label(N("Updates Configuration"))), 
                                    activate => sub { run_program::raw({ detach => 1 }, 'mdkapplet-config') }));
    $menu->append(gtksignal_connect(gtkset_active($checkme = Gtk2::CheckMenuItem->new_with_label(N("Always launch on startup")), shouldStart()), toggled => sub { setAutoStart(uc(bool2text($checkme->get_active))) }));
    $checkme->show;
    $menu->append(gtksignal_connect(gtkshow(Gtk2::MenuItem->new_with_label(N("Quit"))), activate => sub { mainQuit() }));
    $menu;
}

sub setAutoStart {
    my $state = shift;
    my $date = getTime();
    if (-f $localfile) {
	setVar('AUTOSTART', $state);
    } else { 
        output_p($localfile, 
	       qq(AUTOSTART=$state
LASTCHECK=$date
));
	 }
}

sub mainQuit() {
#    setAutoStart('FALSE');
    Glib::Source->remove($timeout) if $timeout;
    Glib::Source->remove($network_timeout) if $network_timeout;
    Gtk2->main_quit;
}

sub get_enabled_restricted_media {
    my ($urpm) = @_;
    grep { $_->{name} =~ /restricted/i && !$_->{ignore} } @{$urpm->{media}};
}

sub is_restricted_media_configured {
    my ($urpm) = @_;
    return 1 if !is_restricted_media_supported();

    my @restricted_media = get_enabled_restricted_media($urpm);
    my @names = map { $_->{name} } @restricted_media;
    # we need both 'Restricted' & 'Restricted Updates' media
    # those who did online update trough mdkapplet do not have restricted medium, hence the test for 2 medium:
    @restricted_media >= (urpm::cfg::get_arch() =~ /64/ ? 4 : 2)
      && (grep { /Restricted Updates/ } @names) && (grep { /Restricted/ && !/Updates/ } @names);
}

sub really_prepare_add_restricted() {
    $mdv_update_pid = run_program::raw({ detach => 1 }, 'mdkapplet-restricted-helper', $product_id->{version});
}

sub prepare_add_restricted() {
    my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_RESTRICTED});
    return if $warn_me;
    my $w = new_portable_dialog(N("New medium available"));
    my $res =
      fill_n_run_portable_dialog(
          $w,
          [
              get_banner(N("New medium available")),
              gtknew('Label_Left', text => 
                       N("You use '%s' distribution and therefore have privileged access to additional software.",
                         translate_product()) . "\n\n" .
                           N("Do you want to install this additional software repository?"), @common),
              gtknew('CheckButton', text => N("Do not ask me next time"), active_ref => \$warn_me),
              create_okcancel($w, N("Next"), N("Cancel")),
          ]);
    setVar('DO_NOT_ASK_FOR_RESTRICTED', bool2text($warn_me));
    $local_config{DO_NOT_ASK_FOR_RESTRICTED} = bool2text($warn_me);
    $res ? really_prepare_add_restricted() : 0;
}


sub really_prepare_add_enterprise() {
    $mdv_update_pid = run_program::raw({ detach => 1 }, 'mdkapplet-enterprise-update-helper', join('', @$product_id{qw(type product version)}));
}

sub prepare_add_enterprise_update_media() {
    my $warn_me = text2bool($local_config{DO_NOT_ASK_FOR_ENTERPRISE_UPDATE_MEDIA});
    return if $warn_me;
    my $w = new_portable_dialog(N("New medium available"));
    my $res =
      fill_n_run_portable_dialog(
          $w,
          [
              get_banner(N("New medium available")),
              gtknew('Label_Left', text => 
                       N("You use '%s' distribution and therefore have privileged access to additional software.",
                         N_("Mandriva Enterprise Server")) . "\n\n" .
                           N("Do you want to install this additional software repository?"), @common),
              gtknew('CheckButton', text => N("Do not ask me next time"), active_ref => \$warn_me),
              create_okcancel($w, N("Next"), N("Cancel")),
          ]);
    setVar('DO_NOT_ASK_FOR_ENTERPRISE_UPDATE_MEDIA', bool2text($warn_me));
    $local_config{DO_NOT_ASK_FOR_ENTERPRISE_UPDATE_MEDIA} = bool2text($warn_me);
    $res ? really_prepare_add_enterprise() : 0;
}
the main configuration tool for hardware that calls all the other configuration tools. It offers a nice GUI that show the hardware configuration splitted by hardware classes. %prep %setup -q %build %make rpcinfo-flushed ddcprobe serial_probe %make %install rm -rf $RPM_BUILD_ROOT %make PREFIX=$RPM_BUILD_ROOT install mkdir -p $RPM_BUILD_ROOT/{%_initrddir,%_sysconfdir/{X11/xinit.d,sysconfig/harddrake2}} touch $RPM_BUILD_ROOT/etc/sysconfig/harddrake2/previous_hw mv $RPM_BUILD_ROOT%_sbindir/net_monitor \ $RPM_BUILD_ROOT%_sbindir/net_monitor.real ln -sf %_bindir/consolehelper $RPM_BUILD_ROOT%_sbindir/net_monitor mkdir -p $RPM_BUILD_ROOT%_sysconfdir/{pam.d,security/console.apps} cp pam.net_monitor $RPM_BUILD_ROOT%_sysconfdir/pam.d/net_monitor cp apps.net_monitor $RPM_BUILD_ROOT%_sysconfdir/security/console.apps/net_monitor dirs1="usr/lib/libDrakX usr/share/libDrakX" (cd $RPM_BUILD_ROOT ; find $dirs1 usr/bin usr/sbin ! -type d -printf "/%%p\n")|egrep -v 'bin/.*harddrake' > %{name}.list (cd $RPM_BUILD_ROOT ; find $dirs1 -type d -printf "%%%%dir /%%p\n") >> %{name}.list perl -ni -e '/XFdrake|bootlook|drakbackup|drakfont|gtk|icons|logdrake|net_monitor|pixmaps/ ? print STDERR $_ : print' %{name}.list 2> %{name}-gtk.list perl -ni -e '/http/ ? print STDERR $_ : print' %{name}.list 2> %{name}-http.list #mdk menu entry mkdir -p $RPM_BUILD_ROOT/%_menudir cat > $RPM_BUILD_ROOT%_menudir/harddrake-ui <<EOF ?package(harddrake-ui):\ needs="X11"\ section="Configuration/Hardware"\ title="HardDrake"\ longtitle="Hardware Central Configuration/information tool"\ command="/usr/sbin/harddrake2"\ icon="harddrake.png" EOF cat > $RPM_BUILD_ROOT%_datadir/harddrake/convert <<EOF #!/usr/bin/perl use Storable; my \$last_boot_config = "/etc/sysconfig/harddrake2/previous_hw"; my \$config = do \$last_boot_config; store \$config, \$last_boot_config; EOF cat > $RPM_BUILD_ROOT%_sysconfdir/X11/xinit.d/harddrake2 <<EOF #!/bin/sh exec /usr/share/harddrake/service_harddrake X11 EOF cat > $RPM_BUILD_ROOT%_datadir/harddrake/confirm <<EOF #!/usr/bin/perl use lib qw(/usr/lib/libDrakX); use interactive; my \$in = interactive->vnew; my \$res = \$in->ask_okcancel(\$ARGV[0], \$ARGV[1], 1); \$in->exit(\$res); EOF chmod +x $RPM_BUILD_ROOT{%_datadir/harddrake/*,%_sysconfdir/X11/xinit.d/harddrake2} %find_lang libDrakX cat libDrakX.lang >> %name.list %clean rm -rf $RPM_BUILD_ROOT %post [[ ! -e %_sbindir/kbdconfig ]] && %__ln_s -f keyboarddrake %_sbindir/kbdconfig [[ ! -e %_sbindir/mouseconfig ]] && %__ln_s -f mousedrake %_sbindir/mouseconfig [[ ! -e %_bindir/printtool ]] && %__ln_s -f ../sbin/printerdrake %_bindir/printtool : %postun for i in %_sbindir/kbdconfig %_sbindir/mouseconfig %_bindir/printtool;do [[ -L $i ]] && %__rm -f $i done %post http %_post_service drakxtools_http %preun http %_preun_service drakxtools_http %post -n harddrake-ui %update_menus %postun -n harddrake-ui %clean_menus %post -n harddrake %_post_service harddrake %preun -n harddrake %_preun_service harddrake %postun -n harddrake file /etc/sysconfig/harddrake2/previous_hw | fgrep -q perl && %_datadir/harddrake/convert || : %files newt -f %name.list %defattr(-,root,root) %config(noreplace) /etc/security/fileshare.conf %doc diskdrake/diskdrake.html %attr(4755,root,root) %_sbindir/fileshareset %files -f %{name}-gtk.list %defattr(-,root,root) %config(noreplace) %_sysconfdir/pam.d/net_monitor %config(noreplace) %_sysconfdir/security/console.apps/net_monitor /usr/X11R6/bin/* %files -n harddrake %defattr(-,root,root) %config(noreplace) %_initrddir/harddrake %dir /etc/sysconfig/harddrake2/ %config(noreplace) /etc/sysconfig/harddrake2/previous_hw %_datadir/harddrake/* #%_sysconfdir/X11/xinit.d/harddrake2 %files -n harddrake-ui %defattr(-,root,root) %_sbindir/harddrake2 %_datadir/pixmaps/harddrake2 %_menudir/harddrake-ui %_iconsdir/large/harddrake.png %_iconsdir/mini/harddrake.png %_iconsdir/harddrake.png %files http -f %{name}-http.list %defattr(-,root,root) %dir %_sysconfdir/drakxtools_http %config(noreplace) %_sysconfdir/pam.d/miniserv %config(noreplace) %_sysconfdir/init.d/drakxtools_http %config(noreplace) %_sysconfdir/drakxtools_http/conf %config(noreplace) %_sysconfdir/drakxtools_http/authorised_progs %config(noreplace) %_sysconfdir/logrotate.d/drakxtools-http %changelog * Wed Nov 6 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.10-4mdk - s/_(/N(/ * Tue Nov 05 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.10-3mdk - rebuild for newt * Mon Nov 4 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.10-2mdk - snapshot * Wed Oct 16 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.10-1mdk - harddrake : o try to discriminate webcams from video cards o fix not displayed unknow devices - detection engin : o update eide vendors list o detect cpus o adsl work (damien) - drakbug: o make ui faster o fix displayed result when the package isn't installed - drakTermServ : fixes (stew) - smb updates (stew) - fix broken danish translations (wrong unicode encoding) (pablo) - update other translations by the way (pablo) * Fri Sep 20 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-53mdk - remove useless warnings from harddrake * Fri Sep 20 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-52mdk - fix draksec * Fri Sep 20 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-51mdk - printerdrake: various fixes (till) - drabug: o fix spurious '1' file creation o don't print error messages when a program isn't found * Tue Sep 17 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-50mdk - draksec: o add ignore option to pull-down list o remove not anymore used libsafe option o save items o reread already set item * Tue Sep 17 2002 Warly <warly@mandrakesoft.com> 1.1.9-49mdk - printerdrake fix for webfetch * Mon Sep 16 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-48mdk - fix die wizcancel in non wizard mode (dams sucks?) * Sat Sep 14 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-47mdk - fix printerdrake network scanning for printers/print servers hangs on with firewalled machines (till) - fix printerdrake curl dependancy break urpmi (till) - obsoletes drakfloppy (daouda) * Thu Sep 12 2002 Damien Chaumette <dchaumette@mandrakesoft.com> 1.1.9-46mdk - fix broken net_monitor * Thu Sep 12 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-45mdk - try to fix drakgw & drakfirewall thx to pixel and florin - fix drakfloppy and logdrake (tv) * Wed Sep 11 2002 Damien Chaumette <dchaumette@mandrakesoft.com> 1.1.9-44mdk - drakconnect : o fix RTC, ISDN detection o fix pcmcia cards detection / module list o check DNS and Gateway IPs * Mon Sep 9 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-43mdk - move back draksec to drakxtools - harddrake: o don't pollute sbin namespace with one shot scripts o add run wrapper script for harddrake service o disable ?dm part - draksound: o really display default driver o wait message while switching - update translations * Sat Sep 7 2002 Daouda LO <daouda@mandrakesoft.com> 1.1.9-42mdk - cvs up before packaging (fix messy drakboot conf). * Fri Sep 6 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-41mdk - fix harddrake service, run non essential checks after dm start * Fri Sep 6 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-40mdk - harddrake: o fix usb mouse detection o list --test in -h|--help o enhanced draksound : * blacklist cs46xx and cs4281 drivers : we won't unload these drivers since they're know to oopses the kernel but just warn the user * chroot aware - can be used in drakx * workaround alsaconf's aliases * add an help button that describe ALSA and OSS * display current driver, its type (OSS or ALSA), and the default driver for the card * if there's no (usb|pci) sound card, print a note about sndconfig for isa pnp cards * Fri Sep 06 2002 David BAUDENS <baudens@mandrakesoft.com> 1.1.9-39mdk - Re-add old obsolete Aurora's images needed by drakboot (this is stupid) * Fri Sep 06 2002 David BAUDENS <baudens@mandrakesoft.com> 1.1.9-38mdk - Update mdk_logo.png - Update drakbackup icons * Fri Sep 6 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-37mdk - drakperm, drakbackup: fix embedded mode * Fri Sep 6 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-36mdk - gtkicons_labels_widget() : o add support for mcc' big icon animation o cleanups o simplify notebook redrawing vs flick/icon_aligment * Thu Sep 5 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-35mdk - Update banners (David Baudens) - my_gtk snapshot for rpmdrake (gc) * Wed Sep 4 2002 Stew Benedict <sbenedict@mandrakesoft.com> 1.1.9-34mdk - add perl-Expect requires for drakbackup (now enabled) * Wed Sep 4 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-33mdk - harddrake: fix scrolling tree * Wed Sep 4 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-32mdk - embbed drakbackup * Wed Sep 4 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-31mdk - snapshot for gtktext_insert with color/font capabilities (rpmdrake) * Tue Sep 3 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-30mdk - ugtk: o better fix for glib warning that don't make drakx feel mad o make icons more transparent when selected in mcc * Mon Sep 2 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-29mdk - harddrake: o use new icons o add menu icon - mcc: ensure all binaries're there - ugtk: remove all glib warnings * Mon Sep 2 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-28mdk - tinyfirewall is now drakfirewall (daouda) * Fri Aug 30 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-27mdk - ugtk: add alpha blendering support for mcc's icons through pixbufs o readd gdkpixbuf support o ensure imlib is used by default to load files, not gdk-pixbuf o compose_with_back(): load a png icon into a pixbuf and call compose_pixbufs with background pixbuf o compose_pixbufs(): render transparent icon onto background into a new pixbuf o merge gtkcreate_png_pixbuf() from gdk-pixbuf-0-branch : load an icon into a pixbuf gdk-pixbuf-0-branch also uses it to simplify a lot of code o gtkicons_labels_widget() : * add a new background pixbuf parameter that'll be composited with icons * render icons with alpha blender in right area * kill imlib_counter * kill imlib usage for * kill dead code (was dead since i fixed mcc memory leaks) - fix init-script-without-chkconfig-{post,preun} * Thu Aug 29 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-26mdk - harddrake: o quit button really work in embedded mode o move so called eide raid controllers from unknown to ata controllers - logdrake: add a scrollbar when embedded in mcc * Thu Aug 29 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-25mdk - snapshot (drakupdate_fstab --auto feature (pixel), logdrake don't display too much information in explanations to save space for what's useful) * Thu Aug 29 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-24mdk - snapshot for display_info availability in ask_browse for rpmdrake * Thu Aug 29 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-23mdk - drakupdate_fstab first appearance * Wed Aug 28 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-22mdk - harddrake: don't display the menu bar in embedded mode, but a "quit" button * Tue Aug 27 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-21mdk - drakconnect fixes (damien) * Fri Aug 23 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-20mdk - draksound: display right message ("no alternative") when no alternative rather than "no known module" - fixes for multiple NIC boxes (florin) * Fri Aug 23 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-19mdk - draksound: use right sound slot * Fri Aug 23 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-18mdk - ugtk: fix most mcc memory leaks (pending ones seems related to perl-gtk) - tinyfirewall: misc fixes (pixel) * Fri Aug 23 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-17mdk - snapshot (including new tinyfirewall) * Thu Aug 22 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-16mdk - snapshot (for rpmdrake) * Wed Aug 21 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-15mdk - add draksound - mousedrake: default usbmouse link to input/mice rather than input/mouse0, thus giving support for multiple mouse, wacom tables, ... * Wed Aug 21 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-14mdk - fix dangling waiting watch mousecursor (well, please test!) - adding draksplash (nathan) * Mon Aug 19 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-13mdk - snapshot (including better XFdrake) * Wed Aug 14 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-12mdk - snapshot (fix diskdrake making a hell of fstab) * Tue Aug 13 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-11mdk - snapshot (including "diskdrake --dav") * Mon Aug 12 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-10mdk - snapshot (various bug fixes including no-floppy-box-segfault) * Fri Aug 9 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-9mdk - harddrake: o module configuration window: * read current options * don't display ranges, we cannot really know when a range is needed and so display them in wrong cases * read & parse modules.conf only when configuring the module, not on each click in the tree * don't display ranges, we cannot really know when a range is needed and so display them in wrong cases (kill code, enable us to simplify modparm::parameters after * Fri Aug 9 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-8mdk - snapshot * Tue Aug 6 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-7mdk - harddrake, scannerdrake: add scsi scanner detection support - harddrake: detect external modems * Tue Aug 6 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-6mdk - rebuild for perl thread-multi * Mon Aug 5 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-5mdk - snapshot for rpmdrake * Fri Aug 2 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-4mdk - have interactive::gtk::exit in my_gtk so that my_gtk apps can call it and then fix the problem of clock mouse cursor on exit * Thu Aug 1 2002 Pixel <pixel@mandrakesoft.com> 1.1.9-3mdk - keyboarddrake now handles choosing toggle key (XkbOptions) * Thu Aug 1 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.9-2mdk - remove obsoleted drakconf - various fixes - [ugtk::gtkcreate_png] suppress all gtk warnings - updated vietnamese translation (pablo) - [interactive::gtk] fix many warnings when {icon} is not given (pixel) * Thu Aug 1 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.9-1mdk - integrate patches in my_gtk and ugtk for new rpmdrake: - [ugtk] add "gtkentry" so that we can create an entry and set initial value in one call - [my_gtk::main] don't set the events, to fix keyboard focus problem in entries when embedded - [my_gtk::_create_window] add $::noBorder, to not have a frame in the main window, so that it's possible to end up with windows with no border - [my_gtk] add ask_dir which is a ask_file with only the dir list - [my_gtk] add ask_browse_tree_info to the export tags, and: - add support for parents with no leaves, so that then we can partially build the trees (for speedup) - add "delete_all" and "delete_category" callbacks - use Gtk::CList::clear when removing all the nodes, much speedup - Titi, harddrake : o workaround for the busy mouse cursor set by gtkset_mousecursor_wait() in my_gtk::destroy o remove debugging prints o cleanups - drakx: various cleanups * Thu Aug 1 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-16mdk - my_gtk: o splitup it into my_gtk and ugtk as done by dams o resync with dams o increase the icon blinkage from 50ms to 100ms - harddrake: o use new embedded managment * Thu Aug 1 2002 Pixel <pixel@mandrakesoft.com> 1.1.8-15mdk - harddrake (titi): o add embedded mode for drakconf o print less gtk warnings o module configuration window - fix mousedrake - fix XFdrake in embedded - enhance XFdrake - don't require detect-lst (titi) - printerdrake work in progress (till) * Wed Jul 31 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-14mdk - harddrake: o fix pcmcia network card detection (unknown => ethernet) o fix scsi detection : * fix SCSI controllers detection (unknown => scsi controllers) * fix misdetection of scsi devices as scsi host adapter * fix double scsi devices detection (both unknown and real category) - updated translations - fix mousedrake (pixel) - drakbug, drakbackup: spell/i18n fixes (pixel, me) - xfdrake: fixes (pixel) - new draksex (stew) - diskdrake: (pixel) o fix LVM on RAID o explain the pb when maximal number of primary partitions is reached * Mon Jul 29 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-13mdk - harddrake: o service: fix config file conversion o harddrake::ui : * s/channel/Channel/ * bus_id is for usb devices too * remove obsolete fields info and name * add nbuttons, device, old_device descriptions - updated XFdrake (gtk resolution chooser work, i810 fixes, ...) (pixel) - remove "Requires: groff" (nobody know why it's there) (Pixel) - updated translations (nl/id/vi) - standalone/logdrake: (deush) o don't display services that are not installed o word wrap string correctly o cleanup - bootloader.pm: (pixel) o let the bootloader::mkinitrd error be seen by the GUI o fix dying when mkinitrd doesn't create an initrd - interactive.pm: error messages fixes (pixel) - diskdrake: add 0x35 partition table id meaning JFS (under OS/2) (thank to Mika Laitio) - printerdrake: first step of automatic HP multi-function device configuration with HPOJ 0.9. (till) - drakTermServ (stew) o Check for/install terminal-server and friends. o More intelligent error message when mkisofs fails. o Cleanup code for use strict. o Fix crash when no backup dhcpd.conf. - drakbackup: (stew) o Numerous GUI crash fixes, oddities. o Install needed packages. o Fix email, daemon modes. o Add rsync, webdav, cd, tape capabilities. o Consolidate net method setup screens. o Add CD device capability query. * Thu Jul 25 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-12mdk - simplify harddrake service: o we don't need to set media_type, we don't use it o mouse and mass storage media use the same key, let merge their code path o merge timeout and cancel cases - harddrake::data : only do one probeall here (there's still many in detect_devices, probing caching should go there) - harddrake:ui : o add a fields data structure: * put together field translation and field description * this enable to get rid of %reverse_fields usage & creation * this ensure all field names & translations are marked translatables for gettext * move $wait declaration around its usage and explicit its destruction * remove usb debugging message needed to trace the null description bug i fixed in ldetect * simplify the device fields rendering "because of" the above * simplify the help window creation/display/destruction (only one statement left) o explicitely call interactive->exit o remove all "no signal to disconnect" gtk+ warnings * Thu Jul 25 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-11mdk - rebuild against new libldetect (fix (null) descriptions) - new XFdrake (pixel) - harddrake: o devfs names o scanner support; * don't account scanners as unknown devices * split scannerdrake:val into vendor and description * don't display bogus "val:%HASH" - updated translations (fr, pl) - tools can be runned on console again * Tue Jul 23 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-10mdk - harddrake : o remove - between vendor and model for ibm eide disks o network devices are configurable again now - draksec : typo fix (deush) * Tue Jul 23 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-9mdk - harddrake : o don't show "cancel" button in about and help windows o service: convert config file from plain perl to Storable binary file (faster startup) - general reorganization cleanup: o move interactive_* into interactive::* o move partition_table_* into partition_table::* - XFdrake: more cleanups (pixel) * Sun Jul 21 2002 Pixel <pixel@mandrakesoft.com> 1.1.8-8mdk - new snapshot (beware of XFdrake) * Thu Jul 18 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-7mdk - remove last draknet reference in harddrake::ui - disable diagnostics and strict mode * Thu Jul 18 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-6mdk - able to restart WindowMaker if needed - draknet is dead; vival el drakconnect - devices managment: o no need to write /etc/sysconfig/harddrake2/previous_hw in %%post since harddrake2 service doesn't configure anything if previous config was empty o fix usb mac mouse detection o move scsi/ata controllers, burners, dvd, ... from unknown/others into their own"non configurable" sections o fix problems with usb-interface - XFdrake: big cleanup - general cleanups - translation updates * Thu Jul 11 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-5mdk - drakx : o code enhancement: increase coherency around the whole drakx code regarding devices o decrease the debug verbosity - harddrake2 : o i18n: * move $version out of translatable strings o ui: * increase default main window size * put back the hw tree root * eide devices: split info between vendor and model strings - spec :