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
Made file check ignore leading './' Applied change to branches/publican-2x and trunk. Committed revision 1913.
"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
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
create a book that xi includes files from a subdirectory. run print_unused. verify if files do not come up as unused.
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"/>
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
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.