This file is indexed.

/usr/share/perl5/Config/Model/Lister.pm is in libconfig-model-perl 2.047-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
#
# This file is part of Config-Model
#
# This software is Copyright (c) 2013 by Dominique Dumont.
#
# This is free software, licensed under:
#
#   The GNU Lesser General Public License, Version 2.1, February 1999
#
package Config::Model::Lister;
{
  $Config::Model::Lister::VERSION = '2.047';
}


use strict;
use warnings;
use Exporter;

use vars qw/@EXPORT/;

@EXPORT = qw(applications models) ;


sub available_models {
    my $test = shift || 0 ;
   
    my (%categories, %appli_info, %applications ) ;
    my %done_cat ;
    my @dir_to_scan = $test ? qw/lib/ : @INC ;

    foreach my $dir (map { glob("$_/Config/Model/*.d") } @dir_to_scan ) {
        my ($cat) = ( $dir =~ m!.*/([\w\-]+)\.d! );

        if ($cat !~ /^user|system|application$/) {
            warn "available_models: skipping unexpected category: $cat\n";
            next;
        }
        
        foreach my $file (sort glob("$dir/*")) {
            next if $file =~ m!/README! ;
            my ($appli) = ($file =~ m!.*/([\w\-]+)! );
            open (F, $file) || die "Can't open file $file:$!" ;
            while (<F>) {
                chomp ;
                s/^\s+// ;
                s/\s+$// ;
                s/#.*// ;
                my ($k,$v) = split /\s*=\s*/ ;
                next unless $v ;
                if ($k =~ /model/i) {
                    push @{$categories{$cat}} , $appli unless $done_cat{$cat}{$appli} ;
                    $done_cat{$cat}{$appli} = 1 ;
                }
                
                $appli_info{$appli}{$k} = $v ; 
                $applications{$appli} = $v if $k =~ /model/i; 
            }
        }
    }
    return \%categories, \%appli_info, \%applications ;
}


sub models {
    my @i = available_models ;
    return join( ' ',  sort values %{$i[2]} )."\n"; 
}


sub applications {
    my @i = available_models ;
    return join( ' ',  sort keys   %{$i[2]} )."\n"; 
}

1;

# ABSTRACT: List available models and applications

__END__

=pod

=encoding UTF-8

=head1 NAME

Config::Model::Lister - List available models and applications

=head1 VERSION

version 2.047

=head1 SYNOPSIS

 perl -MConfig::Model::Lister -e'print Config::Model::Lister::models;'

 perl -MConfig::Model::Lister -e'print Config::Model::Lister::applications;'

=head1 DESCRIPTION

Small modules to list available models or applications whose config
can be edited by L<config-edit>. This module is designed to be used
by bash completion.

=head1 FUNCTIONS

=head1 available_models

Returns an array of 3 hash refs:

=over

=item *

category (system or user or application) => application list. E.g.

 { system => [ 'popcon' , 'fstab'] }

=item *

application => { model => 'model_name', ... }

=item *

application => model_name

=back

=head1 models

Returns a string with the list of models.

=head1 applications

Returns a string with the list of editable applications.

=head1 SUPPORT

CPAN RT system, Debian BTS or mailing list.

=head1 AUTHOR

Copyright 2011 Dominique Dumont

=head1 AUTHOR

Dominique Dumont

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2013 by Dominique Dumont.

This is free software, licensed under:

  The GNU Lesser General Public License, Version 2.1, February 1999

=cut