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: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to