git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1554808 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -12,6 +12,14 @@ Changes that could break older environments: | |||||
| must now explicitly set the prefixValues attribute to true. | must now explicitly set the prefixValues attribute to true. | ||||
| Bugzilla Report 54769 | Bugzilla Report 54769 | ||||
| * when matching an entry of a zip/tarfileset against a pattern a | |||||
| leading slash will be stripped from the entry name. Most archive | |||||
| don't contain paths with leading slashes anyway. | |||||
| This may cause include/exclude patterns that start with a / to stop | |||||
| matching anything. Such patterns only used to work by accident and | |||||
| only on platforms with multiple file syste roots. | |||||
| Bugzilla Report 53949 | |||||
| Fixed bugs: | Fixed bugs: | ||||
| ----------- | ----------- | ||||
| @@ -44,7 +44,9 @@ is used, the tarfileset is populated with filesystem files found under <span | |||||
| </ul> | </ul> | ||||
| <p><code><tarfileset></code> supports all attributes of <code><<a | <p><code><tarfileset></code> supports all attributes of <code><<a | ||||
| href="fileset.html">fileset</a>></code> | href="fileset.html">fileset</a>></code> | ||||
| in addition to those listed below.<br> | |||||
| in addition to those listed below. Note that tar archives in general | |||||
| don't contain entries with leading slashes so you shouldn't use | |||||
| include/exclude patterns that start with slashes either. | |||||
| </p> | </p> | ||||
| <p>A tarfileset can be defined with the <span style="font-style: | <p>A tarfileset can be defined with the <span style="font-style: | ||||
| italic;">id </span>attribute and referred to with the <span | italic;">id </span>attribute and referred to with the <span | ||||
| @@ -42,8 +42,10 @@ is used, the zipfileset is populated with filesystem files found under <span | |||||
| </ul> | </ul> | ||||
| <p><code><zipfileset></code> supports all attributes of <code><<a | <p><code><zipfileset></code> supports all attributes of <code><<a | ||||
| href="fileset.html">fileset</a>></code> | href="fileset.html">fileset</a>></code> | ||||
| in addition to those listed below.<br> | |||||
| </p> | |||||
| in addition to those listed below. Note that zip archives in general | |||||
| don't contain entries with leading slashes so you shouldn't use | |||||
| include/exclude patterns that start with slashes either.</p> | |||||
| <p>Since Ant 1.6, a zipfileset can be defined with the <span | <p>Since Ant 1.6, a zipfileset can be defined with the <span | ||||
| style="font-style: italic;">id </span>attribute and referred to with | style="font-style: italic;">id </span>attribute and referred to with | ||||
| the <span style="font-style: italic;">refid</span> attribute.<br> | the <span style="font-style: italic;">refid</span> attribute.<br> | ||||
| @@ -255,8 +255,14 @@ public abstract class ArchiveScanner extends DirectoryScanner { | |||||
| * <code>false</code> otherwise. | * <code>false</code> otherwise. | ||||
| */ | */ | ||||
| public boolean match(String path) { | public boolean match(String path) { | ||||
| String vpath = path.replace('/', File.separatorChar). | |||||
| replace('\\', File.separatorChar); | |||||
| String vpath = path; | |||||
| if (path.length() > 0) { | |||||
| vpath = path.replace('/', File.separatorChar). | |||||
| replace('\\', File.separatorChar); | |||||
| if (vpath.charAt(0) == File.separatorChar) { | |||||
| vpath = vpath.substring(1); | |||||
| } | |||||
| } | |||||
| return isIncluded(vpath) && !isExcluded(vpath); | return isIncluded(vpath) && !isExcluded(vpath); | ||||
| } | } | ||||