Author: maartenc Date: Tue Feb 2 22:28:00 2010 New Revision: 905823 URL: http://svn.apache.org/viewvc?rev=905823&view=rev Log: FIX: Creation of symlinks problematic in Windows with Cygwin 1.7 (IVY-1165)
Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java Modified: ant/ivy/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=905823&r1=905822&r2=905823&view=diff ============================================================================== --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Tue Feb 2 22:28:00 2010 @@ -107,6 +107,7 @@ - IMPROVEMENT: Trace a message when a property file referenced from the settings doesn't exixts (IVY-1074) - IMPROVEMENT: use defaultconf in combination with defaultconfmapping (IVY-1135) (thanks to Jon Schneider) +- FIX: Creation of symlinks problematic in Windows with Cygwin 1.7 (IVY-1165) - FIX: add ability to programmatically change default resolver (IVY-1163) (thanks to Jason Trump) - FIX: ivy.settings.dir space escaping problem (IVY-1162) - FIX: Ivy cannot parse alternate format for Maven MD5 files (IVY-1155) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java?rev=905823&r1=905822&r2=905823&view=diff ============================================================================== --- ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/FileUtil.java Tue Feb 2 22:28:00 2010 @@ -86,8 +86,16 @@ throw new IOException("error symlinking " + src + " to " + dest + ":\n" + error); } + + // check if the creation of the symbolic link was successful if (!dest.exists()) { - throw new IOException("error symlinking " + dest + " doesn't exists"); + throw new IOException("error symlinking: " + dest + " doesn't exists"); + } + + // check if the result is a true symbolic link + if (dest.getAbsolutePath().equals(dest.getCanonicalPath())) { + overwrite = true; // just make sure we do overwrite the invalid symlink! + throw new IOException("error symlinking: " + dest + " isn't a symlink"); } } catch (IOException x) { Message.verbose("symlink failed; falling back to copy");