Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-06-29 Thread Peter Levart
A word about "compatibility" with other jdk tools... jar is a specific tool. It was initially conceived to be user-friendly with users that are already familiar with tar tool: "The syntax for the jar command resembles the syntax for the tar command." Mixing-in behaviors not consistent with

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-06-29 Thread Peter Levart
Hi, On 29/03/2021 12:46, Jaikiran Pai wrote: Given the support of -C/-dir is new and -P is there for backwards compatibility then I see the choices are: * Issue an error when -P and -C/-dir are specified together with -x * Silently ignore the -P option * Ignore -C/-dir and the behavior

Re: RFR: 8173970: jar tool should have a way to extract to a directory [v4]

2021-04-29 Thread Jaikiran Pai
On Thu, 1 Apr 2021 15:02:42 GMT, Jaikiran Pai wrote: >> Can I please get a review for this patch which proposes to implement the >> enhancement request noted in >> https://bugs.openjdk.java.net/browse/JDK-8173970? >> >> The commit in this PR introduces the `-o` and `--output-dir` option to

Re: RFR: 8173970: jar tool should have a way to extract to a directory [v3]

2021-04-01 Thread Jaikiran Pai
On Wed, 31 Mar 2021 17:22:55 GMT, Lance Andersen wrote: >> Jaikiran Pai has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Alan's review feedback for -C help text >> - Keep -xfP backward compatible but don't allow -C/--dir with -xfP > >

Re: RFR: 8173970: jar tool should have a way to extract to a directory [v4]

2021-04-01 Thread Jaikiran Pai
> Can I please get a review for this patch which proposes to implement the > enhancement request noted in https://bugs.openjdk.java.net/browse/JDK-8173970? > > The commit in this PR introduces the `-o` and `--output-dir` option to the > `jar` command. The option takes a path to a destination

Re: RFR: 8173970: jar tool should have a way to extract to a directory [v3]

2021-03-31 Thread Lance Andersen
On Mon, 29 Mar 2021 14:04:10 GMT, Jaikiran Pai wrote: >> Can I please get a review for this patch which proposes to implement the >> enhancement request noted in >> https://bugs.openjdk.java.net/browse/JDK-8173970? >> >> The commit in this PR introduces the `-o` and `--output-dir` option to

Re: RFR: 8173970: jar tool should have a way to extract to a directory [v3]

2021-03-31 Thread Lance Andersen
On Mon, 29 Mar 2021 14:04:10 GMT, Jaikiran Pai wrote: >> Can I please get a review for this patch which proposes to implement the >> enhancement request noted in >> https://bugs.openjdk.java.net/browse/JDK-8173970? >> >> The commit in this PR introduces the `-o` and `--output-dir` option to

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-31 Thread Jaikiran Pai
On Sat, 27 Mar 2021 16:02:55 GMT, Alan Bateman wrote: >> Can I please get a review for this patch which proposes to implement the >> enhancement request noted in >> https://bugs.openjdk.java.net/browse/JDK-8173970? >> >> The commit in this PR introduces the `-o` and `--output-dir` option to

Re: RFR: 8173970: jar tool should have a way to extract to a directory [v3]

2021-03-29 Thread Jaikiran Pai
> Can I please get a review for this patch which proposes to implement the > enhancement request noted in https://bugs.openjdk.java.net/browse/JDK-8173970? > > The commit in this PR introduces the `-o` and `--output-dir` option to the > `jar` command. The option takes a path to a destination

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-29 Thread Jaikiran Pai
On 28/03/21 9:52 pm, Lance Andersen wrote: On Mar 28, 2021, at 9:24 AM, Jaikiran Pai > wrote: Now when the user explicitly specifies the new -C or --dir option with the -P option for extract, something like: jar -xfP foo.jar -C /tmp/hello/ Given the

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-28 Thread Lance Andersen
On Mar 28, 2021, at 9:24 AM, Jaikiran Pai mailto:jai.forums2...@gmail.com>> wrote: Lance ran some tests against the proposed patch and that has exposed an area which we haven't yet taken into account for this feature. The jar tool has a (hidden) option "-P" which can be used with the "c"

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-28 Thread Jaikiran Pai
Lance ran some tests against the proposed patch and that has exposed an area which we haven't yet taken into account for this feature. The jar tool has a (hidden) option "-P" which can be used with the "c" (create), "u" (update) and "x" (extract) main operations. When this -P option is used,

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-27 Thread Lance Andersen
On Mar 27, 2021, at 12:05 PM, Alan Bateman mailto:al...@openjdk.java.net>> wrote: On Fri, 26 Feb 2021 17:03:11 GMT, Jaikiran Pai mailto:j...@openjdk.org>> wrote: Can I please get a review for this patch which proposes to implement the enhancement request noted in

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-27 Thread Alan Bateman
On Fri, 26 Feb 2021 17:03:11 GMT, Jaikiran Pai wrote: > Can I please get a review for this patch which proposes to implement the > enhancement request noted in https://bugs.openjdk.java.net/browse/JDK-8173970? > > The commit in this PR introduces the `-o` and `--output-dir` option to the >

Re: RFR: 8173970: jar tool should have a way to extract to a directory [v2]

