Description of problem: The way the database is updated for packaged books is very fragile, prone to breaking, and not very cross platform friendly. This becomes particularly apparent when the underlying perl code changes and the install (e.g. RPM spec) files need to be updated. Instead of using naked perl in the install files publican should have a CLI action to allow the database to be updated. This way the install files are less likely to break and will require modification less often. e.g. $ publican update_db --add --lang en-US --formats html,pdf --name Foo \ --name_label "foo is good" --version 0.1 --version_label UNUSED \ --product Bar --product_label "To the bar" \ --subtitle "A guide to Bar Foo" \ --abstract "There once was a Foo from Bar ..." $ publican update_db --del --lang en-US --name Foo --version 0.1 --product Bar \ --site_config /usr/share/bar/foo.cfg
Added update_db action, updated web-spec.xsl, POD, and bash complete. Fixed in revision 1686
Back ported to branches/publican-2x Committed revision 1812.
I tested this in build 2.5-2.fc15.t14 When I tried to update a package, yum gave me: Error in PREUN scriptlet in rpm package Documentation-0806-0-web-en-US Documentation-0806-0-web-en-US-0-0.el5.noarch was supposed to be removed but is not! so then I tried to remove the existing package with RPM and got: Unknown option: add Unknown option: lang Unknown option: formats Unknown option: name Unknown option: version Unknown option: product Unknown option: subtitle Unknown option: abstract I recognised these as the options for the update_db action, so I thought I'd just try "publican update_db" on the command line, which gave me: 'update_db' is an unknown action! Valid actions are: <followed by a list of valid publican actions, update_db not among them>
However, another package installed and uninstalled cleanly: Red_Hat_Enterprise_Linux-Power_Management_Guide-6-web-de-DE.noarch 0:1.0-4.fc15
(In reply to comment #4) > However, another package installed and uninstalled cleanly: > > Red_Hat_Enterprise_Linux-Power_Management_Guide-6-web-de-DE.noarch 0:1.0-4.fc15 Heh; of course this used the raw perl command because I just built it with rpmbuild --rebuild... D'oh!
Oops, missed the action entry when back porting this code. Committed revision 1837. $ publican update_db --help update_db Add or remove database entries. Used for processing pre-build books, such as when building packages. Options: --help Display help message --config=s Use a nonstandard config file --common_config=s Override path to Common_Config directory --common_content=s Override path to Common_Content directory --nocolours Disable ANSI colourisation of logging. --quiet Disable all logging. --site_config=<SITE_CONFIG> WebSite configuration file to use or create. --add Add a database enrty --del Delete a database entry --lang=<LANG> The language the XML will be written in --product=<PRODUCT> The name of the product --version=<VERSION> The version of the product --name=<NAME> The name of the book, article, set, or brand --formats=<FORMATS> Comma-separated list of formats, for example: html,pdf,html-single,html-desktop,txt,epub --subtitle=<SUBTITLE> Sub title for a book --abstract=<ABSTRACT> Abstract for a book --product_label=<PRODUCT_LABEL> product label for a book --version_label=<VERSION_LABEL> version label for a book --name_label=<NAME_LABEL> name label for a book