Red Hat Bugzilla – Bug 539741
Can't call method "as_trimmed_text"
Last modified: 2010-11-23 23:18:50 EST
Description of problem: When trying to build a SRPM package I receive the following error:
Can't call method "as_trimmed_text" on an undefined value at /usr/lib/perl5/vendor_perl/5.10.0/Publican/Builder.pm line 1291.
Version-Release number of selected component (if applicable): 1.2-0.fc12
How reproducible: Always
Steps to Reproduce:
1. publican package --lang=en-US --short_sighted --binary --desktop
Receive error above.
Builds the SRPM and associated files.
This is due to the Revision_History file being incorrectly formatted and the code not catching this and notifying the user.
I modified the RPM spec file creation code to validate fields and generate messages when the format is incorrect.
Missing mandatory field 'revnumber' in revision history. at /usr/bin/publican line 469
Rudi, Section 3.1.8. of the Users Guide needs to be updated with what the mandatory Revision History format is for building RPMs. It is not possible to generate valid spec files without this information. There must be at least one valid revision to generate a valid spec file.
Here are the rules:
* There must exist a file <xml_lang>/Revision_History.xml
* This file must contain a valid DocBook revhistory
* In addition each revision must contain
* * revnumber
* * date
* * author
* * * firstname
* * * surname
* * * email
* * revdescription
* * * simplelist
* * * * member
This is the minimum structure, there can be multiple revisions, members etc. The User Guide has a very good example of this format in it's own Revision_History.xml.
Hmmm... so here is the top revision in my Revision History...
<date>Fri Nov 20 2009</date>
<member>Official F12 version.</member>
I checked my Book_Info.xml to make sure it matched as well. I've had this problem before, iirc. I did do a test build on the accessibility guide and it worked fine so it's definitely me and not Publican.
(In reply to comment #2)
> I checked my Book_Info.xml to make sure it matched as well.
Just to clarify, the Revison History needs to be in en-US/Revision_History.xml and not in Book_Info.xml. It doesn't make a difference if this Revision_History.xml is not xi:included anywhere. The file is accessed directly.
This is change in behavior from the publican 0.x, which would search for the file the Revision History was in.
(In reply to comment #3)
> This is change in behavior from the publican 0.x, which would search for the
> file the Revision History was in.
Oh! Which means that section 3.1.8 of the User Guide is now incorrect. I'll fix this.
publican-1.3-0.fc12 has been submitted as an update for Fedora 12.
publican-1.3-0.fc11 has been submitted as an update for Fedora 11.
publican-1.3-0.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
publican-1.3-0.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.