You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2009/10/15 18:02:58 UTC

DO NOT REPLY [Bug 48001] New: Touch task with fileset and a mapper does not create new files.

https://issues.apache.org/bugzilla/show_bug.cgi?id=48001

           Summary: Touch task with fileset and a mapper does not create
                    new files.
           Product: Ant
           Version: 1.7.1
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: notifications@ant.apache.org
        ReportedBy: alex-pub.apache-ant@reflexion.net


I am trying to create a shadow directory to keep the timestamps of the files in
the original directory tree.

For this I have tried to use the <touch> task with fileset and a glob mapper.

    <mkdir dir="${shadow.dir}/>

    <touch mkdirs="true" verbose="true">
      <fileset dir="${orig.dir}"/>
      <globmapper handledirsep="true"
        from="${orig.dir}/*"
        to="${shadow.dir}/*"
      />
    </touch>

Based on the description of the <touch> task I should have a collection of
empty files in ${shadow.dir} at the same level as original files in
${orig.dir}.

However no directory structure is created.
Using <pathconvert> with the same <fileset> and <mapper> produced a valid file
list.

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

Re: DO NOT REPLY [Bug 48001] Document differences between tasks' usage of mappers in some fashion.

Posted by Stefan Bodewig <bo...@apache.org>.
On 2009-10-15, Matt Benson <gu...@yahoo.com> wrote:

> It seems that tasks that use mappers usually apply the mapper to a
> resource name; some tasks, like pathconvert, however, apply the mapper
> to the string representation of a resource (e.g. full path for a file
> resource).  Do we consider pathconvert's behavior anomalous enough to
> call it a bug?

I'm not sure.  Given the original use-case of Bugzilla issue 48001 I
would have expected it to work with absolute path names.

mappers should be applied to resource.getName() not toString() in
general, I agree.  Maybe I'm more surprised that the fileset resources
are not returning their full path name as their name then.

Anyway, I agree pathconvert's behavior is anomalous but it probably is
the way it is to preserve backwards compatibility to the pre-resource
collection implementation.

> I am thinking our basic approach should be to document that name-only
> is the usual usage, then document task-level exceptions to this "rule"
> as we encounter them.

Sounds good.

Stefan

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


Re: DO NOT REPLY [Bug 48001] Document differences between tasks' usage of mappers in some fashion.

Posted by Matt Benson <gu...@yahoo.com>.
It seems that tasks that use mappers usually apply the mapper to a resource name; some tasks, like pathconvert, however, apply the mapper to the string representation of a resource (e.g. full path for a file resource).  Do we consider pathconvert's behavior anomalous enough to call it a bug?  Or rather, would we consider it so if we weren't afraid of breaking builds?  I am thinking our basic approach should be to document that name-only is the usual usage, then document task-level exceptions to this "rule" as we encounter them.  Opinions?

-Matt

--- On Thu, 10/15/09, bugzilla@apache.org <bu...@apache.org> wrote:

> From: bugzilla@apache.org <bu...@apache.org>
> Subject: DO NOT REPLY [Bug 48001] Document differences between tasks' usage of mappers in some fashion.
> To: notifications@ant.apache.org
> Date: Thursday, October 15, 2009, 2:57 PM
> https://issues.apache.org/bugzilla/show_bug.cgi?id=48001
> 
> Matt Benson <gu...@yahoo.com>
> changed:
> 
>            What 
>   |Removed           
>          |Added
> ----------------------------------------------------------------------------
>           Component|Core
> tasks               
>   |Documentation
>             Summary|Touch
> task with fileset and |Document differences
>                
>    |a mapper does not create   
> |between tasks' usage of
>                
>    |new files.       
>           |mappers in some
> fashion.
> 
> -- 
> Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are the assignee for the bug.
> 


      

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


DO NOT REPLY [Bug 48001] Document differences between tasks' usage of mappers in some fashion.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48001

Matt Benson <gu...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|Core tasks                  |Documentation
            Summary|Touch task with fileset and |Document differences
                   |a mapper does not create    |between tasks' usage of
                   |new files.                  |mappers in some fashion.

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

DO NOT REPLY [Bug 48001] Touch task with fileset and a mapper does not create new files.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48001

--- Comment #2 from Alexander Pogrebnyak <al...@reflexion.net> 2009-10-15 12:41:56 UTC ---
(In reply to comment #1)
Thank you Matt.  Worked as a charm.

Could you explain, then, why <pathconvert> does not bulk at me, but produces
totally expected output?

In fact, when I change to the same mapper in <pathconvert> I get the names in
this format: "C:\test\shadow-dir/C:\test\orig-dir\file".  Is it a bug in
<pathconvert> then?

Basically, what needed is a reliable way to test the results of mapping applied
to a fileset.

So, can I ask as a resolution for this problem to update Ant manual for a
<touch> task with an example of a fileset with a mapper?

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

DO NOT REPLY [Bug 48001] Touch task with fileset and a mapper does not create new files.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48001

--- Comment #3 from Matt Benson <gu...@yahoo.com> 2009-10-15 12:56:32 UTC ---
It might be reasonable to come up with some more generic solution for
documenting the differences in behavior among tasks using mappers.  This
probably requires more analysis and should be taken to the dev@ant.apache.org
mailing list.  Let's change the description of this bug report accordingly.

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

DO NOT REPLY [Bug 48001] Touch task with fileset and a mapper does not create new files.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48001

--- Comment #1 from Matt Benson <gu...@yahoo.com> 2009-10-15 10:49:25 UTC ---
This is probably a manifestation of one of the slightly confusing things about
Ant mappers.  Mappers generally apply to the "names" of resources, which, in
the case of a fileset, would be the part of the path relative to the basedir. 
Try changing your from attribute on your mapper to "*" and see whether that
doesn't give the results you want.

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

DO NOT REPLY [Bug 48001] Document differences between tasks' usage of mappers in some fashion.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48001

--- Comment #4 from Alexander Pogrebnyak <al...@reflexion.net> 2009-10-15 13:49:28 UTC ---
(In reply to comment #3)
Thank you guys, you rock!!!

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