Bug 999994

Summary: The publican print_tree command lists source files not actually included in the book
Product: [Community] Publican Reporter: Petr Bokoc <pbokoc>
Component: publicanAssignee: PnT DevOps Devs <hss-ied-bugs>
Status: CLOSED NOTABUG QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 3.1CC: aigao, rlandman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-23 06:41:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Petr Bokoc 2013-08-22 13:49:35 UTC
When using the publican print_tree command with an alternate configuration file, the output includes source files which are not actually in the book. Possible problem is that the print_tree command ignores conditions.

More info:
I have a repository from which two distinct books are built, depending on which configuration file is used. The default publican.cfg builds the Installation Guide and using --config=quickstart.cfg builds a Installation Quick Start Guide, which is much shorter, but uses some of the source files from the former book.

Which parts are included in which book is decided by conditionals - if a tag has "condition="install-guide"", it only appears in the Installation Guide; if a tag has "condition="quick-start"", it's specific to the Installation Quick Start Guide, and if there's no condition present, it can go into both.

When I run publican print_tree --config=quickstart.cfg, the output includes files which are included with "condition="install-guide"", which means they are not actually in this version of the guide. For example:

$ publican print_tree --config=quickstart.cfg
<parts omitted>
Key_Board_Configuration-x86.xml
      Key_Board_Configuration_x86_ppc-title-1.xml
      Key_Board_Configuration_x86_ppc-indexterm-1.xml
      Key_Board_Configuration_x86_ppc-indexterm-2.xml
      Key_Board_Configuration_x86_ppc-para-1.xml
      Key_Board_Configuration_x86_ppc-para-2.xml
<parts omitted>

The last two entries are wrong. The Key_Board_Configuration-x86.xml file contains:

<xi:include href="Key_Board_Configuration_x86_ppc-para-1.xml" xmlns:xi="http://www.w3.org/2001/XInclude" condition="install-guide" />
<xi:include href="Key_Board_Configuration_x86_ppc-para-2.xml" xmlns:xi="http://www.w3.org/2001/XInclude" condition="install-guide" />

Note the condition="install-guide" in the includes; this means these two files should not appear in the output when building with --config=quickstart.cfg.

I'm not sure if I'm explaining this in a way that's possible to understand; I'll be happy to provide additional information as needed.

Comment 2 Jeff Fearn 🐞 2013-09-23 06:41:11 UTC
This is working as intended, is a file used at all or isn't it? i.e. can you safely delete it from your source repository?