ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r644705 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java test/java/org/apache/ivy/core/resolve/ResolveTest.java
Date Fri, 04 Apr 2008 13:12:56 GMT
Author: xavier
Date: Fri Apr  4 06:12:42 2008
New Revision: 644705

URL: http://svn.apache.org/viewvc?rev=644705&view=rev
Log:
FIX: ivy.original.xml file using artifact pattern in cache and causing problems (IVY-787)

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
    ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=644705&r1=644704&r2=644705&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Fri Apr  4 06:12:42 2008
@@ -78,6 +78,7 @@
 - IMPROVEMENT: Change allownomd and skipbuildwithoutivy into a more semantically correct
name (IVY-297)
 - IMPROVEMENT: Smarter determination if an expression is exact or not for RegexpPatternMatcher
and GlobPatternMatcher
 
+- FIX: ivy.original.xml file using artifact pattern in cache and causing problems (IVY-787)
 - FIX: ivy:retrieve with sync="true" removes the .svn directory (IVY-763)
 - FIX: Ivy silently fails XML errors in ivyrep (IVY-579)
 - FIX: Extra Attributes are not available to resolver after resolve if cache was empty (IVY-773)

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java?rev=644705&r1=644704&r2=644705&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
(original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/core/cache/DefaultRepositoryCacheManager.java
Fri Apr  4 06:12:42 2008
@@ -356,7 +356,11 @@
     }
 
     public String getArchivePathInCache(Artifact artifact, ArtifactOrigin origin) {
-        return IvyPatternHelper.substitute(getArtifactPattern(), artifact, origin);
+        if (isOriginalMetadataArtifact(artifact)) {
+            return IvyPatternHelper.substitute(getIvyPattern() + ".original", artifact, origin);
+        } else {
+            return IvyPatternHelper.substitute(getArtifactPattern(), artifact, origin);
+        }
     }
 
     /**
@@ -1007,10 +1011,15 @@
 //    }
     
     public Artifact getOriginalMetadataArtifact(Artifact moduleArtifact) {
-        return DefaultArtifact.cloneWithAnotherName(moduleArtifact, 
-            moduleArtifact.getName() + ".original");
+        return DefaultArtifact.cloneWithAnotherType(
+            moduleArtifact, moduleArtifact.getType() + ".original");
     }
     
+
+    private boolean isOriginalMetadataArtifact(Artifact artifact) {
+        return artifact.isMetadata() 
+            && artifact.getType().endsWith(".original");
+    }
 
     private boolean isChanging(
             DependencyDescriptor dd, ModuleRevisionId requestedRevisionId, 

Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java?rev=644705&r1=644704&r2=644705&view=diff
==============================================================================
--- ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java (original)
+++ ant/ivy/core/trunk/test/java/org/apache/ivy/core/resolve/ResolveTest.java Fri Apr  4 06:12:42
2008
@@ -3834,12 +3834,14 @@
         Ivy ivy = new Ivy();
         ivy.configure(new File("test/repositories/extra-attributes/ivysettings.xml"));
         ivy.getSettings().setDefaultCache(cache);
+        ivy.getSettings().validate();
 
         ResolveReport report = ivy.resolve(ResolveTest.class.getResource("ivy-extra-att2.xml"),
             getResolveOptions(ivy.getSettings(), new String[] {"*"}).setValidate(false));
         assertFalse(report.hasError());
 
         assertTrue(new File(cache, "apache/mymodule/task2/1748/ivy.xml").exists());
+        assertTrue(new File(cache, "apache/mymodule/task2/1748/ivy.xml.original").exists());
         assertTrue(new File(cache, "apache/mymodule/task2/1748/mymodule-windows.jar").exists());
         assertTrue(new File(cache, "apache/mymodule/task2/1748/mymodule-linux.jar").exists());
 



Mime
View raw message