Bug 32912 - copy should support filelists
Summary: copy should support filelists
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.2
Hardware: PC Linux
: P2 enhancement with 1 vote (vote)
Target Milestone: 1.7.0
Assignee: Ant Notifications List
URL:
Keywords:
Depends on: 18128
Blocks:
  Show dependency tree
 
Reported: 2005-01-02 04:19 UTC by Brian Lewis
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Lewis 2005-01-02 04:19:54 UTC
For some reason, the copy task doesn't support filelists. What happened?
Comment 1 Matt Benson 2005-01-03 17:28:10 UTC
A filelist may include files that do not exist.  How could you copy such a file?
 If you really needed to do this, you could write a macro to touch the files
from a filelist, convert it to a fileset, and then copy them.
Comment 2 Alexey Solofnenko 2005-01-03 18:36:37 UTC
<copy> could fail in this situation.
Comment 3 Matt Benson 2005-01-03 19:33:43 UTC
Which situation?  Using filelists, or using the touch workaround?
Comment 4 Alexey Solofnenko 2005-01-04 05:43:32 UTC
I meant if a file does not exist, <copy> should just fail.
Comment 5 Matt Benson 2005-01-04 15:56:51 UTC
Then, again, why allow filelists in the first place, if copying a nonexistent
file triggers failure?
Comment 6 Steve Loughran 2005-01-04 16:34:32 UTC
Why not think in broader terms than just <copy>, and provide a way to create a
fileset from a filelist, one that -on the point of creation- resolves what the
policy on missing files is. That is, it can skip them, or it can fail.

-steve
Comment 7 Matt Benson 2005-01-04 16:56:28 UTC
Creating a fileset from a filelist should already be doable using pathconvert. 
So all that is really needed is a condition asserting that all files in a
filelist exist, no?
Comment 8 Matt Benson 2005-01-04 17:02:10 UTC
Or, one could create the fileset from the filelist using a pathconvert as
suggested, then do another pathconvert on the created fileset and if the two are
not equal, files are missing from the filelist...
Comment 9 J.M. (Martijn) Kruithof 2005-01-04 17:34:38 UTC
current behaviour of tasks using the filelist for non-existent files:

Concat: Log an error but contine
DependSet: Log an warning and continue
ExecuteOn: Pass on the missing file to the command
PathConvert: just described above
SubAnt -> Path: Log a warning and continue or throw an exception dependent on
parameter.
Touch: Create the file if it does not exist.

As copy already has the fail on error i'd say follow the SubAnt behaviour: Log a
warning and continue or throw an exception dependent on the failonerror parameter.

It doesn't seem to be straightforward to extend FileList in such a way that it
would fail / create file / remove from list / pass-on the non-existent files in
both a backward compatible and consistent way.
Comment 10 Matt Benson 2005-05-26 20:15:20 UTC
<copy> is slated to be modified to support all resource collection types.
Comment 11 Matt Benson 2006-04-11 19:57:25 UTC
fixed in 1.7 (HEAD)