[publican-list] Publican 2.3 - not using files in Common_Content

Jeff Fearn jfearn at redhat.com
Wed Aug 21 05:07:53 UTC 2013


Hi Norm,

On 08/21/2013 03:05 AM, Norman Dunbar wrote:
> Evening all,
>
> Publican 2.3 on Linux Mint 13 KDE.
>
> I build the latest version from source and followed the CPAN instructions to get the system built and the dependencies installed. My onely deviation from the README was the final stage, installing, where I had to run this command:

FWIW the CPAN install is very rare, so you are a bit of a guinea pig here ... thanks :)

> $ sudo ./Build install
>

Fixed for next commit.

> I can see the default brands and stuff in /usr/share/publican but when I attempt to use a brand that I have installed there, it barfs saying it cannot find the brand.
>
> However, it is not looking in /usr/share/publican/Common_Content for the brands, it is looking in the area where I build the code - in my home directory in :
>
> /home/norman/Publican/Publican-v3.2.0/blib/datadir/Common_Content
>
> When I reinstall a brand into the above location (--path) then my builds manage to pick up the correct files. I'm now puzzled as to what exactly the install did (publican is /usr/local/bin/publican) and all the support files etc appear to have been copied to /usr/share/publican as normal (which didn't exist beforehand).

I'd really need a full log of the entire process to have a real crack at solving this. It's possible there is something funky going on with the Config.

Publican uses Module::Build::ConfigData to track where things are installed, it's possible there is some memory state hanging around between install and building a book.

$ perl -e 'use Publican::ConfigData; print Publican::ConfigData->config('datadir'), "\n";'
/usr/share/publican

The Module::Build::ConfigData module has some magic to convert to CWD when building, so it could be a bug or feature of that module or how we are using it.

> I've looked in the User Guide and it does mention the common_content option in publican.cfg and also states that the default is already set to /usr/share/publican/Common_Content, but it's not seemingly picking up the default for me.
>
> Not only that, it's ignores the setting even when explicitly defined in publican.cfg:

Can you open a bug with a link to the section? The doc is way out of date, common_config & common_content are command line options and won't get used from the publican.cfg.

> $ cat publican.cfg
>
> xml_lang: en-US
> type: book
> brand: jms
> tmp_dir: build_tmp
> debug: 1
> common_content: /usr/share/publican/Common_Content
>
>
> $ publican build --langs=en-US formats=pdf
>
> ...
> Beginning work on en-US
> DTD Validation OK
>          Starting pdf
>          Using XML::LibXSLT on /home/norman/Publican/Publican-v3.2.0/blib/datadir/xsl/pdf.xsl
> ...
>
> It's not picking up the pdf.xsl from /usr/share/publican/xsl.
>
>
> If I add the common_config option to /usr/share/publican, it does pick up the global files rather than the local ones.
>
> It seems that common_config is accepted while common_content is ignored?

Neither should work in the cfg file, they are both command line options.

Unless you override them on the command line:

common_config  = Publican::ConfigData->config('datadir')
common_content = Publican::ConfigData->config('datadir') . '/Common_Content'

Cheers, Jeff.

-- 
Jeff Fearn <jfearn at redhat.com>
Senior Software Engineer
Infrastructure Engineering & Development (AEU)
Red Hat Asia Pacific Pty Ltd
GPG: 0x0357E8F0




More information about the publican-list mailing list