You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/08/30 19:32:45 UTC

[jira] [Commented] (IVY-1522) Ivy 2.4.0 improperly handles modules with colon (:) in version

    [ https://issues.apache.org/jira/browse/IVY-1522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14721617#comment-14721617 ] 

ASF GitHub Bot commented on IVY-1522:
-------------------------------------

GitHub user jaikiran opened a pull request:

    https://github.com/apache/ant-ivy/pull/8

    IVY-1522 Windows OS file path resolution fix

    The commit here fixes the issue reported in https://issues.apache.org/jira/browse/IVY-1522.
    
    This commit includes a new test method to verify this fix. My local testing with these changes hasn't shown any regressions. However, I don't have a Windows OS to test this on and my testing has been on a *nix OS. The test included in this commit needs to be run against a Windows OS to ascertain that the fix indeed fixes the issue.


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/8.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 #8
    
----
commit adb9b664d0af140db454c888ce570645bfedc528
Author: Jaikiran Pai <ja...@gmail.com>
Date:   2015-08-04T16:17:36Z

    IVY-1522 Windows OS file path resolution fix

----


> 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.
> I also for this module use the 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 if 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.
>    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.4#6332)