RFR [9] 8059101: unshuffle_patch.sh should be able to deal with stdin/stdout
Daniel Fuchs
daniel.fuchs at oracle.com
Thu Sep 25 09:49:41 UTC 2014
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.
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 '-'.
Similarly - I feel that either verbose should redirect to
stderr, or the script should complain and exit if output
is '-' and verbose is on.
best regards,
-- daniel
On 25/09/14 09:42, Ivan Gerasimov wrote:
> Hello!
>
> This is a proposal to enhance the unshuffle_patch.sh script so that it
> will be able to read from stdin and write to stdout.
> This would let us use the script in a pipe chain.
>
> For example, the following line could be used to apply a patch directly
> from a remote repository:
> wget -q -O - http://path.to.the.raw.patch | bash
> ~/jdk9/common/bin/unshuffle_patch.sh jdk - - | hg patch - --no-commit
>
> (Note, that it would only work, if the repository provides the patches
> in the git format, which is not currently the case with
> hg.openjdk.java.net.)
>
> Would you please help review/approve this enhancement?
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8059101
> WEBREV: http://cr.openjdk.java.net/~igerasim/8059101/0/webrev/
>
> Sincerely yours,
> Ivan
>
More information about the jdk9-dev
mailing list