RFR: 8173970: jar tool should have a way to extract to a directory
Lance Andersen
lance.andersen at oracle.com
Fri Feb 26 19:47:32 UTC 2021
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 from a tar file.
Perhaps keeping symmetry with tar and extend support for -C when extracting a jar file would be a better way forward. Let’s give time for additional input.
I believe this would also warrant a CSR to be created as well as updates to the jar man page.
Best
Lance
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.
On Feb 26, 2021, at 12:08 PM, Jaikiran Pai <jpai at openjdk.java.net<mailto:jpai at openjdk.java.net>> 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 `jar` command. The option takes a path to a destination directory as a value and extracts the contents of the jar into that directory. This is an optional option and the changes in the commit continue to maintain backward compatibility where the jar is extracted into current directory, if no `-o` or `--output-dir` option has been specified.
As far as I know, there hasn't been any discussion on what the name of this new option should be. I was initially thinking of using `-d` but that is currently used by the `jar` command for a different purpose. So I decided to use `-o` and `--output-dir`. This is of course open for change depending on any suggestions in this PR.
The commit in this PR also updates the `jar.properties` file which contains the English version of the jar command's `--help` output. However, no changes have been done to the internationalization files corresponding to this one (for example: `jar_de.properties`), because I don't know what process needs to be followed to have those files updated (if at all they need to be updated).
The commit also includes a jtreg testcase which verifies the usage of this new option.
-------------
Commit messages:
- 8173970: jar tool should have a way to extract to a directory
Changes: https://git.openjdk.java.net/jdk/pull/2752/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2752&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8173970
Stats: 268 lines in 4 files changed: 262 ins; 0 del; 6 mod
Patch: https://git.openjdk.java.net/jdk/pull/2752.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/2752/head:pull/2752
PR: https://git.openjdk.java.net/jdk/pull/2752
[cid:E1C4E2F0-ECD0-4C9D-ADB4-B16CA7BCB7FC at home]
Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
Lance.Andersen at oracle.com<mailto:Lance.Andersen at oracle.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20210226/b62c547e/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: oracle_sig_logo.gif
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20210226/b62c547e/oracle_sig_logo.gif>
More information about the compiler-dev
mailing list