Author: maartenc
Date: Mon Nov  5 02:18:06 2007
New Revision: 591945

URL: http://svn.apache.org/viewvc?rev=591945&view=rev
Log:
FIX: Retrieval not expanding "[originalname]". (IVY-631)

Added:
    incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-631.xml
Modified:
    incubator/ivy/core/trunk/CHANGES.txt
    
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/MDArtifact.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveTest.java

Modified: incubator/ivy/core/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/CHANGES.txt?rev=591945&r1=591944&r2=591945&view=diff
==============================================================================
--- incubator/ivy/core/trunk/CHANGES.txt (original)
+++ incubator/ivy/core/trunk/CHANGES.txt Mon Nov  5 02:18:06 2007
@@ -98,6 +98,7 @@
 - IMPROVEMENT: Unit test improvements (IVY-545) (thanks to Tjeerd Verhagen)
 - IMPROVEMENT: Dependent jars missing in ivy binaries (IVY-481)
 
+- FIX: Retrieval not expanding "[originalname]". (IVY-631)
 - FIX: Ant target "clean" on Ivy multi-project tutorial points to wrong cache 
directory. (IVY-548)
 - FIX: Variables not replaced during deliver (IVY-520) (thanks to John 
Williams)
 - FIX: XmlModuleDescriptorWriter does not produce matcher attribute on include 
and exclude rules (IVY-556)

Modified: 
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/MDArtifact.java
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/MDArtifact.java?rev=591945&r1=591944&r2=591945&view=diff
==============================================================================
--- 
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/MDArtifact.java
 (original)
+++ 
incubator/ivy/core/trunk/src/java/org/apache/ivy/core/module/descriptor/MDArtifact.java
 Mon Nov  5 02:18:06 2007
@@ -45,8 +45,6 @@
 
     private List confs = new ArrayList();
 
-    private ArtifactRevisionId arid;
-
     private Map extraAttributes = null;
 
     private URL url;
@@ -86,11 +84,9 @@
     }
 
     public ArtifactRevisionId getId() {
-        if (arid == null) {
-            arid = 
ArtifactRevisionId.newInstance(md.getResolvedModuleRevisionId(), name, type,
+        // do not cache the result because the resolvedModuleRevisionId can 
change!
+        return 
ArtifactRevisionId.newInstance(md.getResolvedModuleRevisionId(), name, type,
                 ext, extraAttributes);
-        }
-        return arid;
     }
 
     public String getName() {

Modified: 
incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveTest.java
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveTest.java?rev=591945&r1=591944&r2=591945&view=diff
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveTest.java 
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyRetrieveTest.java 
Mon Nov  5 02:18:06 2007
@@ -207,6 +207,16 @@
         assertTrue(new File(IvyPatternHelper.substitute(RETRIEVE_PATTERN, 
"org1", "mod1.2", "2.0",
             "mod1.2", "jar", "jar")).exists());
     }
+    
+    public void testRetrieveWithOriginalNamePattern() throws Exception {
+        retrieve.setFile(new File("test/java/org/apache/ivy/ant/ivy-631.xml"));
+        retrieve.setConf("default");
+        retrieve.setPattern("build/test/lib/[conf]/[originalname].[ext]");
+        retrieve.setSync(true);
+        retrieve.execute();
+        
+        assertTrue(new File("build/test/lib/default/mod1.2-2.2.jar").exists());
+    }
 
     public void testFailureWithoutAPreviousResolve() throws Exception {
         // we do a retrieve with the module information whereas no resolve has 
been previously done

Added: incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-631.xml
URL: 
http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-631.xml?rev=591945&view=auto
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-631.xml (added)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/ant/ivy-631.xml Mon Nov  
5 02:18:06 2007
@@ -0,0 +1,24 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.    
+-->
+<ivy-module version="1.2">
+  <info organisation="apache" module="613"/>
+  <dependencies>
+    <dependency org="org1" name="mod1.2" rev="latest.integration" 
conf="default" transitive="false" />
+  </dependencies>
+</ivy-module>


Reply via email to