Bug 576462 - RFE: Bulk replace entities header in files
RFE: Bulk replace entities header in files
Status: CLOSED ERRATA
Product: Publican
Classification: Community
Component: publican (Show other bugs)
1.6
All Linux
low Severity medium
: ---
: ---
Assigned To: Jeff Fearn
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-24 01:55 EDT by Joshua Wulf
Modified: 2014-10-19 18:58 EDT (History)
5 users (show)

See Also:
Fixed In Version: publican-1.6.2-0.fc13
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-04-03 00:40:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Joshua Wulf 2010-03-24 01:55:39 EDT
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 17:57:37 EDT
(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 01:15:11 EDT
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 01:15:37 EDT
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 01:16:04 EDT
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 01:25:48 EDT
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 00:39:46 EDT
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 00:50:26 EDT
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 00:27:53 EDT
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.