[
https://issues.apache.org/jira/browse/IVY-1522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16016839#comment-16016839
]
ASF GitHub Bot commented on IVY-1522:
-------------------------------------
GitHub user jaikiran opened a pull request:
https://github.com/apache/ant-ivy/pull/20
Fix IVY-1522
The commit here contains a potential fix for the issue reported in
https://issues.apache.org/jira/browse/IVY-1522. This PR also contains a test
case to verify the fix.
**Note that this issue isn't reproducible on my \*nix system and as such
the fix/PR itself needs to be tested on a Windows OS before being merged. That
plus the fact that this commit deals with the part of the code which gets used
in multiple places. Tests on my local \*nix have gone fine with this change and
such don't seem to introduce any regressions.**
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jaikiran/ant-ivy ivy-1522
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/ant-ivy/pull/20.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #20
----
commit 47312947d3c2411aae8b26f44182d7256193558e
Author: Jaikiran Pai <[email protected]>
Date: 2017-05-18T14:42:41Z
IVY-1522 Fix FileUtil.normalize to only consider ":" if it's part of the
filesystem root on Windows OS
----
> Ivy 2.4.0 improperly handles modules with colon (:) in version
> --------------------------------------------------------------
>
> Key: IVY-1522
> URL: https://issues.apache.org/jira/browse/IVY-1522
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.4.0
> Reporter: Daniel Holmes
> Priority: Critical
>
> This was not an issue in 2.2.0.
> I have some modules in my project which produce debian .deb files and those
> modules versions include a colon ':' in the version because the version
> scheme was reset, so an epoch is set.
> Also for this module the ivy.xml declaration uses extends tag, and in
> processing the parent location, this code in FileUtil which is called during
> a FileUtil.normalize() is causing the : in the resolve parent file name to
> have the ':' replaced with a ':/'.
> The comment on the it seems to explain that it is trying to handle a
> Windows/NetWare case, but the assumption to process any colon in the path is
> too broad and is negatively affecting my case which is executing on a linux
> system. Even on windows, this would only be attempting to address a drive
> letter case, right, where colon would occur only after a single letter in the
> path?
> private static String[] dissect(String path) {
> char sep = File.separatorChar;
> path = path.replace('/', sep).replace('\\', sep);
> // // make sure we are dealing with an absolute path
> // if (!isAbsolutePath(path)) {
> // throw new BuildException(path + " is not an absolute path");
> // }
> String root = null;
> int colon = path.indexOf(':');
> if (colon > 0) { // && (ON_DOS || ON_NETWARE)) {
> int next = colon + 1;
> root = path.substring(0, next);
> char[] ca = path.toCharArray();
> root += sep;
> // remove the initial separator; the root has it.
> next = (ca[next] == sep) ? next + 1 : next;
> StringBuffer sbPath = new StringBuffer();
> // Eliminate consecutive slashes after the drive spec:
> for (int i = next; i < ca.length; i++) {
> if (ca[i] != sep || ca[i - 1] != sep) {
> sbPath.append(ca[i]);
> }
> }
> path = sbPath.toString();
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)