[publican-list] BZ 471703 RFE: new "make" target that does not use 98-100% CPU

Joshua Wulf jwulf at redhat.com
Mon Mar 2 00:33:49 UTC 2009


Jeff Fearn wrote:
> https://bugzilla.redhat.com/show_bug.cgi?id=471703
>
> There is a lot of overhead in processing make requests due to the 
> number of templates used in the Makefiles. For each extra language you 
> support in your book the start up cost is increased. It's currently 
> very annoying on RHEL where there are 23 languages, on Fedora this 
> could quickly become extremely painful due to the extra languages 
> supported.
>
> The only real solution to fixing this is to move the logic in the 
> common make files to programming language. I can't get time allocated 
> at work to do this :( So it's either a hobby project for me, and that 
> means I'd do it in the sweet joy that is Perl, or someone else can do 
> it in some other language.
>
> From the writers perspective it would have two main effects.
>
> 1: The commands used to manipulate books would change from `make blah` 
> to, probably, `publican --options`
>
> 2: The books Makefile will probably need to be changed to another format.
>
> From a support point it would mean that adding optional behaviour is 
> easier, it's a pain in the bum to do that in a maintainable way in the 
> current massive make files.
>
> Depending on the format of the config files it may lower the barrier 
> to someone creating a GUI to handle building on the desk top.
>
> -------
>
> Here is my, rather relaxed, proposal for my hobby project. Other 
> people should feel free to propose alternative approaches they are 
> prepared to deliver on.
>
> -------
>
> Jeff's hobby time approach to porting publican.
>
> Approach:
>
> Use Perl, because I like it!
>
> Create a Publican module to contain config data.
> Create sub modules for each function.
>
> e.g.
> Publican::XmlClean
> Publican::Builder
> Publican::CreateBook
> ...
>
> Migrate required logic and drop any unused logic.
>
> Migrate all logic where possible to perl. There is currently: sh, sed, 
> awk, perl, java. Some of the java stuff is unavoidable, but manageable 
> since it is contained enough to be maintainable.
>
>
> Steps (the odd steps are not ordered):
>
> Create Publican module using Module::Starter::PBP
>
> Drink cider.
>
> Migrate xmlClean to Publican::XmlClean
>
> Drink cider.
>
> Migrate all the logic from Makefile.common and Makefile.templates to 
> Publican::Builder
>
> Drink cider.
>
> Migrate create_book to Publican::CreateBook
>
> Drink cider.
>
> Create a publican script to act as an interface between the user and 
> the Publican modules.
>
> Drink cider.
>
> Use Config::Simple to handle config files ... probably in html format, 
> which looks  like:
>
> xml_lang: en-US
> docname: The_Art_Of_Pants
> other_langs: de-DE en-FR
>
> Drink cider.
>
> Create a method of converting existing books from make to publican.
>
> Drink cider.
>
> Update brand packages to use new config format.
>
> Drink cider.
>
> Use Test::More, Test::Perl::Critic etc to create a decent suite of tests.
>
> Drink cider.
>
> Use Locale::Maketext::Gettext to localise warnings, errors & other 
> output of the publican process.
>
> Drink cider.
>
> Package and ship.
>
> Join AA.
>
>
> Let me know what you think.
>
> Cheers, Jeff.
>
Sounds like a lot of cider...

-- 
Joshua J Wulf
Engineering Content Services
Red Hat Asia Pacific

eml: jwulf at redhat.com
tel: +61 (0)7 3514 8140
mob: +61 (0)431 929 675
tmz: GMT +10

(0) - omit when dialling internationally




More information about the publican-list mailing list