Bug 576462 - RFE: Bulk replace entities header in files
Summary: RFE: Bulk replace entities header in files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 1.6
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jeff Fearn 🐞
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-03-24 05:55 UTC by Joshua Wulf
Modified: 2014-10-19 22:58 UTC (History)
5 users (show)

Fixed In Version: publican-1.6.2-0.fc13
Clone Of:
Environment:
Last Closed: 2010-04-03 04:40:12 UTC
Embargoed:


Attachments (Terms of Use)

Description Joshua Wulf 2010-03-24 05:55:39 UTC
Description of problem:
Here is script developed by dmison to bulk replace the entities header file.

This is useful in a number of situations. For example, what I'm doing now: exporting a document template from svn, then changing the name of the book. This requires updating the name of the entities file in header of each the existing files.

Apparently this functionality is also required for publican / maven compatibility, as explained here: http://hudson.jboss.org/hudson/job/JBoss_Documentation_Guide/lastSuccessfulBuild/artifact/JBoss_Documentation_Guide/target/docbook/publish/en-US/html_single/index.html#sect-Interop_Insert_Parameter_Entities


Can we add this as a publican command? For example: publican bookents {filename}

Here's the script that we currently use:


#!/usr/bin/env bash
for file in *.xml; do
    sed -i -e 's/docbookx.dtd" \[/docbookx.dtd" \[\n<!ENTITY % BOOK_ENTITIES SYSTEM "'${1}'.ent">\n%BOOK_ENTITIES\;/' ${file}; \
done

Comment 1 Jeff Fearn 🐞 2010-03-24 21:57:37 UTC
(In reply to comment #0)
> Description of problem:
> Here is script developed by dmison to bulk replace the entities header file.

This script is not cross platform.

> This is useful in a number of situations. For example, what I'm doing now:
> exporting a document template from svn, then changing the name of the book.
> This requires updating the name of the entities file in header of each the
> existing files.

Publican ignores the header in the source file and rewrites it at processing time, so there is no need to update this content for use with Publican.

> Apparently this functionality is also required for publican / maven
> compatibility, as explained here:
> http://hudson.jboss.org/hudson/job/JBoss_Documentation_Guide/lastSuccessfulBuild/artifact/JBoss_Documentation_Guide/target/docbook/publish/en-US/html_single/index.html#sect-Interop_Insert_Parameter_Entities
> 
> 
> Can we add this as a publican command? For example: publican bookents
> {filename}

There is a check in XmlClean.pm that stops the entity definition from being injected in to the header when running clean_ids, we could remove that check. 

The check was originally added because the references to entity files in the common content broke jdocbook. Since we no longer have entity files in the common content it would seem there is no longer a requirement for this exception.

Cheers, Jeff.

Comment 2 Fedora Update System 2010-04-01 05:15:11 UTC
publican-1.6.2-0.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/publican-1.6.2-0.fc12

Comment 3 Fedora Update System 2010-04-01 05:15:37 UTC
publican-1.6.2-0.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/publican-1.6.2-0.fc11

Comment 4 Fedora Update System 2010-04-01 05:16:04 UTC
publican-1.6.2-0.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/publican-1.6.2-0.fc13

Comment 5 Jeff Fearn 🐞 2010-04-01 05:25:48 UTC
The change made was to remove the restriction on clean_ids writing the entity declaration, so now clean_ids should be sufficient to address the issues raised.

Comment 6 Fedora Update System 2010-04-03 04:39:46 UTC
publican-1.6.2-0.fc12 has been pushed to the Fedora 12 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2010-04-03 04:50:26 UTC
publican-1.6.2-0.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 8 Fedora Update System 2010-04-09 04:27:53 UTC
publican-1.6.2-0.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.


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