Bug 740417 - print_unused returns files included using relative paths as unused
Summary: print_unused returns files included using relative paths as unused
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 2.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.0
Assignee: Jeff Fearn 🐞
QA Contact: Ruediger Landmann
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-22 00:50 UTC by Stephen Gordon
Modified: 2012-10-31 03:10 UTC (History)
3 users (show)

Fixed In Version: 3.0.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-10-31 03:10:52 UTC
Embargoed:


Attachments (Terms of Use)

Description Stephen Gordon 2011-09-22 00:50:42 UTC
Description of problem:

Publican print_unused returns files as unused despite them being included into the book's XML via a relative path, for example:

<xi:include href="./topics/Concepts/RHEV/VDSM.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>

The directory topics/Concepts/RHEV/ is under the en-US folder. Building and/or packaging the book works fine and the included content is also included in the output of these operations. The publican print_unused command however returns the file as unused.

Version-Release number of selected component (if applicable):

2.7

Comment 1 Jeff Fearn 🐞 2011-10-11 00:07:59 UTC
Made file check ignore leading './'

Applied change to branches/publican-2x and trunk.

Committed revision 1913.

Comment 2 Martin Prpič 2012-04-26 16:46:02 UTC
"publican print_unused" still returns unused files when they are included via a relative path. See example:

en-US]$ rpm -q publican
publican-3.0-0.fc16.t166.noarch
en-US]$ ls testchapter.xml 
testchapter.xml
en-US]$ grep testchapter book.xml 
        <xi:include href="testchapter.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
[mprpic@fedora en-US]$ cd ..
[mprpic@fedora book]$ publican print_unused

No unused XML files

[mprpic@fedora book]$ cd en-US/
...
[mprpic@fedora en-US]$ grep testchapter book.xml 
        <xi:include href="./testchapter.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
[mprpic@fedora en-US]$ cd ..
[mprpic@fedora book]$ publican print_unused

List of unused XML files in en-US
   testchapter.xml

Comment 4 Jeff Fearn 🐞 2012-05-17 02:44:46 UTC
Ah the bug was about files in the main directory including files in sub directories generated false positives; the feedback was that files in nested directories including files in deeper directories also triggers false positives.

Fixed print_unused & print_tree to correctly handled deeply nested includes.

To ssh://git.fedorahosted.org/git/publican.git
   40d48c4..5000dcf  master -> master

Comment 5 Michael Hideo 2012-06-08 01:37:42 UTC
create a book that xi includes files from a subdirectory. run print_unused. verify if files do not come up as unused.

Comment 6 Stephen Gordon 2012-06-08 15:50:09 UTC
Testing on publican-3.0-0.fc17.t179.noarch it appears this is still an issue.

$ publican print_unused

List of unused XML files in en-US
   topics/References/RHEL/6/RHEVH/Support_Limits_List.xml
   topics/References/RHEV/2.3/Active_Directory.xml
   topics/References/RHEV/2.3/Admin_Client_Requirements.xml
   topics/References/RHEV/2.3/Configuration_Tool.xml
   topics/References/RHEV/2.3/Directory_Firewall_Requirements.xml
   topics/References/RHEV/2.3/Host_Firewall_Requirements.xml
   topics/References/RHEV/2.3/ISO_Uploader.xml
   topics/References/RHEV/2.3/Log_Collector.xml
   topics/References/RHEV/2.3/Log_Files.xml
   topics/References/RHEV/2.3/Manage_Domains.xml
   topics/References/RHEV/2.3/Manager_Firewall_Requirements.xml
   topics/References/RHEV/2.3/Manager_Requirements.xml
   topics/References/RHEV/2.3/RHEV_and_RHEL_Compatibility.xml
   topics/References/RHEV/2.3/Required_Channels.xml
   topics/References/RHEV/2.3/Supported_Guests.xml
   topics/References/RHEV/2.3/UIDs_needed_by_RHEV.xml
   topics/Tasks/IPA/Adding_New_Users.xml
   topics/Tasks/RHEV/Adding_FCP_Storage.xml
   topics/Tasks/RHEV/Adding_Local_Storage.xml
   topics/Tasks/RHEV/Adding_NFS_Storage.xml
   topics/Tasks/RHEV/Adding_iSCSI_Storage.xml
   topics/Tasks/RHEV/Preparing_Red_Hat_Enterprise_Linux_Hosts.xml
   topics/Tasks/RHEV/Red_Hat_Network_Subscription.xml
   topics/Tasks/RHEV/Removing_Red_Hat_Enterprise_Virtualization_Manager.xml

$ grep 'topics/References/RHEL/6/RHEVH/Support_Limits_List.xml' en-US/*.xml
en-US/Requirements.xml:		<xi:include href="./topics/References/RHEL/6/RHEVH/Support_Limits_List.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>

Comment 8 Jeff Fearn 🐞 2012-06-23 00:44:21 UTC
This is a corner case where people have the optional leading './'. Because the xml_file list doesn't have it the pattern match comparing used files to existing files wasn't matching. Added extra check for the './' version.

To ssh://git.fedorahosted.org/git/publican.git
   8830412..8c64c85  master -> master

Comment 9 Misty Stanley-Jones 2012-06-29 05:30:04 UTC
I checked out Steve's test book and ran the command:

[mstanley@timtam Installation_Guide]$ publican print_unused

No unused XML files

Marking this as verified.

Comment 10 Misty Stanley-Jones 2012-06-29 05:33:02 UTC
I checked out Steve's test book and ran the command:

[mstanley@timtam Installation_Guide]$ publican print_unused

No unused XML files

Marking this as verified.


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