RFR [9] 8059101: unshuffle_patch.sh should be able to deal with stdin/stdout
Chris Hegarty
chris.hegarty at oracle.com
Thu Sep 25 12:21:49 UTC 2014
On 25 Sep 2014, at 03:12, Ivan Gerasimov <ivan.gerasimov at oracle.com> wrote:
> Thank you Daniel for the comments!
>
> On 25.09.2014 13:49, Daniel Fuchs wrote:
>> Hi Ivan,
>>
>> When setting output & input, I wonder if it would be simpler
>> to use an 'if else if' construct in order to avoid the '-a'
>> in the 'if' that follows.
>>
> We would still need that -a in if, as the user could pass /dev/stdin and /dev/stdout as the arguments to the script.
> Dashes are meant to be the shortcut for these long names, but we should allow the long names to be passed too.
>
>> something like this (pseudo code) might be easier to read:
>>
>> if "x$output" is "x-" then
>> substitute - with /dev/stdout
>> else if $output file exists
>> complain
>> endif
>>
>> Also the script uses echo to print warnings & error.
>> It should probably be changed to print those on stderr ( >&2 )
>> so that they don't mix with the patch when the output is '-'.
>>
> Agreed!
> Redirected all the error messages to stderr.
>
>> Similarly - I feel that either verbose should redirect to
>> stderr, or the script should complain and exit if output
>> is '-' and verbose is on.
>>
> Done.
>
> Please see the updated webrev:
> http://cr.openjdk.java.net/~igerasim/8059101/1/webrev/
This looks ok to me.
-Chris.
>
> Sincerely yours,
> Ivan
>
More information about the jdk9-dev
mailing list