Codebase list libconfig-model-itself-perl / 8bb0810
Imported Upstream version 1.237 Dominique Dumont 11 years ago
41 changed file(s) with 67 addition(s) and 246 deletion(s). Raw diff Collapse all Expand all
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
77 # The GNU Lesser General Public License, Version 2.1, February 1999
88 #
9 # Copyright (c) 2009-2012 Dominique Dumont.
9 # Copyright (c) 2009-2013 Dominique Dumont.
1010 #
1111 # This file is part of Config-Model-Itself.
1212 #
2626 # 02110-1301 USA
2727
2828 use Module::Build;
29 use Data::Dumper ;
3029
3130 use warnings FATAL => qw(all) ;
3231 use strict ;
6968 'namespace::autoclean' => '0'
7069 },
7170 'configure_requires' => {
72 'Any::Moose' => '0',
7371 'Config::Model' => '2.030',
7472 'File::Slurp' => '0',
7573 'Log::Log4perl' => '1.11',
8179 'Config::Model::TkUI' => '1.210',
8280 'Data::Compare' => '0',
8381 'Log::Log4perl' => '0',
82 'Mouse' => '0',
8483 'Path::Class' => '0',
8584 'Pod::POM' => '0',
8685 'Tk' => '0',
0 2013-04-19 - 1.237
1
2 * Replaced Any::Moose with Mouse
3 * backend detector: do not list twice the same backend
4 * Removed augeas from model and tests. Augeas meta-model
5 is now delivered with Config::Model::Backend::Augeas
6
07 2013-03-23 - 1.236
18
29 * Itself: use named parameters with load_data to avoid warnings
0 This software is Copyright (c) 2012 by Dominique Dumont.
0 This software is Copyright (c) 2013 by Dominique Dumont.
11
22 This is free software, licensed under:
33
44 META.json
55 META.yml
66 README
7 augeas_box/etc/ssh/sshd_config
87 config-model-edit
98 data/MasterModel.pl
109 data/MasterModel/CheckListExamples.pl
1110 data/MasterModel/HashIdOfValues.pl
1211 data/MasterModel/References.pl
13 data/MasterModel/SshdWithAugeas.pl
1412 data/MasterModel/WarpedId.pl
1513 data/MasterModel/WarpedValues.pl
1614 data/MasterModel/X_base_class.pl
33 "Dominique Dumont"
44 ],
55 "dynamic_config" : 0,
6 "generated_by" : "Dist::Zilla version 4.300030, CPAN::Meta::Converter version 2.120921",
6 "generated_by" : "Dist::Zilla version 4.300033, CPAN::Meta::Converter version 2.120921",
77 "license" : [
88 "lgpl_2_1"
99 ],
2626 },
2727 "configure" : {
2828 "requires" : {
29 "Any::Moose" : "0",
3029 "Config::Model" : "2.030",
3130 "File::Slurp" : "0",
3231 "Log::Log4perl" : "1.11",
4544 "Config::Model::TkUI" : "1.210",
4645 "Data::Compare" : "0",
4746 "Log::Log4perl" : "0",
47 "Mouse" : "0",
4848 "Path::Class" : "0",
4949 "Pod::POM" : "0",
5050 "Tk" : "0",
6565 "web" : "http://github.com/dod38fr/config-model-itself"
6666 }
6767 },
68 "version" : "1.236"
68 "version" : "1.237"
6969 }
7070
1010 Test::More: 0
1111 namespace::autoclean: 0
1212 configure_requires:
13 Any::Moose: 0
1413 Config::Model: 2.030
1514 File::Slurp: 0
1615 Log::Log4perl: 1.11
1716 Module::Build: 0.3601
1817 dynamic_config: 0
19 generated_by: 'Dist::Zilla version 4.300030, CPAN::Meta::Converter version 2.120921'
18 generated_by: 'Dist::Zilla version 4.300033, CPAN::Meta::Converter version 2.120921'
2019 license: lgpl
2120 meta-spec:
2221 url: http://module-build.sourceforge.net/META-spec-v1.4.html
2827 Config::Model::TkUI: 1.210
2928 Data::Compare: 0
3029 Log::Log4perl: 0
30 Mouse: 0
3131 Path::Class: 0
3232 Pod::POM: 0
3333 Tk: 0
3636 bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Config-Model-Itself
3737 homepage: https://github.com/dod38fr/config-model/wiki
3838 repository: git://github.com/dod38fr/config-model-itself.git
39 version: 1.236
39 version: 1.237
+0
-10
augeas_box/etc/ssh/sshd_config less more
0 # only a few parameters for augeas tests in core module
1 # leaf, list and hash elements
2 HostbasedAuthentication no
3 HostKey /etc/ssh/ssh_host_key
4 HostKey /etc/ssh/ssh_host_rsa_key
5 HostKey /etc/ssh/ssh_host_dsa_key
6 Subsystem sftp /usr/lib/openssh/sftp-server
7 Subsystem internal-sftp /usr/lib/openssh/sftp-server
8 AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
9 AcceptEnv LC_IDENTIFICATION LC_ALL
11 #
22 # This file is part of Config-Model-Itself
33 #
4 # This software is Copyright (c) 2012 by Dominique Dumont.
4 # This software is Copyright (c) 2013 by Dominique Dumont.
55 #
66 # This is free software, licensed under:
77 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
+0
-62
data/MasterModel/SshdWithAugeas.pl less more
0 #
1 # This file is part of Config-Model-Itself
2 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
4 #
5 # This is free software, licensed under:
6 #
7 # The GNU Lesser General Public License, Version 2.1, February 1999
8 #
9 [
10 [
11 name => 'MasterModel::SshdWithAugeas',
12
13 'read_config' => [
14 {
15 backend => 'augeas',
16 config_dir => '/etc/ssh',
17 file => 'sshd_config',
18 sequential_lens => [qw/HostKey Subsystem Match/],
19 },
20 {
21 backend => 'perl_file',
22 config_dir => '/etc/ssh',
23 auto_create => 1,
24 },
25 ],
26
27 element => [
28 'AcceptEnv',
29 {
30 'cargo' => {
31 'value_type' => 'uniline',
32 'type' => 'leaf'
33 },
34 'type' => 'list',
35 },
36 'HostbasedAuthentication',
37 {
38 'value_type' => 'boolean',
39 'type' => 'leaf',
40 },
41 'HostKey',
42 {
43 'cargo' => {
44 'value_type' => 'uniline',
45 'type' => 'leaf'
46 },
47 'type' => 'list',
48 },
49 'Subsystem',
50 {
51 'cargo' => {
52 'value_type' => 'uniline',
53 'mandatory' => '1',
54 'type' => 'leaf'
55 },
56 'type' => 'hash',
57 'index_type' => 'string'
58 },
59 ],
60 ]
61 ];
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
11 #
22 # This file is part of Config-Model-Itself
33 #
4 # This software is Copyright (c) 2012 by Dominique Dumont.
4 # This software is Copyright (c) 2013 by Dominique Dumont.
55 #
66 # This is free software, licensed under:
77 #
11 #
22 # This file is part of Config-Model-Itself
33 #
4 # This software is Copyright (c) 2012 by Dominique Dumont.
4 # This software is Copyright (c) 2013 by Dominique Dumont.
55 #
66 # This is free software, licensed under:
77 #
259259 'new_from_deprecated' => {
260260 type => 'leaf',
261261 value_type => 'enum',
262 choice => [qw/cds_file perl_file ini_file augeas custom/],
262 choice => [qw/cds_file perl_file ini_file custom/],
263263 migrate_from => {
264264 formula => '$replace{$old}',
265265 variables => { old => '- deprecated_p' },
384384 } qw/warn allow forbid suppress/
385385 ),
386386
387 ## too difficult to correctly test Augeas here
388 'sshd_augeas' => {
389 type => 'node',
390 config_class_name => 'MasterModel::SshdWithAugeas',
391 },
392387 ],
393388 description => [ tree_macro => 'controls behavior of other elements' ],
394389 author => "dod\@foo.com",
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
77 # The GNU Lesser General Public License, Version 2.1, February 1999
88 #
9 # Copyright (c) 2010 Dominique Dumont.
9 # Copyright (c) 2010-2013 Dominique Dumont.
1010 #
1111 # This file is part of Config-Model-Itself.
1212 #
2626
2727 package Config::Model::Itself::BackendDetector ;
2828 {
29 $Config::Model::Itself::BackendDetector::VERSION = '1.236';
29 $Config::Model::Itself::BackendDetector::VERSION = '1.237';
3030 }
3131
3232 use Pod::POM ;
3939
4040 sub setup_enum_choice {
4141 my $self = shift ;
42 my @choices = ref $_[0] ? @{$_[0]} : @_ ;
42
43 # using a hash to make sure that a backend is not listed twice. This may
44 # happen in development environment where a backend in found in /usr/lib
45 # and in ./lib (or ./blib)
46 my %choices = map { ($_ => 1);} ref $_[0] ? @{$_[0]} : @_ ;
4347
4448 # find available backends in all @INC directories
4549 my $wanted = sub {
4751 if (-f $_ and $n =~ s/\.pm$// and $n !~ /Any$/) {
4852 $n =~ s!.*Backend/!! ;
4953 $n =~ s!/!::!g ;
50 push @choices , $n ;
54 $choices{$n} = 1 ;
5155 }
5256 } ;
5357
5660 find ($wanted, $path ) if -d $path;
5761 }
5862
59 $self->SUPER::setup_enum_choice(@choices) ;
63 $self->SUPER::setup_enum_choice(sort keys %choices) ;
6064 }
6165
6266 sub set_help {
122126 class => 'Config::Model::Itself::BackendDetector' ,
123127 value_type => 'enum',
124128 # specify backends built in Config::Model
125 choice => [qw/cds_file perl_file ini_file augeas custom/],
129 choice => [qw/cds_file perl_file ini_file custom/],
126130
127131 help => {
128132 cds_file => "file ...",
129133 ini_file => "Ini file ...",
130134 perl_file => "file perl",
131135 custom => "Custom format",
132 augeas => "Experimental backend",
133136 }
134137 }
135138 ],
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
2626
2727 package Config::Model::Itself::TkEditUI ;
2828 {
29 $Config::Model::Itself::TkEditUI::VERSION = '1.236';
29 $Config::Model::Itself::TkEditUI::VERSION = '1.237';
3030 }
3131
3232 use strict;
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
88 #
99 package Config::Model::Itself ;
1010 {
11 $Config::Model::Itself::VERSION = '1.236';
12 }
13
14 use Any::Moose ;
11 $Config::Model::Itself::VERSION = '1.237';
12 }
13
14 use Mouse ;
1515 use namespace::autoclean;
1616
1717 use IO::File ;
111111 # - translate legacy warp parameters
112112 # - expand elements name
113113 my $tmp_model = Config::Model -> new( skip_include => 1, legacy => $legacy ) ;
114 # @models order is important to write configuration class back in the same
115 # order as the declaration
114116 my @models = $tmp_model -> load ( 'Tmp' , $file ) ;
115117
116118 my $rel_file = $file ;
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
145145 type => 'leaf',
146146 class => 'Config::Model::Itself::BackendDetector',
147147 value_type => 'enum',
148 choice => [qw/cds_file perl_file ini_file augeas custom/],
148 choice => [qw/cds_file perl_file ini_file custom/],
149149 migrate_from => {
150150 formula => '$old',
151151 variables => { old => '- syntax' },
164164 "file with a perl data structure. Configuration filename is made with instance name",
165165 custom =>
166166 "Custom format. You must specify your own class and method to perform the read or write function. See Config::Model::AutoRead doc for more details",
167 augeas =>
168 "Experimental backend with RedHat's Augeas library. See http://augeas.net for details",
169 }
167 }
170168 },
171169
172170 'file' => {
194192 mandatory => 1,
195193 }
196194 ],
197 }
198 },
199
200 'save' => {
201 type => 'leaf',
202 value_type => 'enum',
203 choice => [qw/backup newfile/],
204 level => 'hidden',
205 description =>
206 'Specify how to save the configuration file. Either create a newfile (with extension .augnew, and do not overwrite the original file) or move the original file into a backup file (.augsave extension). Configuration files are overwritten by default',
207 warp => {
208 follow => '- backend',
209 rules => [ augeas => { level => 'normal', } ],
210195 }
211196 },
212197
337322 follow => '- backend',
338323 rules => [ ini_file => { level => 'normal', } ],
339324 }
340 },
341 'set_in' => {
342 type => 'leaf',
343 value_type => 'reference',
344 refer_to => '- - element',
345 level => 'hidden',
346 description =>
347 'Sometimes, the structure of a file loaded by Augeas starts directly with a list of items. For instance, /etc/hosts structure starts with a list of lines that specify hosts and IP addresses. This parameter specifies an element name in Config::Model root class that will hold the configuration data retrieved by Augeas',
348 warp => {
349 follow => '- backend',
350 rules => [ augeas => { level => 'normal', } ],
351 }
352 },
353 'sequential_lens' => {
354 type => 'list',
355 level => 'hidden',
356 cargo => {
357 type => 'leaf',
358 value_type => 'uniline',
359 },
360 warp => {
361 follow => { b => '- backend' },
362 rules => [ '$b eq "augeas"' => { level => 'normal', } ],
363 },
364 description =>
365 'List of hash or list Augeas lenses where value are stored in sequential Augeas nodes. See Config::Model::Backend::Augeas for details.',
366325 },
367326 ],
368327
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
1313
1414 =head2 backend
1515
16 specifies the backend to store permanently configuration data.I<< Optional. Type enum. choice: 'cds_file', 'perl_file', 'ini_file', 'augeas', 'custom'. >>
16 specifies the backend to store permanently configuration data.I<< Optional. Type enum. choice: 'cds_file', 'perl_file', 'ini_file', 'custom'. >>
1717
1818 Here are some explanations on the possible values:
1919
2020 =over
21
22 =item 'augeas'
23
24 Experimental backend with RedHat's Augeas library. See http://augeas.net for details
2521
2622 =item 'cds_file'
2723
5450 =head2 class
5551
5652 I<< Optional. Type uniline. >>
57
58 =head2 save
59
60 Specify how to save the configuration file. Either create a newfile (with extension .augnew, and do not overwrite the original file) or move the original file into a backup file (.augsave extension). Configuration files are overwritten by default. I<< Optional. Type enum. choice: 'backup', 'newfile'. >>
6153
6254 =head2 store_class_in_hash
6355
10395
10496 comment starts with this character. I<< Optional. Type uniline. upstream_default: '#'. >>
10597
106 =head2 set_in
107
108 Sometimes, the structure of a file loaded by Augeas starts directly with a list of items. For instance, /etc/hosts structure starts with a list of lines that specify hosts and IP addresses. This parameter specifies an element name in Config::Model root class that will hold the configuration data retrieved by Augeas. I<< Optional. Type reference. >>
109
110 =head2 sequential_lens
111
112 List of hash or list Augeas lenses where value are stored in sequential Augeas nodes. See Config::Model::Backend::Augeas for details.I<< Optional. Type list of uniline. >>
113
11498 =head2 function
11599
116100 I<< Optional. Type uniline. >>
1313
1414 =head2 backend
1515
16 specifies the backend to store permanently configuration data.I<< Optional. Type enum. choice: 'cds_file', 'perl_file', 'ini_file', 'augeas', 'custom'. >>
16 specifies the backend to store permanently configuration data.I<< Optional. Type enum. choice: 'cds_file', 'perl_file', 'ini_file', 'custom'. >>
1717
1818 Here are some explanations on the possible values:
1919
2020 =over
21
22 =item 'augeas'
23
24 Experimental backend with RedHat's Augeas library. See http://augeas.net for details
2521
2622 =item 'cds_file'
2723
5450 =head2 class
5551
5652 I<< Optional. Type uniline. >>
57
58 =head2 save
59
60 Specify how to save the configuration file. Either create a newfile (with extension .augnew, and do not overwrite the original file) or move the original file into a backup file (.augsave extension). Configuration files are overwritten by default. I<< Optional. Type enum. choice: 'backup', 'newfile'. >>
6153
6254 =head2 store_class_in_hash
6355
10395
10496 comment starts with this character. I<< Optional. Type uniline. upstream_default: '#'. >>
10597
106 =head2 set_in
107
108 Sometimes, the structure of a file loaded by Augeas starts directly with a list of items. For instance, /etc/hosts structure starts with a list of lines that specify hosts and IP addresses. This parameter specifies an element name in Config::Model root class that will hold the configuration data retrieved by Augeas. I<< Optional. Type reference. >>
109
110 =head2 sequential_lens
111
112 List of hash or list Augeas lenses where value are stored in sequential Augeas nodes. See Config::Model::Backend::Augeas for details.I<< Optional. Type list of uniline. >>
113
11498 =head2 function
11599
116100 I<< Optional. Type uniline. >>
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
00 #
11 # This file is part of Config-Model-Itself
22 #
3 # This software is Copyright (c) 2012 by Dominique Dumont.
3 # This software is Copyright (c) 2013 by Dominique Dumont.
44 #
55 # This is free software, licensed under:
66 #
2929 'backend' => { type => 'leaf',
3030 class => 'Config::Model::Itself::BackendDetector' ,
3131 value_type => 'enum',
32 choice => [qw/cds_file perl_file ini_file augeas custom/],
32 choice => [qw/cds_file perl_file ini_file custom/],
3333
3434 help => {
3535 cds_file => "file ...",
3636 ini_file => "Ini file ...",
3737 perl_file => "file perl",
3838 custom => "Custom format",
39 augeas => "Experimental backend",
4039 }
4140 }
4241 ],
4242 close CDS ;
4343 }
4444
45 # trap warning if Augeas backend is not installed
46 if (not eval {require Config::Model::Backend::Augeas; } ) {
47 # do not use Test::Warnings with this
48 $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /unknown backend/};
49 }
50 else {
51 # workaround Augeas locale bug
52 no warnings qw/uninitialized/;
53 if ($ENV{LC_ALL} ne 'C' or $ENV{LANG} ne 'C') {
54 $ENV{LC_ALL} = $ENV{LANG} = 'C';
55 my $inc = join(' ',map("-I$_",@INC)) ;
56 exec("$^X $inc $0 @ARGV");
57 }
58 }
59
6045 plan tests => 15 ; # avoid double print of plan when exec is run
6146
6247 my $log4perl_user_conf_file = $ENV{HOME}.'/.log4config-model' ;
8570 rmtree($wr_test) if -d $wr_test ;
8671
8772 mkpath([$wr_conf1, $wr_model1, "$wr_conf1/etc/ssh/"], 0, 0755) ;
88 copy('augeas_box/etc/ssh/sshd_config', "$wr_conf1/etc/ssh/") ;
8973 dircopy('data',$wr_model1) || die "cannot copy model data:$!" ;
9074
9175 my $model = Config::Model->new(legacy => 'ignore',model_dir => $wr_model1 ) ;
3636 close CDS ;
3737 }
3838
39 # trap warning if Augeas backend is not installed
40 if (not eval {require Config::Model::Backend::Augeas; } ) {
41 # do not use Test::Warnings with this
42 $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /unknown backend/};
43 }
44 else {
45 # workaround Augeas locale bug
46 no warnings qw/uninitialized/;
47 if ($ENV{LC_ALL} ne 'C' or $ENV{LANG} ne 'C') {
48 $ENV{LC_ALL} = $ENV{LANG} = 'C';
49 my $inc = join(' ',map("-I$_",@INC)) ;
50 exec("$^X $inc $0 @ARGV");
51 }
52 }
53
5439 plan tests => 19 ; # avoid double print of plan when exec is run
5540
5641 my $meta_model = Config::Model -> new ( ) ;# model_dir => '.' );
6348
6449 # "modern" API of File::Path does not work with perl 5.8.8
6550 mkpath( [$wr_conf1, $wr_model1, "$wr_conf1/etc/ssh/"] , 0, 0755) ;
66 copy('augeas_box/etc/ssh/sshd_config', "$wr_conf1/etc/ssh/") ;
6751 dircopy('data',$wr_model1) || die "cannot copy model data:$!" ;
6852
6953 # copy test model
154138 'MasterModel::Slave',
155139 'MasterModel::WarpedValues'
156140 ],
157 'MasterModel/SshdWithAugeas.pl' => [
158 'MasterModel::SshdWithAugeas',
159 ],
160141 'MasterModel/References.pl' => [
161142 'MasterModel::References::Host',
162143 'MasterModel::References::If',
3939 my $wr_snippet = "$wr_test/wr_snippet";
4040
4141 my $meta_model = Config::Model -> new ( ) ;# model_dir => '.' );
42
43 Config::Model::Exception::Any->Trace(1) if $arg =~ /e/;
4442
4543 ok(1,"compiled");
4644
11 #
22 # This file is part of Config-Model-Itself
33 #
4 # This software is Copyright (c) 2012 by Dominique Dumont.
4 # This software is Copyright (c) 2013 by Dominique Dumont.
55 #
66 # This is free software, licensed under:
77 #