Tarun4201 commented on PR #13239:
URL: https://github.com/apache/maven/pull/13239#issuecomment-5774295200
Thanks for the review and for catching those edge cases! I've just pushed a
new commit to address the tokenization issue and the equals-form argument
handling.
Here are the key changes made in the latest commit:
1. **Robust Argument Tokenization:**
I replaced the `eval set --` and `sed` escaping logic with a clean,
POSIX-compliant `while` loop that iterates over the arguments using `shift` and
`set -- "$@" "$_a"`. This safely modifies the arguments in-place without
breaking any quotes, spaces, or native token boundaries. This inherently fixes
the issue where arguments were getting mangled or lost in restricted test
environments.
2. **Equals-form Argument Support (`--file=`)**:
The script now explicitly intercepts and converts paths passed in the
equals-form format (e.g. `--file=/cygdrive/c/path`, `--settings=`,
`--global-settings=`, `--toolchains=`, `--global-toolchains=`). It splits the
flag from the path, converts the path using `cygpath`, and dynamically
reassembles them before passing to the JVM.
3. **Added Comprehensive Testing**:
I expanded `test-mvn-path-conversion.sh` to include assertions
specifically validating `-s`, `-f`, and `--file=` formats, ensuring that the
argument array preserves spaces correctly and that native environments (like
MinGW) are bypassed accurately as expected.
All path conversion tests now pass successfully. Let me know if everything
looks good or if there are any other scenarios you'd like me to cover!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]