2021-03-24 Thread Jaikiran Pai
> Can I please get a review for this patch which proposes to implement the > enhancement request noted in https://bugs.openjdk.java.net/browse/JDK-8173970? > > The commit in this PR introduces the `-o` and `--output-dir` option to the > `jar` command. The option takes a path to a destination

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-24 Thread Jaikiran Pai
Based on the inputs so far, I've updated the PR to include the provided feedback. Since the PR code review hadn't yet started, I decided to do a force push to the PR so that we can start it afresh. Command option: In this current discussion, we seem to have an agreement for using -C and

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-14 Thread Jaikiran Pai
On 14/03/21 6:21 pm, Alan Bateman wrote: On 12/03/2021 12:18, Lance Andersen wrote: : I don’t have a strong preference but lean slightly towards ‘-directory’ as it is more descriptive, similar to the other GNU-style commands jar currently supports .  Tar supports ‘—cd’, ‘—directory’ in

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-14 Thread Alan Bateman
On 12/03/2021 12:18, Lance Andersen wrote: : I don’t have a strong preference but lean slightly towards ‘-directory’ as it is more descriptive, similar to the other GNU-style commands jar currently supports .  Tar supports ‘—cd’, ‘—directory’ in addition to ‘-C’ which is why I suggested

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-12 Thread Lance Andersen
On Mar 12, 2021, at 6:32 AM, Alan Bateman mailto:alan.bate...@oracle.com>> wrote: On 11/03/2021 15:25, Lance Andersen wrote: The only reason I included it is for completeness with tar which the jar options were originally derived from. I think it would be surprising to have two GNU-style

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-12 Thread Alan Bateman
On 11/03/2021 15:25, Lance Andersen wrote: The only reason I included it is for completeness with tar which the jar options were originally derived from. I think it would be surprising to have two GNU-style long options so I think we should pick one.  "--dir" seems okay to me and is

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-11 Thread Lance Andersen
On Mar 11, 2021, at 9:29 AM, Alan Bateman mailto:alan.bate...@oracle.com>> wrote: On 04/03/2021 12:01, Lance Andersen wrote: Hi Jaikiran From https://docs.oracle.com/en/java/javase/15/docs/specs/man/jar.html The jar man page includes the following : The syntax for the jar command

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-11 Thread Alan Bateman
On 04/03/2021 12:01, Lance Andersen wrote: Hi Jaikiran From https://docs.oracle.com/en/java/javase/15/docs/specs/man/jar.html The jar man page includes the following :  The syntax for the |jar| command resembles the

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-04 Thread Lance Andersen
Hi Jaikiran From https://docs.oracle.com/en/java/javase/15/docs/specs/man/jar.html The jar man page includes the following : The syntax for the jar command resembles the syntax for the tar command. Because of the above, I feel that we should support: ——— -C —dir —directory The addition

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-03 Thread Jaikiran Pai
Hello Lance, On 03/03/21 9:14 pm, Lance Andersen wrote: Some other things needed to be defined and agreed upon in order to move forward * The behavior if the path does not exist * If the option is specified more than once on the command line * Clarify the behavior if any of the files

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-03 Thread Lance Andersen
Hi Jaikiran, It should not be too difficult to support the options listed below via GNUStyleOptions. Some other things needed to be defined and agreed upon in order to move forward * The behavior if the path does not exist * If the option is specified more than once on the command

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-03-03 Thread Jaikiran Pai
Thank you Lance. So I think there's some level of agreement on using -C and --dir (or --directory) for the option names. Anymore opinion on the directory creation semantics and any other aspects to consider? -Jaikiran On 28/02/21 5:38 pm, Lance Andersen wrote: Hi Jaikiran, Thank you for

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-02-28 Thread Lance Andersen
Hi Jaikiran, Thank you for this. I went through this myself yesterday in addition to what you have below here are a few more: 7zip: -o Info-zip: -d (MacOS version of zip) Bandzip: -o:{dir} jpackage: -d —dest jlink —output Thinking about this some more, I might suggest supporting -C

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-02-27 Thread Jaikiran Pai
Hello Alan, On 27/02/21 2:23 pm, Alan Bateman wrote: Yes, the option name will need to be agreed. It would be useful to enumerate the options that the other tools are using to specify the location where to extract. If you see JBS issues mentioning tar -C not supporting chdir when extracting

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-02-27 Thread Lance Andersen
HI Jaikiran, I am more than happy to work with you through the CSR process Lets get the discussion going regarding possible option names on core-libs-dev and then we can move forward :-) Have a great weekend On Feb 26, 2021, at 9:03 PM, Jaikiran Pai mailto:jai.forums2...@gmail.com>> wrote:

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-02-27 Thread Alan Bateman
On 26/02/2021 19:47, Lance Andersen wrote: Hi Jaikiran, Thank you for the proposed patch. Assuming there is consensus to add support for this enhancement, I think we need to discuss what is the correct option. The jar tool borrows -C from tar for creating/updating a jar and the -C option

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-02-26 Thread Jaikiran Pai
On 27/02/21 1:17 am, Lance Andersen wrote: I believe this would also warrant a CSR to be created as well as updates to the jar man page. I haven't created a CSR before, so I will need some guidance on that part. Is it usually created after all the implementation details have been

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-02-26 Thread Jaikiran Pai
Hello Lance, On 27/02/21 1:17 am, Lance Andersen wrote: p.s. I think it would be useful in the future to start the discussion on core-libs-dev prior to creating a PR (or leave it as a draft PR) for a feature request. Thank you for that input, I'll keep that in mind for any similar work in

Re: RFR: 8173970: jar tool should have a way to extract to a directory

2021-02-26 Thread Lance Andersen
Hi Jaikiran, Thank you for the proposed patch. Assuming there is consensus to add support for this enhancement, I think we need to discuss what is the correct option. The jar tool borrows -C from tar for creating/updating a jar and the -C option is also a valid option when extracting files

RFR: 8173970: jar tool should have a way to extract to a directory

2021-02-26 Thread Jaikiran Pai
Can I please get a review for this patch which proposes to implement the enhancement request noted in https://bugs.openjdk.java.net/browse/JDK-8173970? The commit in this PR introduces the `-o` and `--output-dir` option to the `jar` command. The option takes a path to a destination directory as