incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xav...@apache.org
Subject svn commit: r493454 - in /incubator/ivy/trunk: CHANGES.txt src/java/fr/jayasoft/ivy/resolver/ResolverHelper.java
Date Sat, 06 Jan 2007 12:11:11 GMT
Author: xavier
Date: Sat Jan  6 04:11:11 2007
New Revision: 493454

URL: http://svn.apache.org/viewvc?view=rev&rev=493454
Log:
FIX: Urlresolver is not possible to use dynamic revisions on nonstandard repository structure
(IVY-350) (thanks to Pierre H├Ągnestrand)

Modified:
    incubator/ivy/trunk/CHANGES.txt
    incubator/ivy/trunk/src/java/fr/jayasoft/ivy/resolver/ResolverHelper.java

Modified: incubator/ivy/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ivy/trunk/CHANGES.txt?view=diff&rev=493454&r1=493453&r2=493454
==============================================================================
--- incubator/ivy/trunk/CHANGES.txt (original)
+++ incubator/ivy/trunk/CHANGES.txt Sat Jan  6 04:11:11 2007
@@ -14,6 +14,7 @@
 - FIX: IOException during publish causes NullPointerException (IVY-371)
 - FIX: Comments in ivy.xml duplicated (IVY-336) (thanks to Gilles Scokart)
 - FIX: Ivy failure when the ivy.xml file contains non US-ASCII characters (IVY-346) (thanks
to Gilles Scokart)
+- FIX: Urlresolver is not possible to use dynamic revisions on nonstandard repository structure
(IVY-350) (thanks to Pierre H├Ągnestrand)
 
    version 1.4.1 - 2006-11-09
 =====================================

Modified: incubator/ivy/trunk/src/java/fr/jayasoft/ivy/resolver/ResolverHelper.java
URL: http://svn.apache.org/viewvc/incubator/ivy/trunk/src/java/fr/jayasoft/ivy/resolver/ResolverHelper.java?view=diff&rev=493454&r1=493453&r2=493454
==============================================================================
--- incubator/ivy/trunk/src/java/fr/jayasoft/ivy/resolver/ResolverHelper.java (original)
+++ incubator/ivy/trunk/src/java/fr/jayasoft/ivy/resolver/ResolverHelper.java Sat Jan  6 04:11:11
2007
@@ -56,13 +56,11 @@
                     } else {
                         namePattern = pattern.substring(slashIndex + 1);
                     }
-                    String acceptNamePattern = IvyPatternHelper.substituteToken(namePattern,
token, "(.+)");
-                    Pattern p = Pattern.compile(acceptNamePattern);
+                    String acceptNamePattern = ".*"+IvyPatternHelper.substituteToken(namePattern,
token, "([^"+fileSep+"]+)")+".*";
+                    Pattern p = Pattern.compile(acceptNamePattern.toString());
                     for (Iterator iter = all.iterator(); iter.hasNext();) {
                         String path = (String)iter.next();
-                        int pathSlashIndex = path.lastIndexOf(fileSep);
-                        String name = pathSlashIndex == -1 ? path : path.substring(pathSlashIndex+1);
-                        Matcher m = p.matcher(name);
+                        Matcher m = p.matcher(path);
                         if (m.matches()) {
                             String value = m.group(1);
                             ret.add(value);
@@ -231,14 +229,12 @@
                     } else {
                         namePattern = pattern.substring(slashIndex + 1);
                     }
-                    String acceptNamePattern = IvyPatternHelper.substituteToken(namePattern,
token, "(.+)");
-                    Pattern p = Pattern.compile(acceptNamePattern);
+                    String acceptNamePattern = ".*"+IvyPatternHelper.substituteToken(namePattern,
token, "([^/]+)")+".*";
+                    Pattern p = Pattern.compile(acceptNamePattern.toString());
                     for (Iterator iter = all.iterator(); iter.hasNext();) {
                         URL url = (URL)iter.next();
                         String path = standardize(url.getPath());
-                        int pathSlashIndex = path.lastIndexOf('/');
-                        String name = pathSlashIndex == -1 ? path : path.substring(pathSlashIndex+1);
-                        Matcher m = p.matcher(name);
+                        Matcher m = p.matcher(path);
                         if (m.matches()) {
                             String value = m.group(1);
                             ret.add(value);



Mime
View raw message