.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{ . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "CME 1p" .TH CME 1p "2014-09-24" "perl v5.20.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" cme \- Edit data of configuration managed by Config::Model .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& # general synopsis \& cme [ global_options ] command application [ options ] [ file ] [ ~~ ] [ modification_instructions ] \& \& # edit dpkg config with GUI (requires Config::Model::Dpkg) \& cme edit dpkg \& \& # force usage of simple shell like interface \& cme edit dpkg\-copyright \-\-ui shell \& \& # read data from arbitrary file \& cme check dpkg\-copyright path/to/file \& \& # edit /etc/sshd_config (requires Config::Model::OpenSsh) \& sudo cme edit sshd \& \& # edit ~/.ssh/config (requires Config::Model::OpenSsh) \& cme edit ssh \& \& # just check the validity of a file \& cme check multistrap file.conf \& \& # check dpkg files, update deprecated parameters and save \& cme migrate dpkg \& \& # like migrate, but also apply all suggested fixes \& cme fix dpkg \& \& # modify configuration with command line \& cme modify dpkg source \*(Aqformat="(3.0) quilt"\*(Aq \& \& # likewise with an application that accepts file override \& cme modify dpkg\-copyright ~~ \*(AqComment="Modified with cme"\*(Aq \& \& # edit a file (file name specification is mandatory here) \& cme edit multistrap my.conf \& \& # map conf data to a fuse file system \& cme fusefs multistrap my.conf \-d fuse_dir \& \& # likewise for dpkg data \& cme fusefs dpkg \-d fuse_dir \& \& # list all available applications (depends on your installation) \& cme list .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Depending on the commmand described below, \f(CW\*(C`cme\*(C'\fR program will use Config::Model configuration descriptions to check or modify or fix configuration files. .PP The 3rd parameter specify the application you want to work on. Most of the time, the relevant configuration file(s) will be found by cme. This is the most simple case. For instance: .PP .Vb 1 \& sudo cme check popcon .Ve .PP Some application like \f(CW\*(C`multistrap\*(C'\fR have no constraint on the configuration file name and will require you to specify your configuration file name: .PP .Vb 1 \& cme check multistrap raspbian.conf .Ve .SH "Configuration file specification" .IX Header "Configuration file specification" The configuration of an application can take different forms. Either several files (like debian packages), a single file with a predefined file (popcon), or a single file with an arbitrary file name (multistrap). .PP When needed the configuration file name is specified as the 3rd command argument, i.e. \f(CW\*(C`cme command application file_name\*(C'\fR. This applies if the application requires a configuration file name (like multistrap), or if the application allows configuration file override. .PP When the overridden file is \f(CW\*(C`\-\*(C'\fR (a single dash), the configuration is read from \s-1STDIN.\s0 The resulting file may be written on \s-1STDOUT. I\s0.e. .PP .Vb 1 \& cat debian/confrol | cme migrate dpkg\-control \-save \- .Ve .PP will output a fixed control file on \s-1STDOUT.\s0 .SH "Commands" .IX Header "Commands" .SS "list" .IX Subsection "list" Show a list all applications where a model is available. This list depends on installed Config::Model modules. .SS "edit" .IX Subsection "edit" Edit a configuration. By default, a Tk \s-1GUI\s0 will be opened If Config::Model::TkUI is installed. You can choose another user interface with the \f(CW\*(C`\-ui\*(C'\fR option: .IP "\(bu" 4 \&\f(CW\*(C`tk\*(C'\fR: provides a Tk graphical interface (If Config::Model::TkUI is installed). .IP "\(bu" 4 \&\f(CW\*(C`curses\*(C'\fR: provides a curses user interface (If Config::Model::CursesUI is installed). .IP "\(bu" 4 \&\f(CW\*(C`shell\*(C'\fR: provides a shell like interface. See Config::Model::TermUI for details. .SS "shell" .IX Subsection "shell" Edit the configuration with a shell like interface. See Config::Model::TermUI for details. This is a shortcut for \f(CW\*(C`edit \-ui shell\*(C'\fR. .SS "check" .IX Subsection "check" Checks the content of the configuration file of an application. Prints warnings and errors on \s-1STDOUT.\s0 .PP Example: .PP .Vb 1 \& cme check fstab .Ve .PP Some applications will allow to override the default configuration file. For instance: .PP .Vb 2 \& curl http://metadata.ftp\-master.debian.org/changelogs/main/f/frozen\-bubble/unstable_copyright \e \& | cme check dpkg\-copyright \- .Ve .SS "migrate" .IX Subsection "migrate" Checks the content of the configuration file of an application (and show warnings if needed), update deprecated parameters (old value are saved to new parameters) and save the new configuration. .PP For more details, see \*(L"Upgrade\*(R" in Config::Model::Value .SS "fix" .IX Subsection "fix" A bit like \f(CW\*(C`migrate\*(C'\fR command, except that warnings are fixed. The configuration is saved if anything was changed. If no changes are done, the file is not saved. Options are: .IP "from" 4 .IX Item "from" Use option \f(CW\*(C`\-from\*(C'\fR to fix only a subset of a configuration tree. Example: .Sp .Vb 1 \& cme fix dpkg \-from \*(Aqcontrol binary:foo Depends\*(Aq .Ve .Sp This option can be repeated: .Sp .Vb 1 \& cme fix dpkg \-from \*(Aqcontrol binary:foo Depends\*(Aq \-from \*(Aqcontrol source Build\-Depends\*(Aq .Ve .IP "filter" 4 .IX Item "filter" Filter the leaf according to a pattern. The pattern is applied to the element name to be fixed Example: .Sp .Vb 1 \& cme fix dpkg \-from control \-filter Build # will fix all Build\-Depends and Build\-Depend\-Indep .Ve .Sp or .Sp .Vb 1 \& cme fix dpkg \-filter Depend .Ve .SS "modify" .IX Subsection "modify" Modify a configuration file with the values passed on the command line. These command must follow the syntax defined in Config::Model::Loader (which is similar to the output of cme dump command) .PP Example: .PP .Vb 2 \& cme modify dpkg source format="(3.0) quilt" \& cme modify multistrap my_mstrap.conf sections:base source="http://ftp.fr.debian.org" .Ve .PP Some application like dpkg-copyright allows you to override the configuration file name. The problem is to make the difference between the overridden file name and the modification instruction you want to apply. .PP Either you specify both overridden file name modifications: .PP .Vb 1 \& cme modify dpkg\-copyright ubuntu/copyright \*(AqComment="Silly example" .Ve .PP Or you use \f(CW\*(C`~~\*(C'\fR to use the default file name: .PP .Vb 1 \& cme modify dpkg\-copyright ~~ \*(AqComment="Another silly example" .Ve .PP Another example which restores the default value of the text of all \s-1GPL\s0 like licenses : .PP .Vb 1 \& cme modify dpkg\-copyright ~~ \*(AqLicense=~/GPL/ text~\*(Aq .Ve .PP Or update the copyright years of the package maintainer's file: .PP .Vb 1 \& cme modify dpkg\-copyright ~~ \*(AqFile=debian/* Copyright=~s/2013/2014/\*(Aq .Ve .SS "search" .IX Subsection "search" You can search the configuration with the following options .IP "\-search" 4 .IX Item "-search" Specifies a string or pattern to search. \f(CW\*(C`cme\*(C'\fR will a list of path pointing to the matching tree element and their value. See \*(L"grab(...)\*(R" in Config::Model::AnyThing for details on the path syntax. .IP "\-narrow\-search" 4 .IX Item "-narrow-search" Narrows down the search to: .RS 4 .IP "element" 4 .IX Item "element" .PD 0 .IP "value" 4 .IX Item "value" .IP "key" 4 .IX Item "key" .IP "summary" 4 .IX Item "summary" .PD Summary text .IP "description" 4 .IX Item "description" description text .IP "help" 4 .IX Item "help" value help text .RE .RS 4 .RE .PP Example: .PP .Vb 4 \& $ cme search multistrap my_mstrap.conf \-search http \-narrow value \& sections:base source \-> \*(Aqhttp://ftp.fr.debian.org\*(Aq \& sections:debian source \-> \*(Aqhttp://ftp.uk.debian.org/debian\*(Aq \& sections:toolchains source \-> \*(Aqhttp://www.emdebian.org/debian\*(Aq .Ve .SS "dump" .IX Subsection "dump" Dump configuration content on \s-1STDOUT\s0 with Config::Model syntax. .PP By default, dump only custom values, i.e. different from application built-in values or model default values. You can use the \f(CW\*(C`\-dumptype\*(C'\fR option for other types of dump: .PP .Vb 1 \& \-dumptype [ full | preset | custom ] .Ve .PP Choose to dump every values (full), only preset values or only customized values (default) .SS "fusefs" .IX Subsection "fusefs" Map the configuration file content to a \s-1FUSE\s0 virtual file system on a directory specified with option \f(CW\*(C`\-fuse\-dir\*(C'\fR. To stop (and write the configuration data back to the configuration file), run \f(CW\*(C`fusermount \&\-u \*(C'\fR. .PP Options: .IP "\-fuse\-dir" 4 .IX Item "-fuse-dir" Mandatory. Directory where the virtual file system will be mounted. .IP "\-dfuse" 4 .IX Item "-dfuse" Use this option to debug fuse problems. .IP "\-dir\-char" 4 .IX Item "-dir-char" Fuse will fail if an element name or key name contains '/'. You can specify a subsitution string to replace '/' in the fused dir. Default is \f(CW\*(C`\*(C'\fR. .SH "Global options" .IX Header "Global options" The following options are available for all commands: .IP "\-create" 4 .IX Item "-create" Perform the operation even if the configuration file is missing. This may be used to create a minimal configuration file. This option is disabled by default as a missing configuration file often indicates an error during the installation of the application. .IP "\-force\-load" 4 .IX Item "-force-load" Load file even if error are found in data. Bad data are discarded .IP "\-backup" 4 .IX Item "-backup" Create a backup of configuration files before saving. By default, \f(CW\*(C`old\*(C'\fR will be appended to the backup file. I.e. \f(CW\*(C`foo.conf\*(C'\fR will be backed up as \f(CW\*(C`foo.conf.old\*(C'\fR. You can specify an alternate suffix. For instance \f(CW\*(C`\-backup dpkg\-old\*(C'\fR. .IP "\-save" 4 .IX Item "-save" Force a save even if no change was done. Useful to reformat the configuration file. .IP "\-strict" 4 .IX Item "-strict" When set, cme will exit 1 if warnings are found during check (of left after fix) .SH "Advanced options" .IX Header "Advanced options" .IP "\-dev" 4 .IX Item "-dev" Use this option if you want to test a model under development. This option will add \f(CW\*(C`lib\*(C'\fR in \f(CW@INC\fR and use \f(CW\*(C`lib/Config/Model/models\*(C'\fR as model directory. This option is ignored when run as root. .IP "\-model\-dir" 4 .IX Item "-model-dir" Specify an alternate directory to find model files. Mostly useful for tests. .IP "\-root\-dir" 4 .IX Item "-root-dir" Specify a pseudo root directory to read and write the configuration files. (Actual default directory and file names depends on the model (See \f(CW\*(C`\-model\*(C'\fR option). For instance, if you specify \f(CW\*(C`~/mytest\*(C'\fR, the \&\f(CW\*(C`/etc/ssh/sshd_config\*(C'\fR files will be written in \f(CW\*(C`~/mytest/etc/ssh/\*(C'\fR directory. .IP "\-stack\-trace" 4 .IX Item "-stack-trace" Provides a full stack trace when exiting on error. .IP "\-backend" 4 .IX Item "-backend" Specify a read/write backend. The actual backend name depends on the model passed to \f(CW\*(C`\-model\*(C'\fR option. See Config::Model::BackendMgr for details. .IP "\-try\-app\-as\-model" 4 .IX Item "-try-app-as-model" When set, try to load a model using directly the application name specified as 3rd parameter on the command line. Experimental. .SH "Embedding cme" .IX Header "Embedding cme" You can use cme from another program by using \f(CW\*(C`\-ui simple\*(C'\fR option. This way you will be able to send command on the standard input of \f(CW\*(C`cme\*(C'\fR and get the results from the standard output. .SH "cme extensions" .IX Header "cme extensions" New \f(CW\*(C`cme\*(C'\fR subcommands can be placed in extensions directory (i.e. in \&\f(CW\*(C`Config/Model/extensions\*(C'\fR. When a cme command matched one of this extension, the extension will be run. For instance, if you have: .PP .Vb 1 \& .../Config/Model/extensions/cme\-foo .Ve .PP Running \f(CW\*(C`cme foo\*(C'\fR will run this program (who must be written in Perl) with the same arguments as \f(CW\*(C`cme\*(C'\fR. .SH "Logging" .IX Header "Logging" All Config::Model logging is now based on Log::Log4perl. Logging can be configured in the following files: .IP "\(bu" 4 .Sp .Vb 1 \& ~/.log4config\-model .Ve .IP "\(bu" 4 .Sp .Vb 1 \& /etc/log4config\-model.conf .Ve .PP A sample of a \f(CW\*(C`.log4config\-model\*(C'\fR is provided in contrib directory in \f(CW\*(C`Config::Model\*(C'\fR distribution of on github .PP Without these files, the following Log4perl config is used: .PP .Vb 5 \& 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 .Ve .PP Log4perl uses the following categories: .IP "Anything" 4 .IX Item "Anything" .PD 0 .IP "Anything::Change" 4 .IX Item "Anything::Change" .PD Trace change notification through configuration tree and instance. .IP "Backend" 4 .IX Item "Backend" .PD 0 .IP "Backend::Debian::Dpkg" 4 .IX Item "Backend::Debian::Dpkg" .IP "Backend::Debian::Dpkg::Control" 4 .IX Item "Backend::Debian::Dpkg::Control" .IP "Backend::Debian::Dpkg::Copyright" 4 .IX Item "Backend::Debian::Dpkg::Copyright" .IP "Backend::Fstab" 4 .IX Item "Backend::Fstab" .IP "Backend::IniFile" 4 .IX Item "Backend::IniFile" .IP "Backend::PlainFile" 4 .IX Item "Backend::PlainFile" .IP "Backend::ShellVar" 4 .IX Item "Backend::ShellVar" .IP "Backend::Yaml" 4 .IX Item "Backend::Yaml" .IP "FuseUI" 4 .IX Item "FuseUI" .IP "Instance" 4 .IX Item "Instance" .IP "Loader" 4 .IX Item "Loader" .IP "Model::Searcher" 4 .IX Item "Model::Searcher" .IP "Tree::Element::CheckList" 4 .IX Item "Tree::Element::CheckList" .IP "Tree::Element::Id" 4 .IX Item "Tree::Element::Id" .IP "Tree::Element::Id::Hash" 4 .IX Item "Tree::Element::Id::Hash" .IP "Tree::Element::Id::List" 4 .IX Item "Tree::Element::Id::List" .IP "Tree::Element::Value" 4 .IX Item "Tree::Element::Value" .IP "Tree::Element::Value::Dependency" 4 .IX Item "Tree::Element::Value::Dependency" .IP "Tree::Node" 4 .IX Item "Tree::Node" .IP "Tree::Node::Warped" 4 .IX Item "Tree::Node::Warped" .IP "ValueComputer" 4 .IX Item "ValueComputer" .IP "Warper" 4 .IX Item "Warper" .IP "Wizard::Helper" 4 .IX Item "Wizard::Helper" .IP "Model" 4 .IX Item "Model" .PD .PP More categories will come. .SH "EXIT CODE" .IX Header "EXIT CODE" cme exits 0 when no errors are found. Exit 1 otherwise. .PP If \f(CW\*(C`\-strict\*(C'\fR option is set, cme will exit 1 when warnings are still present when the program ends. .SH "BUGS" .IX Header "BUGS" .SS "Configuration models can lag behind the target application" .IX Subsection "Configuration models can lag behind the target application" If a configuration model is not up-to-date, you will get errors complaining about unknown parameters. In such a case, please file a bug on request tracked or fix the model and send a pull request. You can see this example from OpenSsh to learn how to fix a model. .SH "SUPPORT" .IX Header "SUPPORT" For support, please check the following resources: .IP "\(bu" 4 The config-model users mailing list: .Sp .Vb 1 \& config\-model\-users at lists.sourceforge.net .Ve .IP "\(bu" 4 The config-model wiki: .SH "FEEDBACKS" .IX Header "FEEDBACKS" Feedback from users are highly desired. If you find this module useful, please share your use cases, success stories with the author or with the config\-model\- users mailing list. .SH "AUTHOR" .IX Header "AUTHOR" Dominique Dumont, ddumont at cpan dot org .SH "SEE ALSO" .IX Header "SEE ALSO" Config::Model::Model, Config::Model::Instance, Config::Model::Node, Config::Model::HashId, Config::Model::ListId, Config::Model::WarpedNode, Config::Model::Value