[publican-list] Overriding settings in publican.cfg

Jeffrey Fearn jfearn at redhat.com
Wed Feb 10 22:19:27 UTC 2010


Jared Smith wrote:
> Would it be possible to make it so that we can override the settings
> from publican.cfg?
> 
> In the older versions of Publican which were build on make files, it was
> easy to do things such as:
> 
> CONDITION=red-pill make pdf-en-US
> CONDITION=blue-pill make pdf-en-US
> 
> Now that Publican no longer uses make files, it's difficult to easily
> override the settings in publican.cfg.  The two options I've though of
> are:
> 
> 1) allow environment variables to override the settings in publican.cfg
> 
>  or
> 
> 2) Allow Publican to look for another configuration file via another
> command-line switch, such as publican --config foo.cfg build
> --formats=html-single --langs=en-US
>
> Thoughts?  Ideas?  

Number 2, publican --config foo.cfg, was already supposed to work, 
however there was a bug in the way the argument was specified was it was 
treating it as a switch instead of a string. Also it was missing from 
the help text.

I checked in a fix.

$ publican --help


Usage:
     publican <global options>

     publican <action> <options>

     Global Options

         --help              Display help message
         --man               Display the man page
         --help_actions      Display a list of valid actions
         -v                  Display the version of Publican
         --config <file>     Use a nonstandard config file

     Run: 'publican <action> --help' for details on action usage
...


$ publican build --langs en-US --formats html --config=foo.cfg
Setting up en-US
...


FYI If you wish to apply this change locally without rebuilding 
publican, it's a small change:

$ svn diff -r1015 bin/publican
Index: bin/publican
===================================================================
--- bin/publican        (revision 1015)
+++ bin/publican        (working copy)
@@ -41,6 +41,7 @@
      --man              Display the man page
      --help_actions     Display a list of valid actions
      -v                 Display the version of Publican
+    --config <file>    Use a nonstandard config file

  Run: 'publican <action> --help' for details on action usage

@@ -124,7 +125,7 @@
  # Options all actions use
  my @utility_opts = (
      'help',            'help_actions',
-    'man',             'config',
+    'man',             'config=s',
      'common_config=s', 'common_content=s',
      'v',
  );


Cheers, Jeff.

-- 
Jeff Fearn <jfearn at redhat.com>
Software Engineer
Engineering Operations
Red Hat, Inc
Freedom ... courage ... Commitment ... ACCOUNTABILITY




More information about the publican-list mailing list