View | Details | Raw Unified | Return to bug 36027
Collapse All | Expand All

(-)a/misc/maintenance/search_for_data_inconsistencies.pl (-3 / +14 lines)
Lines 38-43 our %options = ( Link Here
38
    'check-title'     => 0,
38
    'check-title'     => 0,
39
    'check-age'       => 0,
39
    'check-age'       => 0,
40
    'check-loop'      => 0,
40
    'check-loop'      => 0,
41
    'check-all'       => 0,
41
    'skip-branch'     => 0,
42
    'skip-branch'     => 0,
42
    'skip-auth'       => 0,
43
    'skip-auth'       => 0,
43
    'skip-status'     => 0,
44
    'skip-status'     => 0,
Lines 57-62 GetOptions( Link Here
57
    'check-title'     => sub { $options{'check-title'}     = 1 },
58
    'check-title'     => sub { $options{'check-title'}     = 1 },
58
    'check-age'       => sub { $options{'check-age'}       = 1 },
59
    'check-age'       => sub { $options{'check-age'}       = 1 },
59
    'check-loop'      => sub { $options{'check-loop'}      = 1 },
60
    'check-loop'      => sub { $options{'check-loop'}      = 1 },
61
    'check-all'       => sub { $options{'check-all'}       = 1 },
60
    'skip-branch'     => sub { $options{'skip-branch'}     = 1 },
62
    'skip-branch'     => sub { $options{'skip-branch'}     = 1 },
61
    'skip-auth'       => sub { $options{'skip-auth'}       = 1 },
63
    'skip-auth'       => sub { $options{'skip-auth'}       = 1 },
62
    'skip-status'     => sub { $options{'skip-status'}     = 1 },
64
    'skip-status'     => sub { $options{'skip-status'}     = 1 },
Lines 125-133 sub set_skip_options { Link Here
125
127
126
# Set all check options to 1 if none are provided, considering skip options
128
# Set all check options to 1 if none are provided, considering skip options
127
sub set_all_check_options_if_none_provided {
129
sub set_all_check_options_if_none_provided {
128
    my $any_check_option_provided = grep { $options{$_} } grep { /^check-/ } keys %options;
130
    my $check_all_option_provided = grep { $options{$_} && $_ eq "check-all" } grep { /^check-/ } keys %options;
131
    if ( $check_all_option_provided ) {
132
        foreach my $key ( keys %options ) {
133
            if ( $key =~ /^check-/ ) {
134
                my $skip_key = $key;
135
                $skip_key =~ s/^check-/skip-/;
129
136
130
    if ( !$any_check_option_provided ) {
137
                # Set check option to 1 unless the corresponding skip option indicated
138
                $options{$key} = 1 unless $options{$skip_key};
139
            }
140
        }
141
    }
142
    elsif ( 0 == grep { $options{$_} && $_ ne "check-all" } grep { /^check-/ } keys %options) {
131
        handle_invalid_options("No options selected");
143
        handle_invalid_options("No options selected");
132
        die;
144
        die;
133
    }
145
    }
134
- 

Return to bug 36027