svn commit: r691877 - in /ant/ivy/core/trunk: CHANGES.txt src/java/org/apache/ivy/util/ConfigurationUtils.java test/java/org/apache/ivy/ant/IvyResolveTest.java
Author: maartenc Date: Wed Sep 3 23:08:00 2008 New Revision: 691877 URL: http://svn.apache.org/viewvc?rev=691877view=rev Log: FIX: Enable consistent support of the configuration negation operator (IVY-894) Modified: ant/ivy/core/trunk/CHANGES.txt ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Modified: ant/ivy/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=691877r1=691876r2=691877view=diff == --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Wed Sep 3 23:08:00 2008 @@ -111,6 +111,7 @@ - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed from the cache (IVY-883) - IMPROVEMENT: Improve performance (IVY-872) +- FIX: Enable consistent support of the configuration negation operator (IVY-894) - FIX: add variable expansion in extra attributes (IVY-798) - FIX: Invalid URL when using dynamic ranges (IVY-885) - FIX: can't use gotoNode with a node which has not been visited yet (IVY-874) Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java?rev=691877r1=691876r2=691877view=diff == --- ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java (original) +++ ant/ivy/core/trunk/src/java/org/apache/ivy/util/ConfigurationUtils.java Wed Sep 3 23:08:00 2008 @@ -20,6 +20,7 @@ import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; +import java.util.Iterator; import org.apache.ivy.core.module.descriptor.Configuration; import org.apache.ivy.core.module.descriptor.ModuleDescriptor; @@ -61,6 +62,7 @@ } Set result = new LinkedHashSet(); +Set excluded = new LinkedHashSet(); for (int i = 0; i confs.length; i++) { if (*.equals(confs[i])) { result.addAll(Arrays.asList(md.getConfigurationsNames())); @@ -78,10 +80,15 @@ result.add(all[j].getName()); } } +} else if (confs[i].startsWith(!)) { +excluded.add(confs[i].substring( 1 )); } else { result.add(confs[i]); } } +for (Iterator iter = excluded.iterator(); iter.hasNext();) { +result.remove(iter.next()); +} return (String[]) result.toArray(new String[result.size()]); } Modified: ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java?rev=691877r1=691876r2=691877view=diff == --- ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java (original) +++ ant/ivy/core/trunk/test/java/org/apache/ivy/ant/IvyResolveTest.java Wed Sep 3 23:08:00 2008 @@ -388,6 +388,17 @@ assertNotNull(project.getReference(ivy.resolved.configurations.ref.testWithResolveId)); } +public void testExcludedConf() throws Exception { +resolve.setFile(new File(test/java/org/apache/ivy/ant/ivy-multiconf.xml)); +resolve.setConf(*,!default); +resolve.execute(); + +assertTrue(getIvyFileInCache( +ModuleRevisionId.newInstance(org1, mod1.1, 2.0)).exists()); +assertFalse(getIvyFileInCache( +ModuleRevisionId.newInstance(org1, mod1.2, 2.0)).exists()); +} + public void testResolveWithAbsoluteFile() { // IVY-396 File ivyFile = new File(test/java/org/apache/ivy/ant/ivy-simple.xml);
[jira] Resolved: (IVY-894) Enable consistent support of the configuration negation operator.
[ https://issues.apache.org/jira/browse/IVY-894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Maarten Coene resolved IVY-894. --- Resolution: Fixed Fix Version/s: 2.0-RC1 Assignee: Maarten Coene I've applied your patch, thank you for your contribution. Enable consistent support of the configuration negation operator. - Key: IVY-894 URL: https://issues.apache.org/jira/browse/IVY-894 Project: Ivy Issue Type: Bug Components: Core Affects Versions: 2.0-RC1 Reporter: Patrick Woodworth Assignee: Maarten Coene Fix For: 2.0-RC1 Attachments: excludeconfsyntax.patch Original Estimate: 0.25h Remaining Estimate: 0.25h To my mind there are two general areas that make wide use of comma-delimited configuration name lists. The first area is in Ivy file dependency mappings and along with simple configuration names, one can also make use of operators like * for wildcarding and ! for negation. The second area where these lists are used extensively is in the conf attribute of the Ant resolve task and the various post-resolve tasks. Much like before one can also use the * character for wildcarding here, but much to my frustration the conf attribute of these Ant tasks doesn't seem to recognize the ! character as the negation operator. The attached patch (which includes test case) remedies this tragic situation. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r691878 - /ant/ivy/core/trunk/CHANGES.txt
Author: maartenc Date: Wed Sep 3 23:08:57 2008 New Revision: 691878 URL: http://svn.apache.org/viewvc?rev=691878view=rev Log: The patch came from Patrick Woodworth Modified: ant/ivy/core/trunk/CHANGES.txt Modified: ant/ivy/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=691878r1=691877r2=691878view=diff == --- ant/ivy/core/trunk/CHANGES.txt (original) +++ ant/ivy/core/trunk/CHANGES.txt Wed Sep 3 23:08:57 2008 @@ -111,7 +111,7 @@ - IMPROVEMENT: Add a memory cache for the module descriptor that are parsed from the cache (IVY-883) - IMPROVEMENT: Improve performance (IVY-872) -- FIX: Enable consistent support of the configuration negation operator (IVY-894) +- FIX: Enable consistent support of the configuration negation operator (IVY-894) (thanks to Patrick Woodworth) - FIX: add variable expansion in extra attributes (IVY-798) - FIX: Invalid URL when using dynamic ranges (IVY-885) - FIX: can't use gotoNode with a node which has not been visited yet (IVY-874)
DO NOT REPLY [Bug 41402] The task ChangeLog doesn't work if the svn server is in french
https://issues.apache.org/bugzilla/show_bug.cgi?id=41402 --- Comment #1 from Markus Schlegel [EMAIL PROTECTED] 2008-09-03 23:56:07 PST --- Same in german... This bug would have been solved if 40706 would be implemented. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 45499] DirectoryScanner infinitely recurses on symlinks to parent directories
https://issues.apache.org/bugzilla/show_bug.cgi?id=45499 --- Comment #5 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 00:50:38 PST --- Matt: yes, I think it is doable, even without too many or too big changes, but we need to think through some scenarios first to decide what to do. I'll take that to the dev list later (after coding up some AntUnit tests as use cases). Tim: hasBeenScanned only receives the relative path which will be different each time the directory is encountered again. I was thinking about a case where we have a structure like this A/ |--- B/ |- C.txt D/ |- E (symlink pointing to A) Let's say we set basedir to D and scan with an include pattern of E/B/C.txt - should it match the file or should we skip going upwards (we wouldn't rescan D since it isn't matched by an include pattern)? I haven't checked, but we may even get the file in fast mode and an infinite loop in slow mode (when the client asks for the not-included files/dirs). The good thing is that we don't need to think about backwards compatibility for the cases where Ant could run into an infinite loop 8-) Like I said, I'll move the discussion over to the dev list. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
svn commit: r691949 - /ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml
Author: bodewig Date: Thu Sep 4 02:26:19 2008 New Revision: 691949 URL: http://svn.apache.org/viewvc?rev=691949view=rev Log: initial tests for dirscanner behavior and symlinks Added: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml (with props) Added: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml?rev=691949view=auto == --- ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml (added) +++ ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Thu Sep 4 02:26:19 2008 @@ -0,0 +1,55 @@ +?xml version=1.0? +!-- + 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. +-- +project xmlns:au=antlib:org.apache.ant.antunit default=antunit + + import file=../antunit-base.xml/ + + target name=setUp +property name=base location=${input}/base/ +mkdir dir=${base}/ + /target + + target name=checkOs +condition property=unixos family=unix//condition + /target + + target name=YtestSymlinkToSiblingFollow + depends=checkOs, setUp, -sibling + if=unix +copy todir=${output} followSymlinks=true + fileset dir=${base}/ +/copy +au:assertFileExists file=${output}/B/file.txt/ + /target + + target name=YtestSymlinkToSiblingNoFollow + depends=checkOs, setUp, -sibling + if=unix +copy todir=${output} followSymlinks=false + fileset dir=${base}/ +/copy +au:assertFileDoesntExist file=${output}/B/file.txt/ + /target + + target name=-sibling if=unix +mkdir dir=${base}/A/ +touch file=${base}/A/file.txt/ +symlink link=${base}/B resource=${base}/A/ + /target + +/project Propchange: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml -- svn:eol-style = native
[jira] Resolved: (IVY-835) ivy:install ant task downloads wrong jars from maven repositories
[ https://issues.apache.org/jira/browse/IVY-835?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Erik-Berndt Scheper resolved IVY-835. - Resolution: Cannot Reproduce I have tried to reproduce this with the latest build from trunk, but can no longer reproduce this exact behaviour. I seem to remember the problem was related to the artifact pattern, where I had forgotten to add a (-classifier). ivy:install ant task downloads wrong jars from maven repositories --- Key: IVY-835 URL: https://issues.apache.org/jira/browse/IVY-835 Project: Ivy Issue Type: Bug Affects Versions: 2.0-RC1 Reporter: Erik-Berndt Scheper Priority: Critical Fix For: 2.0-RC1 Using the latest build from trunk, which supports sources, javadoc and distribution artifacts, wrong jars are downloaded from repo1.maven.org. In the case below only spring-oxm-tiger-1.5.2-sources.jar is downloaded, which is published as spring-oxm-1.5.2.jar (which should have been the 'standard' jar containing classfiles. Sample output: {noformat} [ivy:install] :: downloading artifacts to cache :: [ivy:install] tried http://repo1.maven.org/maven2/org/springframework/ws/spring-oxm-tiger/1.5.2/spring-oxm-tiger-1.5.2-sources.jar [ivy:install] downloading http://repo1.maven.org/maven2/org/springframework/ws/spring-oxm-tiger/1.5.2/spring-oxm-tiger-1.5.2-sources.jar ... [ivy:install] repo1.maven.org: downloading http://repo1.maven.org/maven2/org/springframework/ws/spring-oxm-tiger/1.5.2/spring-oxm-tiger-1.5.2-sources.jar [ivy:install] .. (8kB) [ivy:install] repo1.maven.org: downloading http://repo1.maven.org/maven2/org/springframework/ws/spring-oxm-tiger/1.5.2/spring-oxm-tiger-1.5.2-sources.jar.sha1 [ivy:install] .. (0kB) [ivy:install] sha1 OK for http://repo1.maven.org/maven2/org/springframework/ws/spring-oxm-tiger/1.5.2/spring-oxm-tiger-1.5.2-sources.jar [ivy:install] [SUCCESSFUL ] org.springframework.ws#spring-oxm-tiger;1.5.2!spring-oxm-tiger.jar(source) (109ms) [ivy:install] [NOT REQUIRED] org.springframework.ws#spring-oxm-tiger;1.5.2!spring-oxm-tiger.jar [ivy:install] [NOT REQUIRED] org.springframework.ws#spring-oxm-tiger;1.5.2!spring-oxm-tiger.jar(javadoc) [ivy:install] [NOT REQUIRED] org.springframework.ws#spring-xml;1.5.2!spring-xml.jar [ivy:install] [NOT REQUIRED] org.springframework.ws#spring-oxm;1.5.2!spring-oxm.jar [ivy:install] [NOT REQUIRED] apache#commons-logging;1.1.1!commons-logging.jar [ivy:install] [NOT REQUIRED] org.springframework#spring-core;2.5.4!spring-core.jar [ivy:install] [NOT REQUIRED] org.springframework#spring-beans;2.5.4!spring-beans.jar [ivy:install] [NOT REQUIRED] org.apache.ws.commons.schema#XmlSchema;1.3.2!XmlSchema.jar [ivy:install] [NOT REQUIRED] org.springframework#spring-context;2.5.4!spring-context.jar [ivy:install] [NOT REQUIRED] aopalliance#aopalliance;1.0!aopalliance.jar [ivy:install] [NOT REQUIRED] com.thoughtworks.xstream#xstream;1.2.2!xstream.jar [ivy:install] [NOT REQUIRED] xpp3#xpp3_min;1.1.3.4.O!xpp3_min.jar {noformat} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
svn commit: r691954 - /ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml
Author: bodewig Date: Thu Sep 4 02:55:46 2008 New Revision: 691954 URL: http://svn.apache.org/viewvc?rev=691954view=rev Log: fix syntax Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml?rev=691954r1=691953r2=691954view=diff == --- ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml (original) +++ ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Thu Sep 4 02:55:46 2008 @@ -28,20 +28,20 @@ condition property=unixos family=unix//condition /target - target name=YtestSymlinkToSiblingFollow + target name=testSymlinkToSiblingFollow depends=checkOs, setUp, -sibling if=unix -copy todir=${output} followSymlinks=true - fileset dir=${base}/ +copy todir=${output} + fileset dir=${base} followsymlinks=true/ /copy au:assertFileExists file=${output}/B/file.txt/ /target - target name=YtestSymlinkToSiblingNoFollow + target name=testSymlinkToSiblingNoFollow depends=checkOs, setUp, -sibling if=unix -copy todir=${output} followSymlinks=false - fileset dir=${base}/ +copy todir=${output} + fileset dir=${base} followsymlinks=false/ /copy au:assertFileDoesntExist file=${output}/B/file.txt/ /target
svn commit: r691955 - /ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml
Author: bodewig Date: Thu Sep 4 03:02:00 2008 New Revision: 691955 URL: http://svn.apache.org/viewvc?rev=691955view=rev Log: tests for a basedir that is a symlink itself Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml?rev=691955r1=691954r2=691955view=diff == --- ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml (original) +++ ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Thu Sep 4 03:02:00 2008 @@ -46,10 +46,34 @@ au:assertFileDoesntExist file=${output}/B/file.txt/ /target + target name=testBasedirIsSymlinkFollow + depends=checkOs, setUp, -basedir-as-symlink + if=unix +copy todir=${output} + fileset dir=${base} followsymlinks=true/ +/copy +au:assertFileExists file=${output}/file.txt/ + /target + + target name=FAILStestBasedirIsSymlinkNoFollow + depends=checkOs, setUp, -basedir-as-symlink + if=unix +copy todir=${output} + fileset dir=${base} followsymlinks=false/ +/copy +au:assertFileDoesntExist file=${output}/file.txt/ + /target + target name=-sibling if=unix mkdir dir=${base}/A/ touch file=${base}/A/file.txt/ symlink link=${base}/B resource=${base}/A/ /target - + + target name=-basedir-as-symlink if=unix +delete dir=${base}/ +mkdir dir=${input}/realdir/ +touch file=${input}/realdir/file.txt/ +symlink link=${base} resource=${input}/realdir/ + /target /project
svn commit: r691988 - /ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml
Author: bodewig Date: Thu Sep 4 05:08:20 2008 New Revision: 691988 URL: http://svn.apache.org/viewvc?rev=691988view=rev Log: Test for symlink loops Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml?rev=691988r1=691987r2=691988view=diff == --- ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml (original) +++ ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Thu Sep 4 05:08:20 2008 @@ -28,6 +28,17 @@ condition property=unixos family=unix//condition /target + macrodef name=assertDirIsEmpty +attribute name=dir default=${output}/ +sequential + local name=resources/ + resourcecount property=resources +fileset dir=@{dir}/ + /resourcecount + au:assertEquals expected=0 actual=${resources}/ +/sequential + /macrodef + target name=testSymlinkToSiblingFollow depends=checkOs, setUp, -sibling if=unix @@ -64,6 +75,82 @@ au:assertFileDoesntExist file=${output}/file.txt/ /target + target name=INFINITEtestLinkToParentFollow + depends=checkOs, setUp, -link-to-parent + if=unix +copy todir=${output} + fileset dir=${base} followsymlinks=true/ +/copy +exec executable=rm + arg file=${base}/A/ +/exec +au:assertFileExists file=${output}/A/B/file.txt/ + /target + + target name=testLinkToParentFollowWithInclude + depends=checkOs, setUp, -link-to-parent + if=unix +copy todir=${output} + fileset dir=${base} followsymlinks=true +include name=A/B/*/ + /fileset +/copy +exec executable=rm + arg file=${base}/A/ +/exec +au:assertFileExists file=${output}/A/B/file.txt/ + /target + + target name=Supposed to fail? testLinkToParentFollowWithIncludeMultiFollow + depends=checkOs, setUp, -link-to-parent + if=unix +copy todir=${output} + fileset dir=${base} followsymlinks=true +include name=A/B/B/B/*/ + /fileset +/copy +exec executable=rm + arg file=${base}/A/ +/exec +au:assertFileExists file=${output}/A/B/B/B/file.txt/ + /target + + target name=testLinkToParentNoFollow + depends=checkOs, setUp, -link-to-parent + if=unix +copy todir=${output} + fileset dir=${base} followsymlinks=false/ +/copy +exec executable=rm + arg file=${base}/A/ +/exec +au:assertFileDoesntExist file=${output}/A/B/file.txt/ + /target + + target name=INFINITE testSillyLoopFollow + depends=checkOs, setUp, -silly-loop + if=unix +copy todir=${output} + fileset dir=${base} followsymlinks=true/ +/copy +exec executable=rm + arg file=${base}/ +/exec +assertDirIsEmpty/ + /target + + target name=testSillyLoopNoFollow + depends=checkOs, setUp, -silly-loop + if=unix +copy todir=${output} + fileset dir=${base} followsymlinks=false/ +/copy +exec executable=rm + arg file=${base}/ +/exec +assertDirIsEmpty/ + /target + target name=-sibling if=unix mkdir dir=${base}/A/ touch file=${base}/A/file.txt/ @@ -76,4 +163,15 @@ touch file=${input}/realdir/file.txt/ symlink link=${base} resource=${input}/realdir/ /target + + target name=-link-to-parent if=unix +mkdir dir=${input}/B/ +touch file=${input}/B/file.txt/ +symlink link=${base}/A resource=${input}/ + /target + + target name=-silly-loop if=unix +delete dir=${base}/ +symlink link=${base} resource=${input}/ + /target /project
svn commit: r691991 - /ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml
Author: bodewig Date: Thu Sep 4 05:15:55 2008 New Revision: 691991 URL: http://svn.apache.org/viewvc?rev=691991view=rev Log: fix include pattern to show the behavior Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml?rev=691991r1=691990r2=691991view=diff == --- ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml (original) +++ ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Thu Sep 4 05:15:55 2008 @@ -101,18 +101,19 @@ au:assertFileExists file=${output}/A/B/file.txt/ /target - target name=Supposed to fail? testLinkToParentFollowWithIncludeMultiFollow + !-- supposed to fail? -- + target name=testLinkToParentFollowWithIncludeMultiFollow depends=checkOs, setUp, -link-to-parent if=unix copy todir=${output} fileset dir=${base} followsymlinks=true -include name=A/B/B/B/*/ +include name=A/base/A/B/*/ /fileset /copy exec executable=rm arg file=${base}/A/ /exec -au:assertFileExists file=${output}/A/B/B/B/file.txt/ +au:assertFileExists file=${output}/A/base/A/B/file.txt/ /target target name=testLinkToParentNoFollow
DO NOT REPLY [Bug 45739] New: Problems with BaseDir when the ant is started as Java library from Java Application
https://issues.apache.org/bugzilla/show_bug.cgi?id=45739 Summary: Problems with BaseDir when the ant is started as Java library from Java Application Product: Ant Version: 1.7.1 Platform: PC OS/Version: Windows XP Status: NEW Severity: blocker Priority: P2 Component: Core AssignedTo: notifications@ant.apache.org ReportedBy: [EMAIL PROTECTED] I try to start ant script using ant as java library from Java application. The start is realized as follow: File buildXmlFile = new File(C:\a\b\z.xml); ListString command = new ArrayListString(); ... command.add(...); ... command.add(-buildfile); command.add(buildXmlFile.getAbsolutePath()); Main ant = new Main(); ant.startAnt(command.toArray(new String[command.size()]), null, null); The content of build xml file is: ?xml version=1.0 encoding=UTF-8? project name=SSHAntScriptTest default=default basedir=. descriptionBuild file for SSH Ant Script tests./description scp file=test.txt todir=${username}:[EMAIL PROTECTED]:/home/bc/ /project The xml build file location is different from the execution directory. When that execution is initiated from the command prompt like that everything is OK: c:\somedirant -buildfile c:\anotherdirbuildfile.xml When I try to start the same with the same parameters as java library the text.txt file can not be founded. Ant looks for the file in execution directory c:\somedir\test.txt instead in buildfile directory c:\anotherdir\test.txt. To fix this at the moment the following changes are made: 1. The user.dir is changed: File dir = buildXmlFile.getParentFile(); System.getProperties().put(user.dir, dir.getAbsolutePath()); 2. The method runBuild from the Main class is fixed as follow: private void runBuild(ClassLoader coreLoader) throws BuildException { ... project.init(); // 2008-Sep-04: Bug Fix from Miro. project.getBaseDir(); I try to put that fix before project.init() without result. If you need I can send you one small project as test case. The big problem is that I do some changes in System Properties and that the application is multi-thread and multi-tasking and because System Properties are global (static) for all instances in the current JVM. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 45740] New: SSHBase to be able to use external Session instead everytime to create new one
https://issues.apache.org/bugzilla/show_bug.cgi?id=45740 Summary: SSHBase to be able to use external Session instead everytime to create new one Product: Ant Version: 1.7.1 Platform: PC OS/Version: Windows XP Status: NEW Severity: enhancement Priority: P2 Component: Optional Tasks AssignedTo: notifications@ant.apache.org ReportedBy: [EMAIL PROTECTED] I notice that SSHBase which is base class for ssh copy, execute, sft, etc. creates Session everytime instead to use some existing ssh session. This can be corrected very easy with adding 2nd constructor with one Session parameter and get/set session like that: public SSHBase(Session session) { this.session = session; } public Session getSession() { if(session == null || !session.isConnected()) { session = openSession(); } return session; } public void setSession(Session session) { this.session = session; } -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 45739] Problems with BaseDir when the ant is started as Java library from Java Application
https://issues.apache.org/bugzilla/show_bug.cgi?id=45739 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Severity|blocker |normal --- Comment #1 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 05:48:56 PST --- blocker might a bit high as a priority since it isn't really blocking any usage Ant has been designed for 8-) -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 45740] SSHBase to be able to use external Session instead everytime to create new one
https://issues.apache.org/bugzilla/show_bug.cgi?id=45740 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE Target Milestone|--- |1.8.0 --- Comment #1 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 05:50:16 PST --- *** This bug has been marked as a duplicate of bug 43083 *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 43083] [SUBMIT] sshsession task
https://issues.apache.org/bugzilla/show_bug.cgi?id=43083 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Comment #9 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 05:50:16 PST --- *** Bug 45740 has been marked as a duplicate of this bug. *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
DO NOT REPLY [Bug 45741] New: fileset follows symlink if basedir is link and followsymlink is false
https://issues.apache.org/bugzilla/show_bug.cgi?id=45741 Summary: fileset follows symlink if basedir is link and followsymlink is false Product: Ant Version: 1.8Alpha (nightly) Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Core AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] CC: notifications@ant.apache.org see testBasedirIsSymlinkNoFollow in http://svn.apache.org/repos/asf/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
DO NOT REPLY [Bug 45742] New: delete fails if directory contains symlinks pointing back
https://issues.apache.org/bugzilla/show_bug.cgi?id=45742 Summary: delete fails if directory contains symlinks pointing back Product: Ant Version: 1.8Alpha (nightly) Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Core tasks AssignedTo: notifications@ant.apache.org ReportedBy: [EMAIL PROTECTED] run the target -link-to-parent in http://svn.apache.org/repos/asf/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml delete dir=${input}/ fails after that. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 45743] New: symlink action=delete fails for links pointing to parents
https://issues.apache.org/bugzilla/show_bug.cgi?id=45743 Summary: symlink action=delete fails for links pointing to parents Product: Ant Version: 1.8Alpha (nightly) Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Optional Tasks AssignedTo: notifications@ant.apache.org ReportedBy: [EMAIL PROTECTED] after running -link-to-parent in http://svn.apache.org/repos/asf/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml symlink fails to delete the link ${base}/A. The reason is that symlink first renames the directory linked to and then tries to remove the link - but that way the link's name has changed and the File object points to a no longer existant file. -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 36658] Delete task follows symlinks - bad behavior
https://issues.apache.org/bugzilla/show_bug.cgi?id=36658 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added CC||notifications@ant.apache.org AssignedTo|notifications@ant.apache.org|[EMAIL PROTECTED] -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. You are the assignee for the bug.
DO NOT REPLY [Bug 44013] Add delete-dir-only-if-empty FAQ entry
https://issues.apache.org/bugzilla/show_bug.cgi?id=44013 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #2 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:13:10 PST --- svn revision 692000, thanks! -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 44655] symlink delete fails
https://issues.apache.org/bugzilla/show_bug.cgi?id=44655 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE --- Comment #1 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:14:43 PST --- *** This bug has been marked as a duplicate of bug 41525 *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 41525] Unable to delete symlink when permissions incorrect on target
https://issues.apache.org/bugzilla/show_bug.cgi?id=41525 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Comment #1 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:14:43 PST --- *** Bug 44655 has been marked as a duplicate of this bug. *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
svn commit: r692003 - /ant/core/trunk/docs/faq.html
Author: bodewig Date: Thu Sep 4 06:20:19 2008 New Revision: 692003 URL: http://svn.apache.org/viewvc?rev=692003view=rev Log: re-generate site Modified: ant/core/trunk/docs/faq.html Modified: ant/core/trunk/docs/faq.html URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/faq.html?rev=692003r1=692002r2=692003view=diff == --- ant/core/trunk/docs/faq.html (original) +++ ant/core/trunk/docs/faq.html Thu Sep 4 06:20:19 2008 @@ -291,6 +291,10 @@ How can I delete everything beneath a particular directory, preserving the directory itself? /a/li +lia href=#delete-directory-only-if-empty + How can I delete a particular directory, +if and only if it is empty? + /a/li /ul h4 class=tocIt doesn't work (as expected)/h4 ul @@ -1167,6 +1171,22 @@ lt;fileset dir=quot;dirtokeepquot; includes=quot;**/*quot; /gt; lt;/deletegt; /pre +p class=faq + a name=delete-directory-only-if-empty/a + How can I delete a particular directory, +if and only if it is empty? +/p + pMost users who go down this path have no problem figuring + out that + codelt;delete includeemptydirs=true /gt;/code will + help them. The seemingly tricky part is preserving the + non-empty directories, which Ant includes in the directory + scan. Fortunately the answer is simple:/p +pre class=code +lt;delete includeemptydirs=quot;truequot;gt; + lt;fileset dir=quot;dirtokeepifnotemptyquot; excludes=quot;**/*quot; /gt; +lt;/deletegt; +/pre p class=faq a name=general-advice/a General Advice
DO NOT REPLY [Bug 19252] untar does not untar symbolic links properly
https://issues.apache.org/bugzilla/show_bug.cgi?id=19252 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Comment #3 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:26:26 PST --- *** Bug 43187 has been marked as a duplicate of this bug. *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 43187] untar does not create symlinks
https://issues.apache.org/bugzilla/show_bug.cgi?id=43187 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE --- Comment #1 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:26:26 PST --- *** This bug has been marked as a duplicate of bug 19252 *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 36658] Delete task follows symlinks - bad behavior
https://issues.apache.org/bugzilla/show_bug.cgi?id=36658 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Comment #2 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:31:57 PST --- *** Bug 22632 has been marked as a duplicate of this bug. *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
DO NOT REPLY [Bug 36658] Delete task follows symlinks - bad behavior
https://issues.apache.org/bugzilla/show_bug.cgi?id=36658 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Keywords||PatchAvailable -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
DO NOT REPLY [Bug 22632] Delete follows symbolic links to directories
https://issues.apache.org/bugzilla/show_bug.cgi?id=22632 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||DUPLICATE --- Comment #9 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:31:57 PST --- even though bug 36658 I mark them this way around since the later contains a (not yet evaluated) patch. *** This bug has been marked as a duplicate of bug 36658 *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 43689] Need a way to add symlinks to a tar
https://issues.apache.org/bugzilla/show_bug.cgi?id=43689 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE --- Comment #5 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:32:59 PST --- *** This bug has been marked as a duplicate of bug 40059 *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
DO NOT REPLY [Bug 40059] Add method to explicitly define symlinks in tar task
https://issues.apache.org/bugzilla/show_bug.cgi?id=40059 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added CC||[EMAIL PROTECTED] --- Comment #1 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 06:32:59 PST --- *** Bug 43689 has been marked as a duplicate of this bug. *** -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
svn commit: r692047 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
Author: bodewig Date: Thu Sep 4 07:28:04 2008 New Revision: 692047 URL: http://svn.apache.org/viewvc?rev=692047view=rev Log: allow symlink to delete broken links. Part of PR 41285. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=692047r1=692046r2=692047view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Thu Sep 4 07:28:04 2008 @@ -91,6 +91,11 @@ locale. Bugzilla Report 44659. + * symlink action=delete used to fail if the link was broken (i.e. + pointing to a file or directory that no longer existed). It will now + silently try to remove the link. + Bugzilla Report 41285. + Fixed bugs: --- Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=692047r1=692046r2=692047view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java Thu Sep 4 07:28:04 2008 @@ -391,7 +391,11 @@ * rename the resource (breaking the link) and then deleting the link. * The resource is then returned to its original name inside a finally * block to ensure that the resource is unharmed even in the event of - * an exception. + * an exception./p + * + * pSince Ant 1.8.0 this method will try to delete the File object if + * it reports it wouldn't exist (as symlinks pointing nowhere usually do). + * Prior version would throw a FileNotFoundException in that case./p * * @param linkfilA codeFile/code object of the symlink to delete. * @@ -403,7 +407,8 @@ public static void deleteSymlink(File linkfil) throws IOException { if (!linkfil.exists()) { -throw new FileNotFoundException(No such symlink: + linkfil); +linkfil.delete(); +return; } // find the resource of the existing link: File canfil = linkfil.getCanonicalFile(); Modified: ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml?rev=692047r1=692046r2=692047view=diff == --- ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml (original) +++ ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml Thu Sep 4 07:28:04 2008 @@ -62,4 +62,11 @@ resource=${file_ref}/ /target + target name=testDeleteOfBrokenLink depends=init if=unix +symlink link=${output}/link resource=${file_ref}/ +delete file=${file_ref}/ +symlink link=${output}/link action=delete/ +au:assertFileDoesntExist file=${output}/link/ + /target + /project
DO NOT REPLY [Bug 41285] delete and symlink tasks do not delete a symlink if its target does not exist
https://issues.apache.org/bugzilla/show_bug.cgi?id=41285 --- Comment #10 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 07:28:25 PST --- symlink action=delete .../ should work with svn revision 692047 -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
DO NOT REPLY [Bug 45499] DirectoryScanner infinitely recurses on symlinks to parent directories
https://issues.apache.org/bugzilla/show_bug.cgi?id=45499 --- Comment #6 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 07:30:05 PST --- dev thread started http://marc.info/?l=ant-devm=122053158307830w=2 -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
DO NOT REPLY [Bug 45743] symlink action=delete fails for links pointing to parents
https://issues.apache.org/bugzilla/show_bug.cgi?id=45743 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED Target Milestone|--- |1.8.0 Version|1.8Alpha (nightly) |1.7.1 --- Comment #1 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 07:57:19 PST --- fixed with svn revision 692081 -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
svn commit: r692081 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java src/tests/antunit/core/dirscanner-symlinks-test.xml src/tests/antunit/taskdefs/opti
Author: bodewig Date: Thu Sep 4 07:57:04 2008 New Revision: 692081 URL: http://svn.apache.org/viewvc?rev=692081view=rev Log: symlink delete now works if the link points to a parent directory as well. PR 45743. Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=692081r1=692080r2=692081view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Thu Sep 4 07:57:04 2008 @@ -196,6 +196,10 @@ contained line feeds some excess output ended up in Ant's log. Bugzilla Report 45411. + * symlink action=delete failed to delete a link that pointed to + a parent directory. + Bugzilla Report 45743. + Other changes: -- Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=692081r1=692080r2=692081view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java Thu Sep 4 07:57:04 2008 @@ -386,13 +386,19 @@ * pThis is a utility method that removes a unix symlink without removing * the resource that the symlink points to. If it is accidentally invoked * on a real file, the real file will not be harmed, but an exception - * will be thrown when the deletion is attempted. This method works by + * will be thrown when the deletion is attempted./p + * + * pNormaly this method works by * getting the canonical path of the link, using the canonical path to * rename the resource (breaking the link) and then deleting the link. * The resource is then returned to its original name inside a finally * block to ensure that the resource is unharmed even in the event of * an exception./p * + * pThere may be cases where the algorithm described above doesn't work, + * in that case the method tries to use the native rm command on + * the symlink instead./p + * * pSince Ant 1.8.0 this method will try to delete the File object if * it reports it wouldn't exist (as symlinks pointing nowhere usually do). * Prior version would throw a FileNotFoundException in that case./p @@ -410,12 +416,22 @@ linkfil.delete(); return; } + // find the resource of the existing link: File canfil = linkfil.getCanonicalFile(); // rename the resource, thus breaking the link: File temp = FILE_UTILS.createTempFile(symlink, .tmp, - canfil.getParentFile(), false, false); + canfil.getParentFile(), false, + false); + +if (FILE_UTILS.isLeadingPath(canfil, linkfil)) { +// link points to a parent directory, renaming the parent +// will rename the file +linkfil = new File(temp, + FILE_UTILS.removeLeadingPath(canfil, linkfil)); +} + try { try { FILE_UTILS.rename(canfil, temp); Modified: ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml?rev=692081r1=692080r2=692081view=diff == --- ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml (original) +++ ant/core/trunk/src/tests/antunit/core/dirscanner-symlinks-test.xml Thu Sep 4 07:57:04 2008 @@ -81,9 +81,7 @@ copy todir=${output} fileset dir=${base} followsymlinks=true/ /copy -exec executable=rm - arg file=${base}/A/ -/exec +symlink action=delete link=${base}/A/ au:assertFileExists file=${output}/A/B/file.txt/ /target @@ -95,9 +93,7 @@ include name=A/B/*/ /fileset /copy -exec executable=rm - arg file=${base}/A/ -/exec +symlink action=delete link=${base}/A/ au:assertFileExists file=${output}/A/B/file.txt/ /target @@ -110,9 +106,7 @@ include name=A/base/A/B/*/ /fileset /copy -exec executable=rm - arg file=${base}/A/ -/exec +symlink action=delete link=${base}/A/ au:assertFileExists file=${output}/A/base/A/B/file.txt/ /target @@ -122,9 +116,7 @@ copy
DO NOT REPLY [Bug 41525] Unable to delete symlink when permissions incorrect on target
https://issues.apache.org/bugzilla/show_bug.cgi?id=41525 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added CC||notifications@ant.apache.org AssignedTo|notifications@ant.apache.org|[EMAIL PROTECTED] -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. You are the assignee for the bug.
svn commit: r692083 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
Author: bodewig Date: Thu Sep 4 08:02:27 2008 New Revision: 692083 URL: http://svn.apache.org/viewvc?rev=692083view=rev Log: whitespace Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=692083r1=692082r2=692083view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java Thu Sep 4 08:02:27 2008 @@ -449,15 +449,16 @@ } } finally { if (renamedTarget) { -// return the resource to its original name: -try { -FILE_UTILS.rename(temp, canfil); -} catch (IOException e) { -throw new IOException(Couldn't return resource + temp -+ to its original name: + canfil.getAbsolutePath() -+ \n THE RESOURCE'S NAME ON DISK HAS -+ BEEN CHANGED BY THIS ERROR!\n); -} +// return the resource to its original name: +try { +FILE_UTILS.rename(temp, canfil); +} catch (IOException e) { +throw new IOException(Couldn't return resource + temp + + to its original name: + + canfil.getAbsolutePath() + + \n THE RESOURCE'S NAME ON DISK HAS + + BEEN CHANGED BY THIS ERROR!\n); +} } } }
[jira] Created: (IVY-895) Transactional Publishing to the FileSytemResolver doesn't work as expected.
Transactional Publishing to the FileSytemResolver doesn't work as expected. --- Key: IVY-895 URL: https://issues.apache.org/jira/browse/IVY-895 Project: Ivy Issue Type: Bug Components: Core Affects Versions: 2.0.0-beta-2 Environment: Windows XP Professional SP2, Sun JDK 1.5.17, 3Gb Ram, 8 Core Xeon processor. Reporter: Steve Brown After publishing with transactional=auto, the revisions directory in the jars directory has a name like 1.0.part. The corresponding directory in the ivys directory has a correct name like 1.0 The Ivy settings file is: ?xml version=1.0 encoding=UTF-8? ivysettings property name=build.ivy.cache.dir value=ivy/cache override=false/ property name=build.ivy.repo.url value=http://lonespappd0a.uk.db.com:8770/repo; override=false/ property name=build.ivy.resolver value=url-resolve override=false/ caches defaultCacheDir=${build.ivy.cache.dir} defaultResolver=${build.ivy.resolver} / resolvers url name=url-resolve latest=latest-revision ivy pattern=${build.ivy.repo.url}/[organisation]/[module]/ivys/[module]-[revision].xml / artifact pattern=${build.ivy.repo.url}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext] / artifact pattern=${build.ivy.repo.url}/[organisation]/[module]/[type]s/[artifact].[ext] / ivy pattern=${build.ivy.repo.url}/[organisation]/[module]/ivys/[revision]/[module]-[revision].xml / artifact pattern=${build.ivy.repo.url}/[organisation]/[module]/[type]s/[revision]/[artifact]-[revision].[ext] / artifact pattern=${build.ivy.repo.url}/[organisation]/[module]/[type]s/[revision]/[artifact].[ext] / /url filesystem name=fs latest=latest-revision ivy pattern=${build.local.ivy.repository}/[organisation]/[module]/ivys/[module]-[revision].xml / artifact pattern=${build.local.ivy.repository}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext] / artifact pattern=${build.local.ivy.repository}/[organisation]/[module]/[type]s/[artifact].[ext] / ivy pattern=${build.local.ivy.repository}/[organisation]/[module]/ivys/[revision]/[module]-[revision].xml / artifact pattern=${build.local.ivy.repository}/[organisation]/[module]/[type]s/[revision]/[artifact]-[revision].[ext] / artifact pattern=${build.local.ivy.repository}/[organisation]/[module]/[type]s/[revision]/[artifact].[ext] / /filesystem filesystem name=fs1 latest=latest-revision transactional=false ivy pattern=${build.local.ivy.repository}/[organisation]/[module]/[type]s/[revision]/[module]-[revision].xml / artifact pattern=${build.local.ivy.repository}/[organisation]/[module]/[type]s/[revision]/[artifact]-[revision].[ext] / /filesystem /resolvers modules module organisation=.* name=.* resolver=${build.ivy.resolver} / /modules /ivysettings The Ivy file is: ?xml version=1.0 encoding=UTF-8? ivy-module version=1.3 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:noNamespaceSchemaLocation=http://ant.apache.org/ivy/schemas/ivy.xsd; info organisation=org module=module / publications artifact name=xyz type=jar/ /publications dependencies dependency org=checkstyle name=checkstyle rev=latest.integration / dependency org=pmd name=pmd rev=latest.integration / dependency org=xxx name=all rev=latest.integration include name=/ /dependency dependency org=xxx name=j2ee rev=latest.integration / /dependencies /ivy-module The Ant target is like this: target name=publish.to.ivy depends=init.ivy description=Publish the jar file to the Ivy repository echoproperties prefix=ivy/ property name=ivy.deliver.revision value=${ivy.new.revision}/ ivy:publish resolver=fs1 status=integration update=true artifacts pattern=${build.packages.dir}/[artifact].[ext]/ /ivy:publish /target -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
DO NOT REPLY [Bug 41525] Unable to delete symlink when permissions incorrect on target
https://issues.apache.org/bugzilla/show_bug.cgi?id=41525 Stefan Bodewig [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED Target Milestone|--- |1.8.0 --- Comment #2 from Stefan Bodewig [EMAIL PROTECTED] 2008-09-04 08:44:48 PST --- fixed with svn revisions 692082 and 692115 -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug.
svn commit: r692115 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java src/tests/antunit/taskdefs/optional/unix/symlink-test.xml
Author: bodewig Date: Thu Sep 4 08:44:24 2008 New Revision: 692115 URL: http://svn.apache.org/viewvc?rev=692115view=rev Log: fall back to rm if target cannot be renamed when deleting a symlink Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java ant/core/trunk/src/tests/antunit/taskdefs/optional/unix/symlink-test.xml Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=692115r1=692114r2=692115view=diff == --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Thu Sep 4 08:44:24 2008 @@ -200,6 +200,10 @@ a parent directory. Bugzilla Report 45743. + * symlink action=delete failed if ant lacked permission to rename + the link's target. + Bugzilla Report 41525. + Other changes: -- Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=692115r1=692114r2=692115view=diff == --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java Thu Sep 4 08:44:24 2008 @@ -47,6 +47,7 @@ import org.apache.tools.ant.Project; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.Task; import org.apache.tools.ant.dispatch.DispatchTask; import org.apache.tools.ant.dispatch.DispatchUtils; import org.apache.tools.ant.taskdefs.Execute; @@ -181,7 +182,7 @@ return; } log(Removing symlink: + link); -deleteSymlink(link); +deleteSymlink(link, this); } catch (FileNotFoundException fnfe) { handleError(fnfe.toString()); } catch (IOException ioe) { @@ -215,7 +216,7 @@ doLink(res, lnk); } else if (!test.getCanonicalPath().equals( new File(res).getCanonicalPath())) { -deleteSymlink(lnk); +deleteSymlink(lnk, this); doLink(res, lnk); } // else lnk exists, do nothing } catch (IOException ioe) { @@ -383,22 +384,36 @@ /** * Delete a symlink (without deleting the associated resource). * + * pThis is a convenience method that simply invokes + * codedeleteSymlink(java.io.File)/code. + * + * @param pathA string containing the path of the symlink to delete. + * + * @throws FileNotFoundException When the path results in a + * codeFile/code that doesn't exist. + * @throws IOException If calls to codeFile.rename/code + * or codeFile.delete/code fail. + */ +public static void deleteSymlink(String path, Task t) +throws IOException, FileNotFoundException { +deleteSymlink(new File(path), t); +} + +/** + * Delete a symlink (without deleting the associated resource). + * * pThis is a utility method that removes a unix symlink without removing * the resource that the symlink points to. If it is accidentally invoked * on a real file, the real file will not be harmed, but an exception * will be thrown when the deletion is attempted./p * - * pNormaly this method works by + * pThis method works by * getting the canonical path of the link, using the canonical path to * rename the resource (breaking the link) and then deleting the link. * The resource is then returned to its original name inside a finally * block to ensure that the resource is unharmed even in the event of * an exception./p * - * pThere may be cases where the algorithm described above doesn't work, - * in that case the method tries to use the native rm command on - * the symlink instead./p - * * pSince Ant 1.8.0 this method will try to delete the File object if * it reports it wouldn't exist (as symlinks pointing nowhere usually do). * Prior version would throw a FileNotFoundException in that case./p @@ -409,9 +424,43 @@ * codeFile.delete/code or * codeFile.getCanonicalPath/code * fail. + * @deprecated use the two-arg version which also works if the link's + * target can not be renamed. */ public static void deleteSymlink(File linkfil) throws IOException { +deleteSymlink(linkfil, null); +} + +/** + * Delete
DO NOT REPLY [Bug 45746] New: task sql with child fileset that has child include with if attribute could not work properly
https://issues.apache.org/bugzilla/show_bug.cgi?id=45746 Summary: task sql with child fileset that has child include with if attribute could not work properly Product: Ant Version: 1.7.1 Platform: PC OS/Version: Windows Vista Status: NEW Severity: critical Priority: P2 Component: Core tasks AssignedTo: notifications@ant.apache.org ReportedBy: [EMAIL PROTECTED] my build.xml can not work properly, all attaches as below. if I remove attribute if , it works OK. and the output as below : --- [sql] connecting to jdbc:oracle:thin:@192.168.1.22:1521:ORCL [sql] Loading oracle.jdbc.driver.OracleDriver using AntClassLoader with classpath --- if I remain attribute if, but add code at position (1) in build.xml, the ant not work, the output show same error. ---inserted code property name=local.dbinit.exist1 value=true / property name=local.dbinit.exist2 value=true / property name=local.dbinit.exist3 value=true / property name=local.dbinit.exist4 value=true / then I trace into ant's code, the last method code is below, and behavior == ADD, so if condition is false and fileset object ignored: void store(Object parent, Object child) throws InvocationTargetException, IllegalAccessException, InstantiationException { if (behavior == ADD_CONFIGURED) { // real value of behavior is 1, jumped istore(parent, child); } } call stack is: =IntrospectionHelper$AddNestedCreator.store#1293 =IntrospectionHelper$Creator.store#1201 =UnknownElement.java#570 ==disk file tree (vista tree output) D:\work\platform\frrp │ .project │ .tomcatplugin │ build-win.properties │ build.properties │ build.xml │ hbm.properties │ ├─design │ db-frrp-oracle.sql │ init-frrp.sql │ └─work tldCache.ser === my build.xml = !-- = target: dbinit = -- target name=dbinit depends=_dbconfig description=== init and load data echo message=LOAD DATA USING: ${db.driver} ${db.connection.url} / !-- position (0), add debug code here -- available property=local.dbinit.exist1 file=${output.db.script.dir}/db-${project.name}-${db.server.type}-extra.sql / available property=local.dbinit.exist2 file=${output.db.script.dir}/db-${project.name}-extra.sql / available property=local.dbinit.exist3 file=${output.db.script.dir}/init-${project.name}-${db.server.type}.sql / available property=local.dbinit.exist4 file=${output.db.script.dir}/init-${project.name}.sql / sql driver=${db.driver} url=${db.connection.url} userid=${db.user} password=${db.pass} onerror=continue classpath refid=test-classpath / fileset dir=${output.db.script.dir} include name=db-${project.name}-${db.server.type}-extra.sql if=${local.dbinit.exist1} / include name=db-${project.name}-extra.sql if=${local.dbinit.exist2} / include name=init-${project.name}-${db.server.type}.sql if=${local.dbinit.exist3} / include name=init-${project.name}.sql if=${local.dbinit.exist4} / /fileset /sql /target !-- _dbconfig only set some property value about jdbc and hibernate(it will auto check hibernate version) -- target name=_dbconfig depends=__db_config,__init_hibernate /target target name=__init_hibernate depends=___check_hibernate,___init_hibernate2,___init_hibernate3 taskdef name=schemaexport classname=${db.hibernate.tool.package}.SchemaExportTask classpathref=hibernate_classpath / taskdef name=schemaupdate classname=${db.hibernate.tool.package}.SchemaUpdateTask classpathref=hibernate_classpath/ echouse hibernate class:/echo echo db.hibernate.schemaexporttask=${db.hibernate.tool.package}.SchemaExportTask/echo echo db.hibernate.dialect=${db.hibernate.dialect}/echo /target target name=___check_hibernate depends=_init_classpath available classname=net.sf.hibernate.tool.hbm2ddl.SchemaExportTask classpathref=classpath property=hibernate2_support / available classname=org.hibernate.tool.hbm2ddl.SchemaExportTask classpathref=classpath property=hibernate3_support / path id=hibernate_classpath path
[jira] Commented: (IVY-885) Invalid URL when using dynamic ranges
[ https://issues.apache.org/jira/browse/IVY-885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12628404#action_12628404 ] Jim Bonanno commented on IVY-885: - I backported your changes to the version of ivy we are using and the patch works great. Thanks for fixing this issue so quickly. Invalid URL when using dynamic ranges - Key: IVY-885 URL: https://issues.apache.org/jira/browse/IVY-885 Project: Ivy Issue Type: Bug Components: Core Affects Versions: 2.0.0-beta-1 Reporter: Jim Bonanno Assignee: Maarten Coene Fix For: 2.0-RC1 Sorry to have two url issues in one day. We are using ivy's ranges to resolve our modules. Ivy first tries to see if the specified version exists before listing the repository. The issue that we hit was when using the range [1,2[. The first request is http://myhost/my-repo/org/module/ivys/ivy-[1,2[.xml. This URL is not properly escaped, but apache apparently is very forgiving. When we hosted the ivy repository with another web server that validated the urls the returned status code was not a 404. We are working around the problem by again using URI to build the URL so it gets properly escaped. There seems to be some tricks to using the URI class. For example, the constructor that takes a string requires the string is already rfc 2396 compliant. The other constructors will actually escape the URL. Here is the modifications we made to the BasicURLHandler. if ( url.getProtocol().equals(http) || url.getProtocol().equals(https)) { try { URI uri = new URI(url.getProtocol(), null, url.getHost(), url.getPort(), url.getPath(), null, null); url = uri.toURL(); } catch ( URISyntaxException e ) { IOException ioe = new IOException(Couldn't open connection to ' + url.toString() + '); ioe.initCause(e); throw ioe; } } con = url.openConnection(); which results in a request http://myhost/my-repo/org/module/ivys/ivy-%5B1,2%5B.xml. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.