bugGNU gettext - Bugs: bug #40262, msgfmt -c doesn't error

 
 

bug #40262: msgfmt -c doesn't error

Submitted by:  Peter Eisentraut <petere>
Submitted on:  Mon 14 Oct 2013 01:38:08 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 13 May 2014 06:20:35 AM UTC, comment #3:

Makes sense. Pushed a fix:
http://git.savannah.gnu.org/cgit/gettext.git/commit/?h=maint&id=4aaaccd2

Sorry for the long delay.

Daiki Ueno <ueno>
Project Administrator
Thu 05 Dec 2013 04:31:41 AM UTC, comment #2:

According to gettext-po.in.h, PO_SEVERITY_ERROR is "the operation cannot complete", PO_SEVERITY_FATAL_ERROR is "the operation must be aborted". That just distinguishes whether processing will continue after the error, but the exit code should still reflect the errors.

Since msgfmt is typically used in makefiles and such, not setting a proper exit code can be a significant problem.

Peter Eisentraut <petere>
Tue 15 Oct 2013 03:08:29 AM UTC, comment #1:

> The code clearly distinguishes between warnings and errors, but somehow this doesn't end up reflected in the exit code.


However, po_xerror seems also distinguish between PO_SEVERITY_ERROR and PO_SEVERITY_FATAL_ERROR, and only exits if the latter is specified. So I guess the errors reported here is considered as kind of recoverable?

Daiki Ueno <ueno>
Project Administrator
Mon 14 Oct 2013 01:38:08 AM UTC, original submission:

Setup:

$ xgettext /dev/null --force-po
$ msgfmt -o /dev/null -c messages.po
messages.po: warning: Charset "CHARSET" is not a portable encoding name.
Message conversion to user's charset might not work.
msgfmt: messages.po: warning: PO file header fuzzy
warning: older versions of msgfmt will give an error on this
messages.po:8: header field 'Project-Id-Version' still has the initial default value
messages.po:8: header field 'Content-Type' still has the initial default value
messages.po:8: warning: header field 'Language' still has the initial default value
$ echo $?
0

I think this should return a non-zero exit code.

The code clearly distinguishes between warnings and errors, but somehow this doesn't end up reflected in the exit code.

Peter Eisentraut <petere>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ueno (Posted a comment)
  • -unavailable- added by petere (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 13 May 2014 06:20:35 AM UTCuenoStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup