List Info

Thread: DO NOT REPLY New: - Touch task fails when fileset is empty




DO NOT REPLY New: - Touch task fails when fileset is empty
user name
2007-11-06 11:23:24
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=43
799>.
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=43799

           Summary: Touch task fails when fileset is empty
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P3
         Component: Core tasks
        AssignedTo: devant.apache.org
        ReportedBy: chris.learlaculine.com


The touch task gives the error "Specify at least one
source--a file or resource
collection." when the nested fileset yields no files to
touch.

It's a problem because I want to be able to touch files only
on certain
conditions. This build.xml snippet has been working fine in
ant 1.6.4:

        <touch>
            <fileset dir="web/WEB-INF"
               
includesfile="conf/filteredConfigFiles">
                <not>
                    <depend targetdir=".">
                        <mapper type="merge"
to="build.properties"/>
                    </depend>
                </not>
            </fileset>
        </touch>


This bug appears to have been introduced in revision 277936,
Mon Mar 14 11:45:29
2005 UTC. See the diff here (line 224):

http://svn.apache.org/viewvc/ant/core
/trunk/src/main/org/apache/tools/ant/taskdefs/Touch.java?r1=
277936&r2=349637&diff_format=h

I can get it working using this change:

$ svn diff src/main/org/apache/tools/ant/taskdefs/Touch.java

Index: src/main/org/apache/tools/ant/taskdefs/Touch.java
============================================================
=======
--- src/main/org/apache/tools/ant/taskdefs/Touch.java  
(revision 592480)
+++ src/main/org/apache/tools/ant/taskdefs/Touch.java  
(working copy)
 -222,7
+222,7 
      * since Ant 1.6.3
      */
     protected synchronized void checkConfiguration() throws
BuildException {
-        if (file == null && resources.size() == 0)
{
+        if (file == null && resources==null) {
             throw new BuildException("Specify at least
one source"
                                    + "--a file or
resource collection.");
         }


I'm not sure this is 100% appropriate, but it works for me.

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

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


DO NOT REPLY - Touch task fails when fileset is empty
user name
2007-11-06 11:25:19
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=43
799>.
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=43799





------- Additional Comments From gudnabrsamyahoo.com
 2007-11-06 09:25 -------
Yes, occasionally we have had to add checks to differentiate
between "nothing specified" and "nothing 
matched."  Thanks for the report!

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

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


DO NOT REPLY - Touch task fails when fileset is empty
user name
2007-11-06 12:35:56
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=43
799>.
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=43799


gudnabrsamyahoo.com changed:

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




------- Additional Comments From gudnabrsamyahoo.com
 2007-11-06 10:35 -------
Fixed in trunk and merged for 1.7.1.  Thanks again!

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

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


DO NOT REPLY - Touch task fails when fileset is empty
user name
2007-11-07 05:42:51
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=43
799>.
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=43799





------- Additional Comments From chris.learlaculine.com  2007-11-07 03:42 -------
Thanks. That was quick!

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

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeant.apache.org
For additional commands, e-mail: dev-helpant.apache.org


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )