Red Hat Bugzilla – Bug 677869
publican package does not work with conditional book_info.xml
Last modified: 2011-04-07 23:43:07 EDT
Description of problem:
I have two products to document, which are so similar that I decided to use conditional tags and one source document instead of making two books. To do so, I made separate Book_Info.xml files - Book_Info_A.xml and Book_Info_B.xml.
Publican builds these books just fine for either product, but the "publican package" command complains of a lack of Book_Info.xml.
Is it possible to get the package command to check for the <bookinfo> element instead of the Book_Info.xml file?
First, I tried adding <phrase condition="a">A</phrase><phrase condition="b">B</phrase> to the subtitle, productname, etc. tags.
This results in an incorrect packagename:
JBoss_Enterprise_ApplicationWeb_Platform-6.0.0_Release_Notes-6-web-en-US-6.0.0-1.el5 instead of JBoss_Enterprise_Application_Platform-6.0.0_Release_Notes-6-web-en-US-6.0.0-1.el5 or JBoss_Enterprise_Web_Platform-6.0.0_Release_Notes-6-web-en-US-6.0.0-1.el5 depending on the condition set in publican.cfg.
Next I tried adding the condition to the productname tag, but in this case publican package just grabs the content of whichever <productname> comes first in the file, regardless of the condition that is set. Of the two workarounds, I think this one makes the most sense, if we absolutely must use Book_Info.xml as the container for the <bookinfo> element.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
Try to brew a book whose <productname> is conditional.
Examples here: https://svn.devel.redhat.com/repos/ecs/JBoss_Enterprise_Application_Platform/trunk/6/
On closer inspection, publican build doesn't work without a Book_Info.xml either, even if it's not required.
Publican only uses <type>_Info.xml to source variables from. If you want to do non-standard things, then you have to use the configuration files for that.
If you set product, version, release, etc, in the cfg files then publican should not use <type>_Info.xml at all, so you can have any structure you like for your bookinfo.
Awesome, thanks Jeff. :)
Setting the product in the cfg file solves the initial problem, but I have discovered a related issue: the PDF name and brew package name is still based on the bookname.xml filename, instead of the title given in the bookinfo element. Defining the bookname in the cfg file makes Publican search for a file of that name.
This means that I need a separate bookname.xml for each conditional book, which somewhat defeats the purpose of having a single source.
I tell a lie: packagename and PDF name are based on the first <title> element discovered in Book_Info.xml, regardless of conditions.
Can you include a link to the book in question? I can't really work out what the problem is from the description.
Sorry, Jeff, I think the bug was that I was DOINGITWRONG. Closing NOTABUG.