r53397 - in /trunk/libconfig-model-itself-perl: Build.PL ChangeLog META.yml config-model-edit data/MasterModel/WarpedId.pl debian/changelog debian/control debian/copyright lib/Config/Model/models/Itself/CommonElement.pl
ddumont-guest at users.alioth.debian.org
ddumont-guest at users.alioth.debian.org
Sat Feb 27 16:59:28 UTC 2010
Author: ddumont-guest
Date: Sat Feb 27 16:59:14 2010
New Revision: 53397
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=53397
Log:
new upstream release. Ready for upload
Modified:
trunk/libconfig-model-itself-perl/Build.PL
trunk/libconfig-model-itself-perl/ChangeLog
trunk/libconfig-model-itself-perl/META.yml
trunk/libconfig-model-itself-perl/config-model-edit
trunk/libconfig-model-itself-perl/data/MasterModel/WarpedId.pl
trunk/libconfig-model-itself-perl/debian/changelog
trunk/libconfig-model-itself-perl/debian/control
trunk/libconfig-model-itself-perl/debian/copyright
trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl
Modified: trunk/libconfig-model-itself-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/Build.PL?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/Build.PL (original)
+++ trunk/libconfig-model-itself-perl/Build.PL Sat Feb 27 16:59:14 2010
@@ -2,7 +2,7 @@
# $Date: 2008-02-07 11:29:57 $
# $Revision: 1.3 $
-# Copyright (c) 2007-2009 Dominique Dumont.
+# Copyright (c) 2007-2010 Dominique Dumont.
#
# This file is part of Config-Model-Itself.
#
@@ -35,7 +35,7 @@
dist_author => "Dominique Dumont (ddumont at cpan dot org)",
dist_abstract => "Graphical model editor for Config::Model",
requires => {
- 'Config::Model' => '0.637',
+ 'Config::Model' => '0.643',
'Log::Log4perl' => 0 ,
'Config::Model::TkUI' => '1.210',
},
Modified: trunk/libconfig-model-itself-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/ChangeLog?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/ChangeLog (original)
+++ trunk/libconfig-model-itself-perl/ChangeLog Sat Feb 27 16:59:14 2010
@@ -1,3 +1,26 @@
+2010-02-26 Dominique Dumont <dominique.dumont at hp.com> 1.212
+
+ * Build.PL: depend on Config::Model 0.643
+
+2010-02-25 Dominique Dumont <dominique.dumont at hp.com>
+
+ * config-model-edit: added load_yaml option to load model from a
+ YAML file.
+
+2010-02-23 Dominique Dumont <dominique.dumont at hp.com>
+
+ * config-model-edit: added dump_yaml option to dump models as YAML
+ file.
+
+2010-02-02 Dominique Dumont <dominique.dumont at hp.com>
+
+ * config-model-edit: added -dump -dump_type -load options. Non
+ options args are now interpreted as model modifications
+
+2010-01-31 Dominique Dumont <domi.dumont at free.fr>
+
+ * lib/Config/Model/models/Itself/CommonElement.pl: warp out min and max
+
2009-06-24 Dominique Dumont <domi.dumont at free.fr> v1.211
* Build.PL: depend on Config::Model 0.637 and C::M::TkUI 1.210
@@ -25,7 +48,7 @@
0.635). Parameter allow_empty is deprecated and will be replaced
by auto_create when you run config-edit-model
-2009-04-03 Dominique Dumont <dominique.dumont at hp.com>
+2009-04-03 Dominique Dumont <dominique.dumont at hp.com>
* config-model-edit: new -dot_diagram option to get a dot file to
reprensent the structure of the configuration model
Modified: trunk/libconfig-model-itself-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/META.yml?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/META.yml (original)
+++ trunk/libconfig-model-itself-perl/META.yml Sat Feb 27 16:59:14 2010
@@ -1,24 +1,26 @@
---
+abstract: 'Graphical model editor for Config::Model'
+author:
+ - 'Dominique Dumont (ddumont at cpan dot org)'
+configure_requires:
+ Module::Build: 0.36
+generated_by: 'Module::Build version 0.3603'
+license: lgpl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
name: Config-Model-Itself
-version: 1.211
-author:
- - Dominique Dumont (ddumont at cpan dot org)
-abstract: Graphical model editor for Config::Model
-license: lgpl
-resources:
- license: http://opensource.org/licenses/lgpl-license.php
-requires:
- Config::Model: 0.637
- Config::Model::TkUI: 1.210
- Log::Log4perl: 0
provides:
Config::Model::Itself:
file: lib/Config/Model/Itself.pm
- version: 1.211
+ version: 1.212
Config::Model::Itself::TkEditUI:
file: lib/Config/Model/Itself/TkEditUI.pm
version: 1.0615
-generated_by: Module::Build version 0.33
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.4.html
- version: 1.4
+requires:
+ Config::Model: 0.643
+ Config::Model::TkUI: 1.210
+ Log::Log4perl: 0
+resources:
+ license: http://opensource.org/licenses/lgpl-license.php
+version: 1.212
Modified: trunk/libconfig-model-itself-perl/config-model-edit
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/config-model-edit?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/config-model-edit (original)
+++ trunk/libconfig-model-itself-perl/config-model-edit Sat Feb 27 16:59:14 2010
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# Copyright (c) 2007-2009 Dominique Dumont.
+# Copyright (c) 2007-2010 Dominique Dumont.
#
# This file is part of Config-Model-Itself.
#
@@ -34,7 +34,7 @@
# lame tracing that will be replaced by Log4perl
use vars qw/$verbose $debug $VERSION/ ;
-$VERSION = sprintf "1.%04d", q$Revision: 970 $ =~ /(\d+)/;
+$VERSION = sprintf "1.%04d", q$Revision: 1094 $ =~ /(\d+)/;
$verbose = 0;
$debug = 0;
@@ -69,7 +69,7 @@
=head1 SYNOPSIS
- config-model-edit [options] -model Xorg
+ config-model-edit [options] -model Sshd [ class:Sshd element:Foo ... ]
=head1 DESCRIPTION
@@ -118,14 +118,8 @@
=item -model
-Mandatory option that specifies the configuration data to be
-edited. By default, installed models will be edited. If you are
-running E.g. this command:
-
- config-edit -model Fstab
-
-will look for C</etc/config-model.d/Fstab.pl> model file. See
-L<Config::Model> for more details.
+Mandatory option that specifies the configuration model to be
+edited.
=item -verbose
@@ -150,6 +144,34 @@
(i.e. C<config_class_name> parameter) is represented by dashed
lines. The name of the element is attached to the dashed line.
+=item -dump [ file ]
+
+Dump configuration content on STDOUT or in the specified with
+Config::Model syntax.
+
+By default, dump only custom values, i.e. different from application
+built-in values or model default values. See -dumptype option for
+other types of dump
+
+=item -dumptype [ full | preset | custom ]
+
+Choose to dump every values (full), only preset values or only
+customized values (default)
+
+=item -load <cds_file_to_load> | -
+
+Load model from cds file (using Config::Model serialisation format,
+typically done with -dump option). This option can be used with
+C<-save> to directly save a model loaded from the cds file or from
+STDIN.
+
+=item -load_yaml <yaml_file_to_load> | -
+
+Load configuration data in model from cds file (using Config::Model
+serialisation format, typically done with -dump_yaml option). This
+option can be used with C<-save> to directly save a model loaded from
+the YAML file or from STDIN.
+
=item -save
Force a save of the model even if no edition was done. This option is
@@ -159,13 +181,34 @@
=cut
+
+sub load_data {
+ my $load_file = shift ;
+
+ my @data ;
+ if ( $load_file eq '-' ) {
+ @data = <STDIN> ;
+ }
+ else {
+ open(LOAD,$load_file) || die "cannot open load file $load_file:$!";
+ @data = <LOAD> ;
+ close LOAD;
+ }
+
+ return wantarray ? @data : join('', at data);
+}
my $man = 0;
my $help = 0;
my $force_load = 0;
my $model_dir ;
my $do_dot = 0;
+my $do_dump;
+my $dumptype;
+my $do_yaml = 0;
+my $load_yaml ;
my $save = 0;
+my $load ;
my $result = GetOptions (
"dir=s" => \$model_dir,
@@ -178,6 +221,11 @@
"force_load!" => \$force_load,
"save!" => \$save,
"dot_diagram!" => \$do_dot ,
+ "dump!" => \$do_dump ,
+ "dumptype:s" => \$dumptype,
+ "load=s" => \$load,
+ "load_yaml=s" => \$load_yaml,
+ "dump_yaml!" => \$do_yaml ,
);
pod2usage(2) if not $result ;
@@ -223,8 +271,45 @@
legacy =>'ignore',
) ;
+if (defined $load) {
+ my $data = load_data($load) ;
+ $meta_root->load($data);
+}
+
+if (defined $load_yaml) {
+ my $yaml = load_data($load_yaml) ;
+ require YAML::Tiny;
+ import YAML::Tiny qw/Load/;
+ my $pdata = Load($yaml) ;
+ $meta_root->load_data($pdata) ;
+}
+
+if (@ARGV) {
+ $meta_root->load("@ARGV") ;
+}
+
if ($do_dot) {
print $rw_obj->get_dot_diagram ;
+ exit ;
+}
+
+if (defined $do_dump) {
+ my $dump_string = $meta_root->dump_tree( mode => $dumptype || 'custom' ) ;
+ if ($do_dump) {
+ open(DUMP,">$do_dump") or die "cannot dump in $do_dump:$!";
+ print DUMP $dump_string ;
+ close DUMP;
+ }
+ else {
+ print $dump_string ;
+ }
+ exit ;
+}
+
+if ($do_yaml) {
+ require YAML::Tiny;
+ import YAML::Tiny qw/Dump/;
+ print Dump($meta_root->dump_as_data(ordered_hash_as_list => 0)) ;
exit ;
}
@@ -240,6 +325,8 @@
my $mw = MainWindow-> new ;
$mw->withdraw ;
+# Thanks to Jerome Quelin for the tip
+$mw->optionAdd('*BorderWidth' => 1);
my $cmu = $mw->ConfigModelEditUI (-root => $meta_root,
-store_sub => $write_sub,
@@ -250,13 +337,42 @@
&MainLoop ; # Tk's
+=head1 LOGGING
+
+All Config::Model logging is (slowly) moved from klunky debug and
+verbose prints to L<Log::Log4perl>. Logging can be configured in the
+following files:
+
+=over
+
+=item *
+
+ ~/.log4config-model
+
+=item *
+
+ /etc/log4config-model.conf
+
+=back
+
+Without these files, the following Log4perl config is used:
+
+ log4perl.logger=WARN, Screen
+ log4perl.appender.Screen = Log::Log4perl::Appender::Screen
+ log4perl.appender.Screen.stderr = 0
+ log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
+ log4perl.appender.Screen.layout.ConversionPattern = %d %m %n
+
+Log4Perl categories are shown in L<config-edit/LOGGING>
+
=head1 AUTHOR
Dominique Dumont, ddumont at cpan dot org
=head1 SEE ALSO
-L<Config::Model::Model>,
+L<Config::Model>,
+L<Config::Model::Node>,
L<Config::Model::Instance>,
L<Config::Model::HashId>,
L<Config::Model::ListId>,
Modified: trunk/libconfig-model-itself-perl/data/MasterModel/WarpedId.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/data/MasterModel/WarpedId.pl?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/data/MasterModel/WarpedId.pl (original)
+++ trunk/libconfig-model-itself-perl/data/MasterModel/WarpedId.pl Sat Feb 27 16:59:14 2010
@@ -36,8 +36,8 @@
'multi_warp'
=> { type => 'hash',
index_type => 'integer',
- min => 0,
- max => 3,
+ min_index => 0,
+ max_index => 3,
default => [ 0 .. 3 ],
warp
=> {
@@ -77,8 +77,8 @@
'multi_auto_create'
=> { type => 'hash',
index_type => 'integer',
- min => 0,
- max => 3,
+ min_index => 0,
+ max_index => 3,
auto_create => [ 0 .. 3 ],
'warp'
=> { follow => [ '- version', '- macro' ],
Modified: trunk/libconfig-model-itself-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/debian/changelog?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/debian/changelog (original)
+++ trunk/libconfig-model-itself-perl/debian/changelog Sat Feb 27 16:59:14 2010
@@ -1,3 +1,13 @@
+libconfig-model-itself-perl (1.212-1) UNRELEASED; urgency=low
+
+ * New upstream release
+ * debian/control: Depends and libconfig-model-perl 0.643 and
+ libconfig-model-tkui-perl >= 1.303 (avoid warnings). Updated to
+ Standard version 3.8.4
+ * debian/copyright: updated year
+
+ -- Dominique Dumont <dominique.dumont at hp.com> Sat, 27 Feb 2010 17:54:25 +0100
+
libconfig-model-itself-perl (1.211-2) UNRELEASED; urgency=low
* debian/control: Changed: (build-)depend on perl instead of perl-
@@ -12,7 +22,7 @@
[ Dominique Dumont ]
* New upstream release
- * control: depends on libconfig-model-perl 0.637 and
+ * control: depends on libconfig-model-perl 0.637 and
libconfig-model-tkui-perl 1.210
* control: updated to policy 3.8.2
Modified: trunk/libconfig-model-itself-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/debian/control?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/debian/control (original)
+++ trunk/libconfig-model-itself-perl/debian/control Sat Feb 27 16:59:14 2010
@@ -4,14 +4,14 @@
Build-Depends: debhelper (>= 7),
perl (>= 5.10) | libmodule-build-perl
Build-Depends-Indep: perl (>= 5.8.8-12),
- libconfig-model-perl (>= 0.637),
- libconfig-model-tkui-perl (>= 1.210),
+ libconfig-model-perl (>= 0.643),
+ libconfig-model-tkui-perl (>= 1.303),
libtest-pod-perl,
liblog-log4perl-perl (>= 1.11)
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Dominique Dumont <dominique.dumont at hp.com>,
gregor herrmann <gregoa at debian.org>
-Standards-Version: 3.8.2
+Standards-Version: 3.8.4
Homepage: http://search.cpan.org/dist/Config-Model-Itself/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libconfig-model-itself-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libconfig-model-itself-perl/
@@ -19,8 +19,8 @@
Package: libconfig-model-itself-perl
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends},
- libconfig-model-perl (>= 0.637),
- libconfig-model-tkui-perl (>= 1.210),
+ libconfig-model-perl (>= 0.643),
+ libconfig-model-tkui-perl (>= 1.303),
liblog-log4perl-perl (>= 1.11)
Description: graphical model editor for Config::Model
Config::Model::Itself and the command config-model-edit provide
Modified: trunk/libconfig-model-itself-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/debian/copyright?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/debian/copyright (original)
+++ trunk/libconfig-model-itself-perl/debian/copyright Sat Feb 27 16:59:14 2010
@@ -5,11 +5,11 @@
Upstream-Name: Config-Model-Itself
Files: *
-Copyright: 2007-2009, Dominique Dumont (ddumont at cpan.org)
+Copyright: 2007-2010, Dominique Dumont (ddumont at cpan.org)
License: LGPL-2+
Files: debian/*
-Copyright: 2009, Dominique Dumont <dominique.dumont at hp.com>
+Copyright: 2009-2010, Dominique Dumont <dominique.dumont at hp.com>
License: LGPL-2+
License: LGPL-2+
Modified: trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl?rev=53397&op=diff
==============================================================================
--- trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl (original)
+++ trunk/libconfig-model-itself-perl/lib/Config/Model/models/Itself/CommonElement.pl Sat Feb 27 16:59:14 2010
@@ -2,7 +2,7 @@
# $Date: 2008-04-11 18:20:21 +0200 (ven, 11 avr 2008) $
# $Revision: 600 $
-# Copyright (c) 2007-2008 Dominique Dumont.
+# Copyright (c) 2007-2010 Dominique Dumont.
#
# This file is part of Config-Model-Itself.
#
@@ -92,25 +92,72 @@
cargo => { type => 'leaf', value_type => 'uniline'},
},
- [qw/min max/]
- => { type => 'leaf',
- value_type => 'integer',
- level => 'hidden',
+ 'min'
+ => { type => 'leaf',
+ value_type => 'integer',
+ level => 'hidden',
+ description => 'minimum value',
warp => { follow => {
'type' => '?type',
'vtype' => '?value_type' ,
},
'rules'
- => [ '$type eq "hash"
- or
- ( $type eq "leaf"
- and ( $vtype eq "integer"
- or $vtype eq "number"
- )
- ) '
+ => [ ' $type eq "leaf"
+ and ( $vtype eq "integer"
+ or $vtype eq "number"
+ )
+ '
=> {
level => 'normal',
}
+ ]
+ }
+ },
+
+ 'max'
+ => { type => 'leaf',
+ value_type => 'integer',
+ level => 'hidden',
+ description => 'maximum value',
+ warp => { follow => {
+ 'type' => '?type',
+ 'vtype' => '?value_type' ,
+ },
+ 'rules'
+ => [ ' $type eq "leaf"
+ and ( $vtype eq "integer"
+ or $vtype eq "number"
+ )
+ '
+ => {
+ level => 'normal',
+ }
+ ]
+ }
+ },
+
+ 'min_index'
+ => { type => 'leaf',
+ value_type => 'integer',
+ level => 'hidden',
+ description => 'minimum number of indexes',
+ warp => { follow => {'type' => '?type',},
+ 'rules'
+ => [ '$type eq "hash" or $type eq "list"'
+ => {level => 'normal',},
+ ]
+ }
+ },
+
+ 'max_index'
+ => { type => 'leaf',
+ value_type => 'integer',
+ level => 'hidden',
+ description => 'maximum number of keys',
+ warp => { follow => {'type' => '?type',},
+ 'rules'
+ => [ '$type eq "hash" or $type eq "list"'
+ => {level => 'normal',},
]
}
},
More information about the Pkg-perl-cvs-commits
mailing list