From 0b1ba6a22bf86c55bf0c9ffc6fc20e6c8b737435 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Tue, 6 Jan 2004 13:42:35 +0000 Subject: perl_checker cleanups --- perl-install/standalone/drakperm | 9 ++++----- perl-install/standalone/logdrake | 43 +++++++--------------------------------- perl-install/wizards.pm | 6 +++--- 3 files changed, 14 insertions(+), 44 deletions(-) (limited to 'perl-install') diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm index f88b3c989..be77b1cfc 100755 --- a/perl-install/standalone/drakperm +++ b/perl-install/standalone/drakperm @@ -7,9 +7,8 @@ use standalone; use common; use ugtk2 qw(:helpers :wrappers :create); -use interactive; -my $in = 'interactive'->vnew('su'); +require_root_capability(); local $_ = join '', @ARGV; #- vars declaration @@ -141,7 +140,7 @@ $w->{rwindow}->set_position('center') unless $::isEmbedded; $combo_perm->entry->set_text($perm_l10n{all}); display_perm('all'); -my $combo_sig = $combo_perm->entry->signal_connect(changed => sub { display_perm($rev_perm_l10n{$combo_perm->entry->get_text} , @_) }); +my $_combo_sig = $combo_perm->entry->signal_connect(changed => sub { display_perm($rev_perm_l10n{$combo_perm->entry->get_text} , @_) }); $permList->get_selection->signal_connect('changed' => sub { my ($select) = @_; @@ -315,8 +314,7 @@ sub row_setting_dialog { }); my %perms; $ok->signal_connect(clicked => sub { - my ($path, $user, $group, $perms, $idx); - # create new item if needed (that is when adding a new one) at end of list + my ($path, $user, $group, $perms, $_idx); $path = $file->get_text; if ($usr_check->get_active) { $user = 'current'; @@ -328,6 +326,7 @@ sub row_setting_dialog { $perms = sprintf("%o", eval(join('', "0b", (map { $perms{$_}->get_active || 0 } reverse @bits), (map { my $owner = $_;map_index { $perms{$owner}{$_}->get_active || 0 } @rights } @owners)))); + # create new item if needed (that is when adding a new one) at end of list if (!$iter) { $iter = $model->append; push @rules, { path => $path, user => $user, group => $group, perms => $perms, index => $index }; diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake index 8289ac8aa..f0e8451f8 100755 --- a/perl-install/standalone/logdrake +++ b/perl-install/standalone/logdrake @@ -76,40 +76,14 @@ my @menu_items = ( { path => N("/_Help"), item_type => '' }, { path => N("/Help/_About...") } ); -my $menubar = create_factory_menu($my_win->{rwindow}, @menu_items) unless $::isEmbedded; +my $_menubar = create_factory_menu($my_win->{rwindow}, @menu_items) unless $::isEmbedded; ######### menus end ########## font and colors -my %n = ('font' => ''); # Gtk2::Pango::FontDescription->from_string('Serif 12');#Gtk2::Gdk::Font->fontset_load(N("-misc-fixed-medium-r-*-*-*-100-*-*-*-*-*-*,*")); -my %b = ('font' => 'Bold'); #Gtk2::Pango::FontDescription->from_string('Serif Bold 12');#Gtk2::Gdk::Font->fontset_load(N("-misc-fixed-bold-r-*-*-*-100-*-*-*-*-*-*,*")); - -#$black = "\033[30m"; -#$red = "\033[31m"; -#$green = "\033[32m"; -#$yellow = "\033[33m"; -#$blue = "\033[34m"; -#$magenta = "\033[35m"; -#$purple = "\033[35m"; -#$cyan = "\033[36m"; -#$white = "\033[37m"; -#$darkgray = "\033[30m"; -#$col_norm = "\033[00m"; -#$col_background = "\033[07m"; -#$col_brighten = "\033[01m"; -#$col_underline = "\033[04m"; -#$col_blink = "\033[05m"; - -my $white = gtkcolor(50400, 655, 20000); -my $black = gtkcolor(0, 0, 0); -my $red = gtkcolor(0xFFFF, 655, 655); -my $green = gtkcolor(0x0, 0x9898,0x0); -my $yellow = gtkcolor(0xFFFF, 0xD7D7, 0); -my $blue = gtkcolor(655, 655, 0xFFFF); -my $magenta = gtkcolor(0xFFFF, 655, 0xFFFF); -my $purple = gtkcolor(0xA0A0, 0x2020, 0xF0F0); -my $cyan = gtkcolor(0x0, 0x9898, 0x9898); -my $darkgray = gtkcolor(0x2F2F, 0x4F4F, 0x4F4F); +my %n = ('font' => ''); +my %b = ('font' => 'Bold'); + # Define global terms: # Define good notables: @@ -117,12 +91,9 @@ my @word_good = ("starting\n", "Freeing", "Detected", "starting.", "accepted.\n" my @word_warn = ("dangling", "closed.\n", "Assuming", "root", "root\n", "exiting\n", "missing", "Ignored", "adminalert:", "deleting", "OFFLINE\n"); my @word_bad = "bad"; my @word_note = ("LOGIN", "DHCP_OFFER", "optimized", "reset:", "unloaded", "disconnected", "connect", "Successful", "registered\n"); -my @line_good = ("up", "DHCP_ACK", "Cleaned", "Initializing", "Starting", "success", "successfully", "alive", "found", "ONLINE\n"); -my @line_warn = ("warning:", "WARNING:", "invalid", "obsolete", "bad", "Password", "detected", "timeout", "timeout:", "attackalert:", "wrong", "Lame", "FAILED", "failing", "unknown", "obsolete", "stopped.\n", "terminating.", "disabled\n", "disabled", "Lost"); -my @line_bad = ("DENY", "lost", "shutting", "dead", "DHCP_NAK", "failure;", "Unable", "inactive", "terminating", "refused", "rejected", "down", "OFFLINE\n", "error\n", "ERROR\n", "ERROR:", "error", "ERROR", "error:", "failed:"); - -# Define specifics: -my @daemons = "named"; +#my @line_good = ("up", "DHCP_ACK", "Cleaned", "Initializing", "Starting", "success", "successfully", "alive", "found", "ONLINE\n"); +#my @line_warn = ("warning:", "WARNING:", "invalid", "obsolete", "bad", "Password", "detected", "timeout", "timeout:", "attackalert:", "wrong", "Lame", "FAILED", "failing", "unknown", "obsolete", "stopped.\n", "terminating.", "disabled\n", "disabled", "Lost"); +#my @line_bad = ("DENY", "lost", "shutting", "dead", "DHCP_NAK", "failure;", "Unable", "inactive", "terminating", "refused", "rejected", "down", "OFFLINE\n", "error\n", "ERROR\n", "ERROR:", "error", "ERROR", "error:", "failed:"); # Now define what we want to use when: my $col_good = 'green4'; diff --git a/perl-install/wizards.pm b/perl-install/wizards.pm index 3a5c99ce1..7b4482b78 100644 --- a/perl-install/wizards.pm +++ b/perl-install/wizards.pm @@ -132,7 +132,7 @@ sub process { local $::Wizard_no_cancel = $page->{no_cancel} || $page->{end}; local $::Wizard_finished = $page->{end}; defined $page->{pre} and $page->{pre}($page); - die "inexistant \"$next\" wizard step" if is_empty_hash_ref($page); + die qq(inexistant "$next" wizard step) if is_empty_hash_ref($page); # FIXME or the displaying fails my $data = defined $page->{data} ? (ref($page->{data}) eq 'CODE' ? $page->{data}->() : $page->{data}) : [ { label => '' } ]; @@ -167,10 +167,10 @@ sub process { if (!defined $o->{pages}{$next}) { $next = $page->{next}; } else { - die "the \"$next\" page (from previous wizard step) is undefined" if !$next; + die qq(the "$next" page (from previous wizard step) is undefined) if !$next; } } - die "Step \"$current\": inexistant \"$next\" page" if !exists $o->{pages}{$next}; + die qq(Step "$current": inexistant "$next" page) if !exists $o->{pages}{$next}; } else { # step back: $next = pop @steps -- cgit v1.2.1