r44731 - in /trunk/libconfig-model-approx-perl: ./ debian/ lib/ lib/Config/ lib/Config/Model/ lib/Config/Model/models/ t/
ddumont-guest at users.alioth.debian.org
ddumont-guest at users.alioth.debian.org
Thu Sep 24 13:23:26 UTC 2009
Author: ddumont-guest
Date: Thu Sep 24 13:23:16 2009
New Revision: 44731
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=44731
Log:
[svn-inject] Installing original source of libconfig-model-approx-perl
Added:
trunk/libconfig-model-approx-perl/
trunk/libconfig-model-approx-perl/Build.PL
trunk/libconfig-model-approx-perl/ChangeLog
trunk/libconfig-model-approx-perl/Config-Model-Approx-1.001.tar.gz (with props)
trunk/libconfig-model-approx-perl/MANIFEST
trunk/libconfig-model-approx-perl/MANIFEST.SKIP
trunk/libconfig-model-approx-perl/META.yml
trunk/libconfig-model-approx-perl/README
trunk/libconfig-model-approx-perl/config-edit-approx (with props)
trunk/libconfig-model-approx-perl/debian/
trunk/libconfig-model-approx-perl/debian/changelog
trunk/libconfig-model-approx-perl/debian/compat
trunk/libconfig-model-approx-perl/debian/control
trunk/libconfig-model-approx-perl/debian/copyright
trunk/libconfig-model-approx-perl/debian/libconfig-model-approx-perl.docs
trunk/libconfig-model-approx-perl/debian/rules (with props)
trunk/libconfig-model-approx-perl/debian/watch
trunk/libconfig-model-approx-perl/lib/
trunk/libconfig-model-approx-perl/lib/Config/
trunk/libconfig-model-approx-perl/lib/Config/Model/
trunk/libconfig-model-approx-perl/lib/Config/Model/Approx.pm
trunk/libconfig-model-approx-perl/lib/Config/Model/models/
trunk/libconfig-model-approx-perl/lib/Config/Model/models/Approx.pl
trunk/libconfig-model-approx-perl/t/
trunk/libconfig-model-approx-perl/t/approx_config.t
Added: trunk/libconfig-model-approx-perl/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/Build.PL?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/Build.PL (added)
+++ trunk/libconfig-model-approx-perl/Build.PL Thu Sep 24 13:23:16 2009
@@ -1,0 +1,52 @@
+# $Author: ddumont $
+# $Date: 2009-09-24 12:00:47 +0200 (jeu 24 sep 2009) $
+# $Revision: 1031 $
+
+# Copyright (c) 2009 Dominique Dumont.
+#
+# This file is part of Config-Model-Approx.
+#
+# Config-Model is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# Config-Model is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser Public License for more details.
+#
+# You should have received a copy of the GNU Lesser Public License
+# along with Config-Model; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA
+
+use Module::Build;
+use Data::Dumper ;
+
+use warnings FATAL => qw(all) ;
+use strict ;
+
+
+my $build = Module::Build->new
+ (
+ module_name => 'Config::Model::Approx',
+ license => 'lgpl',
+ dist_author => "Dominique Dumont (ddumont at cpan dot org)",
+ dist_abstract => "Approx configuration files editor",
+ script_files => [ qw/config-edit-approx/ ],
+ requires => {
+ perl => '5.8.0',
+ 'Config::Model' => '0.637',
+ 'Log::Log4perl' => 0 ,
+ },
+ recommends => {
+ 'Config::Model::CursesUI' => 0, # Curses interface
+ 'Config::Model::TkUI' => 0, # graphical interface
+ },
+ add_to_cleanup => [qw/wr_test/] ,
+ );
+
+
+$build->add_build_element('pl');
+$build->create_build_script;
Added: trunk/libconfig-model-approx-perl/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/ChangeLog?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/ChangeLog (added)
+++ trunk/libconfig-model-approx-perl/ChangeLog Thu Sep 24 13:23:16 2009
@@ -1,0 +1,4 @@
+2009-09-24 Dominique Dumont <domi.dumont at free.fr> 1.001
+
+ * Initial release
+
Added: trunk/libconfig-model-approx-perl/Config-Model-Approx-1.001.tar.gz
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/Config-Model-Approx-1.001.tar.gz?rev=44731&op=file
==============================================================================
Binary file - no diff available.
Propchange: trunk/libconfig-model-approx-perl/Config-Model-Approx-1.001.tar.gz
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: trunk/libconfig-model-approx-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/MANIFEST?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/MANIFEST (added)
+++ trunk/libconfig-model-approx-perl/MANIFEST Thu Sep 24 13:23:16 2009
@@ -1,0 +1,9 @@
+Build.PL
+ChangeLog
+MANIFEST This list of files
+META.yml
+README
+config-edit-approx
+lib/Config/Model/Approx.pm
+lib/Config/Model/models/Approx.pl
+t/approx_config.t
Added: trunk/libconfig-model-approx-perl/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/MANIFEST.SKIP?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/MANIFEST.SKIP (added)
+++ trunk/libconfig-model-approx-perl/MANIFEST.SKIP Thu Sep 24 13:23:16 2009
@@ -1,0 +1,47 @@
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+,v$
+\B\.svn\b
+\B\.cvsignore$
+
+# Avoid Makemaker generated and utility files.
+\bMakefile$
+\bblib
+\bMakeMaker-\d
+\bpm_to_blib$
+\bblibdirs$
+^MANIFEST\.SKIP$
+
+# Avoid VMS specific Makmaker generated files
+\bDescrip.MMS$
+\bDESCRIP.MMS$
+\bdescrip.mms$
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\bBuild.bat$
+\b_build
+\bBuild.COM$
+\bBUILD.COM$
+\bbuild.com$
+
+# Avoid Devel::Cover generated files
+\bcover_db
+
+# Avoid temp and backup files.
+~$
+\.tmp$
+\.old$
+\.bak$
+\#$
+\.#
+\.rej$
+
+# Avoid OS-specific files/dirs
+# Mac OSX metadata
+\B\.DS_Store
+# Mac OSX SMB mount metadata files
+\B\._
+# Avoid archives of this distribution
+\bConfig-Model-Approx-[\d\.\_]+
Added: trunk/libconfig-model-approx-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/META.yml?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/META.yml (added)
+++ trunk/libconfig-model-approx-perl/META.yml Thu Sep 24 13:23:16 2009
@@ -1,0 +1,26 @@
+---
+name: Config-Model-Approx
+version: 1.001
+author:
+ - Dominique Dumont (ddumont at cpan dot org)
+abstract: Approx configuration files editor
+license: lgpl
+resources:
+ license: http://opensource.org/licenses/lgpl-license.php
+requires:
+ Config::Model: 0.637
+ Log::Log4perl: 0
+ perl: v5.8.0
+recommends:
+ Config::Model::CursesUI: 0
+ Config::Model::TkUI: 0
+configure_requires:
+ Module::Build: 0.35
+provides:
+ Config::Model::Approx:
+ file: lib/Config/Model/Approx.pm
+ version: 1.001
+generated_by: Module::Build version 0.35
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Added: trunk/libconfig-model-approx-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/README?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/README (added)
+++ trunk/libconfig-model-approx-perl/README Thu Sep 24 13:23:16 2009
@@ -1,0 +1,54 @@
+
+Config::Model::Approx - Approx graphical configuration editor
+
+This module provides a graphical configuration editor for
+/etc/approx/approx.conf.
+
+Main dependencies:
+- Config::Model::TkUI
+- Config::Model
+
+Suggested dependencies:
+- Config::Model::CursesUI to get a curses interface for the editor
+
+Once this module is installed, you can run:
+
+ # config-edit-approx
+
+If config-edit fails to load your approx.conf, you can try config-edit
+with -force option.
+
+--------------------------------------------------------------------
+MODULE CONTENT
+
+This Perl modules contains several files (listed in MANIFEST). Here
+are the purpose of the main files:
+- Build.PL : script to build the Perl module. See Module::Build(3pm)
+- lib/Config/Model/models : directory containing Approx model
+ file (Approx.pl).
+- lib/Config/Model/Approx.pm: Read and write approx.conf
+- t/ : non-regression tests
+
+--------------------------------------------------------------------
+
+AUTHOR
+ Copyright (c) 2009 Dominique Dumont.
+
+ This file is part of Config-Model-Approx. License is LGPL v2.
+
+
+ All help text provided in Approx models were extracted from
+ approx.conf(5) man page. I've slightly modified the text to better
+ suit an interactive editor.
+
+---------------------------------------------------------------------
+INSTALLATION
+
+ tar zxvf <dist_file>.tar.gz
+ cd <dist_directory>
+ perl Build.PL
+ ./Build test
+
+If you want to install this software without packaging, type also:
+
+ ./Build install
Added: trunk/libconfig-model-approx-perl/config-edit-approx
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/config-edit-approx?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/config-edit-approx (added)
+++ trunk/libconfig-model-approx-perl/config-edit-approx Thu Sep 24 13:23:16 2009
@@ -1,0 +1,146 @@
+#!/usr/bin/perl
+
+# Copyright (c) 2009 Dominique Dumont.
+#
+# This file is part of Config-Model-Approx.
+#
+# Config-Model is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# Config-Model is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser Public License for more details.
+#
+# You should have received a copy of the GNU Lesser Public License
+# along with Config-Model; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+# 02110-1301 USA
+
+use strict ;
+use warnings ;
+
+my @command = (qw/config-edit -model Approx/, @ARGV) ;
+
+# print "Calling @command\n";
+
+exec(@command)
+ or die "Cannot call config-edit: $!\nIs Config::Model installed ?\n";
+
+__END__
+
+=head1 NAME
+
+config-edit-approx - Edit data of /etc/approx/approx.conf
+
+=head1 SYNOPSIS
+
+ # most users will want to run
+ config-edit-approx [options] [ commands ... ]
+
+ # if you don't have a X server
+ config-edit-approx -ui curses [options] [ commands ... ]
+
+ # if you don't like curses
+ config-edit-approx -ui shell [options] [ commands ... ]
+
+ # if you are a sys admin
+ config-edit-approx -ui none [options] commands ...
+
+=head1 DESCRIPTION
+
+This program will edit the configuration data contained in
+F</etc/approx/approx.conf> (as root).
+
+You can specify commands as arguments that will be run on the
+configuration root before launching the UI. These command follow the
+syntax defined in L<Config::Model::Loader>.
+
+=head1 Options
+
+=over
+
+=item -ui
+
+Specify the user interface type.
+
+=over
+
+=item *
+
+C<tk>: provides a Tk graphical interface (If L<Config::Model::TkUI> is
+installed).
+
+=item *
+
+C<curses>: provides a curses user interface (If
+L<Config::Model::CursesUI> is installed).
+
+=item *
+
+C<shell>: provides a shell like interface. See L<Config::Model::TermUI>
+for details.
+
+=item *
+
+C<none>: No UI provided. Only command line arguments are handled.
+
+=back
+
+=item -verbose
+
+Be (very) verbose
+
+=item -debug
+
+Provide debug infos.
+
+=item -trace
+
+Provides a full stack trace when exiting on error.
+
+=item -force-load
+
+Load file even if error are found in data. Bad data are discarded
+
+=back
+
+=cut
+
+=head1 BUGS
+
+Original structure and comments of F</etc/approx/approx.conf> are
+lost. There's currently no Augeas lens for approx config data.
+
+=head1 SUPPORT
+
+For support, please check the following ressources:
+
+=over
+
+=item *
+
+The config-model wiki: L<http://config-model.wiki.sourceforge.net/>
+
+=item *
+
+The config-model users mailing list:
+L<http://lists.sourceforge.net/mailman/listinfo/config-model-users>
+
+=back
+
+=head1 AUTHOR
+
+Dominique Dumont, ddumont at cpan dot org
+
+=head1 SEE ALSO
+
+L<config-edit>, L<Config::Model>
+
+=cut
+
+
+
+
Propchange: trunk/libconfig-model-approx-perl/config-edit-approx
------------------------------------------------------------------------------
svn:executable =
Added: trunk/libconfig-model-approx-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/debian/changelog?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/debian/changelog (added)
+++ trunk/libconfig-model-approx-perl/debian/changelog Thu Sep 24 13:23:16 2009
@@ -1,0 +1,5 @@
+libconfig-model-approx-perl (1.001-1) UNRELEASED; urgency=low
+
+ * Initial Release. (Closes: #548193)
+
+ -- Dominique Dumont <dominique.dumont at hp.com> Thu, 24 Sep 2009 15:01:03 +0200
Added: trunk/libconfig-model-approx-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/debian/compat?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/debian/compat (added)
+++ trunk/libconfig-model-approx-perl/debian/compat Thu Sep 24 13:23:16 2009
@@ -1,0 +1,1 @@
+7
Added: trunk/libconfig-model-approx-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/debian/control?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/debian/control (added)
+++ trunk/libconfig-model-approx-perl/debian/control Thu Sep 24 13:23:16 2009
@@ -1,0 +1,35 @@
+Source: libconfig-model-approx-perl
+Section: perl
+Priority: optional
+Build-Depends: debhelper (>= 7), libmodule-build-perl
+Build-Depends-Indep: perl (>= 5.8.0), libconfig-model-perl (>= 0.637),
+ liblog-log4perl-perl
+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.3
+Homepage: http://search.cpan.org/dist/Config-Model-Approx/
+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/
+
+Package: libconfig-model-approx-perl
+Architecture: all
+Depends: ${perl:Depends}, ${misc:Depends}, perl (>= 5.8.0),
+ libconfig-model-perl (>= 0.637), liblog-log4perl-perl
+Recommends: libconfig-model-tkui-perl
+Suggests: libconfig-model-cursesui-perl
+Description: Approx configuration files editor
+ Config::Model::Approx and config-edit-approx provide a configuration
+ model and a configuration editor for /etc/approx/approx.conf.
+ .
+ When the following dependencies are installed, you will get extra
+ functionalities:
+ .
+ * A graphical Approx configuration editor and a graphical
+ configuration wizard with libconfig-model-tkui-perl
+ * A curses Approx configuration editor with
+ libconfig-model-cursesui-perl
+ .
+ When run with '-ui none', Approx configuration editor can also be
+ used as a command line to validate Approx configuration or to upgrade
+ an older configuration without user interaction.
Added: trunk/libconfig-model-approx-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/debian/copyright?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/debian/copyright (added)
+++ trunk/libconfig-model-approx-perl/debian/copyright Thu Sep 24 13:23:16 2009
@@ -1,0 +1,21 @@
+Format-Specification:
+ http://wiki.debian.org/Proposals/CopyrightFormat?action=recall&rev=196
+Upstream-Maintainer: Dominique Dumont (ddumont at cpan dot org)
+Upstream-Source: http://search.cpan.org/dist/Config-Model-Approx/
+Upstream-Name: Config-Model-Approx
+
+Files: *
+Copyright: 2009, Dominique Dumont (ddumont at cpan.org)
+License: LGPL-2+
+
+Files: debian/*
+Copyright: 2009, Dominique Dumont <dominique.dumont at hp.com>
+License: LGPL-2+
+
+License: LGPL-2+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+ On Debian GNU/Linux systems, the complete text of version 2 of the GNU
+ Lesser Public License can be found in `/usr/share/common-licenses/LGPL-2'
Added: trunk/libconfig-model-approx-perl/debian/libconfig-model-approx-perl.docs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/debian/libconfig-model-approx-perl.docs?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/debian/libconfig-model-approx-perl.docs (added)
+++ trunk/libconfig-model-approx-perl/debian/libconfig-model-approx-perl.docs Thu Sep 24 13:23:16 2009
@@ -1,0 +1,1 @@
+README
Added: trunk/libconfig-model-approx-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/debian/rules?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/debian/rules (added)
+++ trunk/libconfig-model-approx-perl/debian/rules Thu Sep 24 13:23:16 2009
@@ -1,0 +1,4 @@
+#!/usr/bin/make -f
+
+%:
+ dh $@
Propchange: trunk/libconfig-model-approx-perl/debian/rules
------------------------------------------------------------------------------
svn:executable =
Added: trunk/libconfig-model-approx-perl/debian/watch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/debian/watch?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/debian/watch (added)
+++ trunk/libconfig-model-approx-perl/debian/watch Thu Sep 24 13:23:16 2009
@@ -1,0 +1,2 @@
+version=3
+http://search.cpan.org/dist/Config-Model-Approx/ .*/Config-Model-Approx-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$
Added: trunk/libconfig-model-approx-perl/lib/Config/Model/Approx.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/lib/Config/Model/Approx.pm?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/lib/Config/Model/Approx.pm (added)
+++ trunk/libconfig-model-approx-perl/lib/Config/Model/Approx.pm Thu Sep 24 13:23:16 2009
@@ -1,0 +1,96 @@
+# $Author: ddumont $
+# $Date: 2009-09-24 12:00:47 +0200 (jeu 24 sep 2009) $
+# $Revision: 1031 $
+
+# Copyright (c) 2009 Dominique Dumont.
+#
+# This file is part of Config-Model-Approx.
+#
+# Config-Model-Approx is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser Public License as
+# published by the Free Software Foundation; either version 2.1 of
+# the License, or (at your option) any later version.
+#
+# Config-Model-Approx is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser Public License for more details.
+#
+# You should have received a copy of the GNU Lesser Public License
+# along with Config-Model; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+
+package Config::Model::Approx ;
+
+use strict ;
+use warnings ;
+
+use Carp ;
+use Log::Log4perl;
+use File::Copy ;
+use File::Path ;
+
+use vars qw($VERSION) ;
+
+$VERSION = '1.001' ;
+
+my $logger = Log::Log4perl::get_logger(__PACKAGE__);
+
+sub read {
+ # keys are object , root, config_dir, io_handle, file
+ my %args = @_ ;
+
+ $logger->info("loading config file $args{file}") if defined $args{file};
+
+ foreach ($args{io_handle}->getlines) {
+ chomp;
+ s/#.*//;
+ s/\s+/=/; # translate file in string loadable by C::M::Loader
+ next unless $_;
+ my $load = s/^\$// ? $_ : "distributions:".$_;
+ $args{object}->load($load) ;
+ }
+
+ return 1;
+}
+
+sub write {
+ my %args = @_ ;
+
+ $logger->info("writing config file $args{file}");
+ my $node = $args{object} ;
+ my $ioh = $args{io_handle} ;
+
+ $ioh->print("# This file was written by Config::Model with Approx model\n");
+ $ioh->print("# You may modify the content of this file. Configuration \n");
+ $ioh->print("# modification will be preserved. Modification in the comments\n");
+ $ioh->print("# will be discarded\n\n");
+
+ # Using Config::Model::ObjTreeScanner would be overkill
+ foreach my $elt ($node->get_element_name) {
+ next if $elt eq 'distributions';
+
+ # write some documentation in comments
+ $ioh->print("# $elt:", $node->get_help(summary => $elt));
+ my $upstream_default = $node->fetch_element($elt) -> fetch('upstream_default') ;
+ $ioh->print(" ($upstream_default)") if defined $upstream_default;
+ $ioh->print("\n") ;
+
+ # write value
+ my $v = $node->grab_value($elt) ;
+ $ioh->printf("\$%-10s %s\n",$elt,$v) if defined $v ;
+ $ioh->print("\n") ;
+ }
+
+ my $h = $node->fetch_element('distributions') ;
+ $ioh->print("# ", $node->get_help(summary => 'distributions'),"\n");
+ foreach my $dname ($h->get_all_indexes) {
+ $ioh->printf("%-10s %s\n",$dname,
+ $node->grab_value("distributions:$dname")
+ ) ;
+ }
+ return 1;
+
+}
+
+1;
Added: trunk/libconfig-model-approx-perl/lib/Config/Model/models/Approx.pl
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/lib/Config/Model/models/Approx.pl?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/lib/Config/Model/models/Approx.pl (added)
+++ trunk/libconfig-model-approx-perl/lib/Config/Model/models/Approx.pl Thu Sep 24 13:23:16 2009
@@ -1,0 +1,107 @@
+[
+ {
+ 'read_config' => [
+ {
+ 'file' => 'approx.conf',
+ 'backend' => 'custom',
+ 'class' => 'Config::Model::Approx',
+ 'config_dir' => '/etc/approx'
+ }
+ ],
+ 'name' => 'Approx',
+ 'element' => [
+ 'max_rate',
+ {
+ 'value_type' => 'uniline',
+ 'summary' => 'maximum download rate from remote repositories',
+ 'type' => 'leaf',
+ 'description' => "Specifies the maximum download rate from remote repositories, in bytes per second (default: unlimited). The value may be suf\x{2010} fixed with \"K\", \"M\", or \"G\" to indicate kilobytes, megabytes, or gigabytes per second, respectively."
+ },
+ 'max_redirects',
+ {
+ 'value_type' => 'integer',
+ 'summary' => 'maximum number of HTTP redirections',
+ 'upstream_default' => '5',
+ 'type' => 'leaf',
+ 'description' => 'Specifies the maximum number of HTTP redirections that will be followed when downloading a remote file'
+ },
+ 'user',
+ {
+ 'value_type' => 'uniline',
+ 'summary' => 'user that owns the files in the approx cache',
+ 'upstream_default' => 'approx',
+ 'type' => 'leaf'
+ },
+ 'group',
+ {
+ 'value_type' => 'uniline',
+ 'summary' => 'group that owns the files in the approx cache',
+ 'upstream_default' => 'approx',
+ 'type' => 'leaf'
+ },
+ 'syslog',
+ {
+ 'value_type' => 'uniline',
+ 'summary' => 'syslog(3) facility to use when logging',
+ 'upstream_default' => 'daemon',
+ 'type' => 'leaf'
+ },
+ 'pdiffs',
+ {
+ 'value_type' => 'boolean',
+ 'summary' => 'support IndexFile diffs',
+ 'upstream_default' => '1',
+ 'type' => 'leaf'
+ },
+ 'offline',
+ {
+ 'value_type' => 'boolean',
+ 'summary' => 'use cached files when offline',
+ 'upstream_default' => '0',
+ 'type' => 'leaf',
+ 'description' => 'Specifies whether to deliver (possibly out-of-date) cached files when they cannot be downloaded from remote repositories'
+ },
+ 'max_wait',
+ {
+ 'value_type' => 'integer',
+ 'summary' => 'max wait for concurrent file download',
+ 'upstream_default' => '10',
+ 'type' => 'leaf',
+ 'description' => 'Specifies how many seconds an approx(8) process will wait for a concurrent download of a file to complete, before attempting to download the file itself'
+ },
+ 'verbose',
+ {
+ 'value_type' => 'boolean',
+ 'upstream_default' => '0',
+ 'type' => 'leaf',
+ 'description' => 'Specifies whether informational messages should be printed in the log'
+ },
+ 'debug',
+ {
+ 'value_type' => 'boolean',
+ 'upstream_default' => '0',
+ 'type' => 'leaf',
+ 'description' => 'Specifies whether debug messages should be printed in the log'
+ },
+ 'distributions',
+ {
+ 'level' => 'important',
+ 'cargo' => {
+ 'value_type' => 'uniline',
+ 'type' => 'leaf'
+ },
+ 'summary' => 'remote repositories',
+ 'type' => 'hash',
+ 'description' => 'The other name/value pairs are used to map distribution names to remote repositories. For example,
+
+ debian => http://ftp.debian.org/debian
+ security => http://security.debian.org/debian-security
+
+Use the distribution name as the key of the hash element and the URL as the value
+',
+ 'index_type' => 'string'
+ }
+ ]
+ }
+ ]
+;
Added: trunk/libconfig-model-approx-perl/t/approx_config.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libconfig-model-approx-perl/t/approx_config.t?rev=44731&op=file
==============================================================================
--- trunk/libconfig-model-approx-perl/t/approx_config.t (added)
+++ trunk/libconfig-model-approx-perl/t/approx_config.t Thu Sep 24 13:23:16 2009
@@ -1,0 +1,89 @@
+# -*- cperl -*-
+# $Author: ddumont $
+# $Date: 2008-04-15 13:57:49 +0200 (mar, 15 avr 2008) $
+# $Revision: 608 $
+
+use ExtUtils::testlib;
+use Test::More tests => 4;
+use Config::Model ;
+use Log::Log4perl qw(:easy) ;
+use File::Path ;
+
+use warnings;
+
+use strict;
+
+my $arg = shift || '';
+
+my ($log,$show) = (0) x 2 ;
+
+my $trace = $arg =~ /t/ ? 1 : 0 ;
+$::verbose = 1 if $arg =~ /v/;
+$::debug = 1 if $arg =~ /d/;
+$log = 1 if $arg =~ /l/;
+$show = 1 if $arg =~ /s/;
+
+Log::Log4perl->easy_init($log ? $TRACE: $WARN);
+
+my $model = Config::Model -> new ( ) ;
+
+Config::Model::Exception::Any->Trace(1) if $arg =~ /e/;
+
+ok(1,"compiled");
+
+# pseudo root where config files are written by config-model
+my $wr_root = 'wr_test';
+
+my $testdir = 'approx_test' ;
+
+# cleanup before tests
+rmtree($wr_root);
+
+my @orig = <DATA> ;
+
+my $wr_dir = $wr_root.'/'.$testdir ;
+mkpath($wr_dir.'/etc/approx', { mode => 0755 })
+ || die "can't mkpath: $!";
+open(CONF,"> $wr_dir/etc/approx/approx.conf")
+ || die "can't open file: $!";
+print CONF @orig ;
+close CONF ;
+
+my $inst = $model->instance (root_class_name => 'Approx',
+ instance_name => 'approx_instance',
+ root_dir => $wr_dir,
+ );
+my $approx_conf = "$wr_dir/etc/approx/approx.conf";
+ok($inst,"Read $approx_conf and created instance") ;
+
+my $cfg = $inst -> config_root ;
+
+my $dump = $cfg->dump_tree ();
+print $dump if $trace ;
+
+my $expect = 'max_rate=100K
+verbose=1
+distributions:debian=http://ftp.debian.org/debian
+distributions:security=http://security.debian.org/debian-security -
+';
+
+is ($dump,$expect,"check data read from approx.conf") ;
+
+$cfg->load("max_rate=200K") ;
+
+$inst->write_back ;
+
+open(APPROX,$approx_conf) || die "Can't open $approx_conf:$!" ;
+my $approxlines = join('',<APPROX>) ;
+close APPROX;
+
+like($approxlines,qr/200K/,"checked written approx file") ;
+
+__END__
+
+
+$max_rate 100K
+$verbose 1
+
+debian http://ftp.debian.org/debian
+security http://security.debian.org/debian-security
More information about the Pkg-perl-cvs-commits
mailing list