[cp-patches] FYI: gjar @file fix

Robert Schuster theBohemian at gmx.net
Mon Jun 2 22:59:20 UTC 2008

Hi Andrew,
I am not so happy with that patch. :)

I was trying to get Classpath to build PhoneME today and that requires
our javah to support @-style arguments as well. From my work for MIDPath
I know that we also lack that functionality in gjar that is why I tried
an implementation that can be used in all getopt using classpath tools.

What I am also unhappy is that a simple BufferedReader.readLine() is
used to get the filelist entries. The filelist the phoneme build
generates looks like this: "Bla Foo Baz". So a simple parser is needed
that splits at whitespace bounds. My suggested implementation does
exactly that.

What my implementation does not handle is whitespace inside filenames
and quoting. However I am not sure whether this is supported in filelist

It may be possible that some tools need @file support and some not (Does
anyone know more about this?). And such a case I would change the getopt
API to explicitly request @file support in parse().

Please have a look at the attached patch. :)


Andrew John Hughes schrieb:
> This adds support in gjar for the @file argument
> as used by the OpenJDK build.
> ChangeLog:
> 2008-06-02  Andrew John Hughes  <gnu_andrew at member.fsf.org>
> 	* tools/gnu/classpath/tools/getopt/OptionException.java:
> 	(OptionException(String,Throwable)): New constructor.
> 	* tools/gnu/classpath/tools/jar/Main.java:
> 	(fileLists): New queue for streams containing lists of files.
> 	(HandleFile.NotifyFile(String)): Check for '@' arguments
> 	and add to stream queue.
> 	(parsed(String)): Add stdin to queue instead of setting flag.
> 	(readNames()): Work with the queue rather than just stdin.
> 	(run(String[])): Always execute readNames().

-------------- next part --------------
A non-text attachment was scrubbed...
Name: getopt-filelist.patch
Type: text/x-patch
Size: 4439 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20080603/2e0ada4c/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20080603/2e0ada4c/attachment.pgp 

More information about the Classpath-patches mailing list