Bug 999994 - The publican print_tree command lists source files not actually included in the book
Summary: The publican print_tree command lists source files not actually included in t...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 3.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: PnT DevOps Devs
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-22 13:49 UTC by Petr Bokoc
Modified: 2013-09-23 06:41 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-09-23 06:41:11 UTC
Embargoed:


Attachments (Terms of Use)

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?


Note You need to log in before you can comment on or make changes to this bug.