bugGNU gettext - Bugs: bug #41766, Add --sources-only option to...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #41766: Add --sources-only option to msgfmt to output .java files

Submitter:  None
Submitted:  Mon 03 Mar 2014 03:27:23 PM UTC
   
 
Category:  Java Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  ueno
Open/Closed:  Closed

Wed 26 Mar 2014 03:20:53 AM UTC, comment #5: 
Daiki Ueno <ueno>
Group administrator
Tue 25 Mar 2014 10:16:30 AM UTC, comment #4: 

I agree with all the changes, the many checks for sources_only made the code hard to read, and renaming to --source-only makes sense.

Thanks!

Aurelien Gateau <agateau>
Tue 25 Mar 2014 09:56:08 AM UTC, comment #3: 

Maybe your system doesn't support delete-on-close flag?

Anyway, some minor nits:

- given so many checks of !sources_only, perhaps better consolidate the code into a single block
- as msgfmt produces only one .java source file, --source-only (not plural) or --source might be a better name?

I'm attaching a slightly modified patch.  I think copyright assignment is not needed since the most part is copied from the original code.  Will push it with your name, if there's no problem.

(file #31031)

Daiki Ueno <ueno>
Group administrator
Sat 22 Mar 2014 11:19:51 PM UTC, comment #2: 

(Sorry for the late answer)

I just had a look at it. Using fopen_temp() for something which is not temporary does not look harmful, but it sure feels wrong. New patch addresses this by introducing source_fopen and source_fwriteerror function pointers, which are set to either fopen+fwriteerror or fopen_temp+fwriteerror_temp, depending on whether user wants compiled output or not.

(file #31006)

Aurelien Gateau <agateau>
Tue 04 Mar 2014 02:53:09 AM UTC, comment #1: 

The patch looks basically good.  Thanks.  One thing, maybe you need to avoid fopen_temp to make sure generated source files won't be deleted on fclose?  Or, perhaps it might be more convenient not to create subdirs if --sources-only is given.

Daiki Ueno <ueno>
Group administrator
Mon 03 Mar 2014 03:27:23 PM UTC, original submission:  

Attached patch adds a --sources-only option to msgfmt. When compiling .po files for Java with this flag, msgfmt outputs the source of the code it generates instead of generating it in a temp dir and outputting the compiled .class file.

This is useful for me because I could not get compiled .class files to integrate properly with my LibGDX-based project (the .class files were being ignored by the Android sub-project).

Anonymous

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by agateau (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-27 haible CategoryNone Java
        Assigned toNone ueno
    2014-03-26 ueno StatusNone Fixed
        Open/ClosedOpen Closed
    2014-03-25 ueno Attached File- Added 0001-Add-source-only-option-to-avoid-compiling-the-Java-c.patch, #31031
    2014-03-22 agateau Attached File- Added 0001-Add-a-sources-only-option-to-avoid-compiling-the-Jav.patch, #31006
    2014-03-03 None Attached File- Added 0001-Add-a-sources-only-option-to-avoid-compiling-the-Jav.patch, #30762

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code