Bug 539741

Summary: Can't call method "as_trimmed_text"
Product: [Community] Publican Reporter: eric <eric>
Component: publicanAssignee: Ruediger Landmann <rlandman>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: 1.6CC: jfearn, mmcallis, nb, publican-list, r.landmann
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.3-0.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-09 23:14:53 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description eric@christensenplace.us 2009-11-20 17:40:30 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
  
Actual results:
Receive error above.

Expected results:
Builds the SRPM and associated files.

Additional info:
Comment 1 Jeff Fearn 2009-11-20 21:21:43 EST
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.

e.g.

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.

Cheers, Jeff.
Comment 2 eric@christensenplace.us 2009-11-21 00:15:48 EST
Hmmm... so here is the top revision in my Revision History...

<revhistory>
        <revision>
                <revnumber>12.1-1</revnumber>
                <date>Fri Nov 20 2009</date>
                <author>
                        <firstname>Eric</firstname>
                        <surname>Christensen</surname>
                        <email>sparks@fedoraproject.org</email>
                </author>
                <revdescription>
                        <simplelist>
                                <member>Official F12 version.</member>
                        </simplelist>
                </revdescription>
        </revision>

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.
Comment 3 Jeff Fearn 2009-11-22 19:28:23 EST
(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.

Cheers, Jeff.
Comment 4 Ruediger Landmann 2009-11-22 20:22:32 EST
(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.
Comment 5 Fedora Update System 2009-12-07 21:14:55 EST
publican-1.3-0.fc12 has been submitted as an update for Fedora 12.
http://admin.fedoraproject.org/updates/publican-1.3-0.fc12
Comment 6 Fedora Update System 2009-12-07 21:18:15 EST
publican-1.3-0.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/publican-1.3-0.fc11
Comment 7 Fedora Update System 2009-12-09 23:13:53 EST
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.
Comment 8 Fedora Update System 2009-12-09 23:26:45 EST
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.