Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 98440 invoked from network); 14 Sep 2006 20:18:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Sep 2006 20:18:11 -0000 Received: (qmail 24417 invoked by uid 500); 14 Sep 2006 20:18:10 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 24375 invoked by uid 500); 14 Sep 2006 20:18:10 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 24364 invoked by uid 500); 14 Sep 2006 20:18:10 -0000 Received: (qmail 24361 invoked by uid 99); 14 Sep 2006 20:18:09 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Sep 2006 13:18:09 -0700 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME Received: from ([140.211.166.113:56742] helo=eris.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id EA/30-07289-FF8B9054 for ; Thu, 14 Sep 2006 13:18:08 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id C38BA1A981A; Thu, 14 Sep 2006 13:18:05 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r443456 - in /ant/core/trunk: WHATSNEW docs/manual/CoreTasks/available.html src/etc/testcases/taskdefs/available.xml src/main/org/apache/tools/ant/taskdefs/Available.java Date: Thu, 14 Sep 2006 20:18:05 -0000 To: ant-cvs@apache.org From: peterreilly@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20060914201805.C38BA1A981A@eris.apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: peterreilly Date: Thu Sep 14 13:18:04 2006 New Revision: 443456 URL: http://svn.apache.org/viewvc?view=rev&rev=443456 Log: Bugzilla 39549: available should not search parent directories Modified: ant/core/trunk/WHATSNEW ant/core/trunk/docs/manual/CoreTasks/available.html ant/core/trunk/src/etc/testcases/taskdefs/available.xml ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Available.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=443456&r1=443455&r2=443456 ============================================================================== --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Thu Sep 14 13:18:04 2006 @@ -36,6 +36,9 @@ * documented minimal version of jsch now 0.1.29. Bugzilla report 40333. +* searched parent directories for files. + Bugzilla report 37148. + Other changes: -------------- Modified: ant/core/trunk/docs/manual/CoreTasks/available.html URL: http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/available.html?view=diff&rev=443456&r1=443455&r2=443456 ============================================================================== --- ant/core/trunk/docs/manual/CoreTasks/available.html (original) +++ ant/core/trunk/docs/manual/CoreTasks/available.html Thu Sep 14 13:18:04 2006 @@ -96,10 +96,10 @@ This contains the behaviour of the "file" type. If true, the available task will, when searching for a file, search not only the directories specified but - will also search the parent and grandparent directories of those + will also search the parent directories of those specified. If false, only the directories specified will be searched. - Defaults to "true". + Defaults to "false". Since Ant 1.7 No Modified: ant/core/trunk/src/etc/testcases/taskdefs/available.xml URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/testcases/taskdefs/available.xml?view=diff&rev=443456&r1=443455&r2=443456 ============================================================================== --- ant/core/trunk/src/etc/testcases/taskdefs/available.xml (original) +++ ant/core/trunk/src/etc/testcases/taskdefs/available.xml Thu Sep 14 13:18:04 2006 @@ -177,13 +177,15 @@ value="greatgrandparent/grandparent/parent/dir"/> - testing greatgrandparent - should not see + testing greatgrandparent - should see - - - + + + + + @@ -191,7 +193,7 @@ - + @@ -202,7 +204,7 @@ - + @@ -213,7 +215,7 @@ - + @@ -226,7 +228,7 @@ testing grandparent - should not see - + @@ -235,7 +237,7 @@ testing parent - should not see - + @@ -245,7 +247,7 @@ - + Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Available.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Available.java?view=diff&rev=443456&r1=443455&r2=443456 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Available.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/Available.java Thu Sep 14 13:18:04 2006 @@ -53,14 +53,14 @@ private String value = "true"; private boolean isTask = false; private boolean ignoreSystemclasses = false; - private boolean searchParents = true; + private boolean searchParents = false; /** * Set the searchParents attribute. * This controls the behaviour of the the "file" type. * If true, the path, parent path and grandparent path are * searched for the file. If false, only the path is seached. - * The default value is true. + * The default value is false. * @param searchParents the value to set. */ public void setSearchParents(boolean searchParents) { @@ -366,21 +366,12 @@ } } // ** simple name specified == parent dir + name - if (parent != null && parent.exists() && searchParents) { + while (searchParents && parent != null && parent.exists()) { if (checkFile(new File(parent, filename), filename + " in " + parent)) { return true; } - } - // ** simple name specified == parent of parent dir + name - if (parent != null && searchParents) { - File grandParent = parent.getParentFile(); - if (grandParent != null && grandParent.exists()) { - if (checkFile(new File(grandParent, filename), - filename + " in " + grandParent)) { - return true; - } - } + parent = parent.getParentFile(); } } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org