You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/05/11 03:41:59 UTC

DO NOT REPLY [Bug 39549] New: - available should NOT search parent directories

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39549>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39549

           Summary: available should NOT search parent directories
           Product: Ant
           Version: 1.6.5
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: Daniel.Martin@sungard.com


Why does the <available> task search directories it was not asked to search?

Although this behavior is COMPLETELY undocumented, the available task will, when
searching for a file, search not only the directories specified but will also
search the parent directories of those specified, and even the grandparent
directories.

That is, a task like this to determine whether a certain executeable is available:
    <target name="findsvn" depends="init" >
        <condition property="svn.available">
        <or>
        <available file="svn.exe" type="file" >
          <filepath>
            <pathelement path="${env.PATH}" />
            <pathelement path="${env.Path}" />
            <pathelement path="${env.path}" />
          </filepath>
        </available>
        <available file="svn" type="file" >
          <filepath>
            <pathelement path="${env.PATH}" />
          </filepath>
        </available>
        </or>
        </condition>
    </target>

Will say "true" EVEN WHEN THERE IS NO "svn" ON THE PATH, so long as there is a
file named "svn" or "svn.exe" in the parent or grandparent directory of
something that is on the path.  The practical upshot of this for us is that our
system logs get spammed with automount error messages by our automated build
process, as one of the directories that gets searched by this target is "/home"
(since we have "/home/ccuser/bin" on the path).

I cannot imagine why anyone would want available to behave this way, and
certainly can't imagine making it this way by default, with no option to turn
off the automatic searching of parent and grandparent directories.

It appears, however, that <available> has behaved this way for a long, long
time.  At the very least, this behavior should be documented.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 39549] - available should NOT search parent directories

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39549>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39549


peterreilly@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.7




------- Additional Comments From peterreilly@apache.org  2006-09-16 23:51 -------
I have changed <available> to only look in
the directories specified, and added an
optional searchparents attribute to allow
search *all* the parents.
Thanks for the report.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 39549] - available should NOT search parent directories

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=39549>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=39549





------- Additional Comments From peterreilly@apache.org  2006-09-06 20:21 -------
This is indeed strange behaviour - parent and grandparent
are searched but not greatgrandparent...

The code was added about four years ago, with the
comment asking for feedback. I have not checked the
e-mail at the time, but there must have been a reason??

I will ask on dev@ant, but in the meantime, I will
document the behaviour and add an attribute to disable
it.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org