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 2007/08/29 11:06:41 UTC

DO NOT REPLY [Bug 43235] New: - Touch with mapper brokken

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=43235>.
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=43235

           Summary: Touch with mapper brokken
           Product: Ant
           Version: 1.7.0
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: l117@worsaae.dk


If one uses touch with a mapper touch ignores the millis or datetime atributes
Instead touch uses the timestamp of the Resource. This happens due to:
                long modTime = (r.isExists()) ? r.getLastModified()
                    : defaultTimestamp;
in org.apache.tools.ant.taskdefs.Touch

This prohibits one from setting the time of the target file to a value defined 
in build.xml

A clean implementation would just ignore the time of the resource file
An advanced implementation could use the time of the resource file UNLESS one 
of the millis or datetime attributes is set

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From peterreilly@apache.org  2007-08-29 08:01 -------
I release that this is documented and that is the intention
of the code. However it is very strange (unexpected) to
ignore the setting given in the build file:

        <touch datetime="03/03/2003 03:33 AM">
            <fileset dir="test" includes="src/**/*.java" />
            <mapper type="regexp" from="^src(.*)\.java$$"
to="test/classes\1.class"/>        
        </touch>

It is clearly (I think) the intent of the build author to set the date on the
class files to the datetime attribute, whereas:
        <touch>
            <fileset dir="test" includes="src/**/*.java" />
            <mapper type="regexp" from="^src(.*)\.java$$"
to="test/classes\1.class"/>        
        </touch>
one could argue that the timestamps of the .class files should be
set to the timestamp of the correspond java files (although one
could also argue that this is also surprising behavior).

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From gudnabrsam@yahoo.com  2007-08-31 09:27 -------
(In reply to comment #10)
> I would be happy with "now". It would be nice
> to have a datatype that understood all the datetime
> conversion rules and could be used from a setDateTime(DateTime dateTime)
> attribute reflection method, so that this could
> be reused by other tasks (tstamp for example).
> 
> 

Hmmm, nice extrapolation.  Similar to what I did with Comparisons, TimeComparisons, etc.  :)

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From l117@worsaae.dk  2007-08-30 22:58 -------
Remark to comment #7
The only drawback is that this would prohibit using touch with mapper to do 
the most normal task for touch (to update to time=now)

Alternative suggestion:
Instead of a new attribute we could invent a new value for "datetime" the 
value "now"

Touch used without mapper -> behaviour unchanged
touch with mapper timestamp not specifeid -> inherrit time (as today)
touch with mapper and timestamp specified -> use the time specified
touch with mapper and timestamp specified as "now" -> set time to curent time

We could keep the current behaviour of timestamp transfering if no 

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From peterreilly@apache.org  2007-08-31 08:44 -------
I would be happy with "now". It would be nice
to have a datatype that understood all the datetime
conversion rules and could be used from a setDateTime(DateTime dateTime)
attribute reflection method, so that this could
be reused by other tasks (tstamp for example).



-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From peterreilly@apache.org  2007-08-29 13:23 -------
I think that the behavior should only be changed when
the datetime is specified. For the mapper without the
datetime being specified, we use the timestamps of the
mapped from files (if they exist). I am not too sure
that a new attribute is needed to control the behavior,
(we have quite enough attributes in ant already ;-)


-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From gudnabrsam@yahoo.com  2007-08-29 13:13 -------
(In reply to comment #5)
> I release that this is documented and that is the intention
> of the code. However it is very strange (unexpected) to
> ignore the setting given in the build file:
> 
>         <touch datetime="03/03/2003 03:33 AM">
>             <fileset dir="test" includes="src/**/*.java" />
>             <mapper type="regexp" from="^src(.*)\.java$$"
> to="test/classes\1.class"/>        
>         </touch>
> 

Okay, point taken.

> It is clearly (I think) the intent of the build author to set the date on the
> class files to the datetime attribute, whereas:
>         <touch>
>             <fileset dir="test" includes="src/**/*.java" />
>             <mapper type="regexp" from="^src(.*)\.java$$"
> to="test/classes\1.class"/>        
>         </touch>
> one could argue that the timestamps of the .class files should be
> set to the timestamp of the correspond java files (although one
> could also argue that this is also surprising behavior).

Your arguments are pretty good; I am fine with changing the behavior, especially when datetime|millis 
is specified.  I'm still up in the air on mapping without specifying modification time whether current 
time or inheriting time is more obviously correct.  Possibly the former, but can you think of an 
appropriate attribute to trigger "timestamp inheritance"?

-Matt


-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From l117@worsaae.dk  2007-08-29 04:00 -------
Created an attachment (id=20724)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=20724&action=view)
build.xml showing the problem

ant setup creates the files and dirs needed for the demo
ant touch demo will
First time after setup) create the file MySourceFile.class with the time stamp 

of the java file
Second time update the timestamp of MySourceFile.class to what ever timestamp
is (now) on the java file

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From gudnabrsam@yahoo.com  2007-08-29 07:55 -------
Whoa, wait--this is documented, intentional behavior:  The manual says "If the original file exists its 
timestamp will be used. Otherwise the task settings (millis, datetime) take effect."  The purpose of this is 
to make it easy to set up parallel directory structures that mimic your real setup without the storage 
impact.  If we want to provide an attribute to override this behavior, however, fine by me.

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From peterreilly@apache.org  2007-08-29 02:28 -------
Please provide a simple build file that shows the
problem, ta.

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From gudnabrsam@yahoo.com  2007-09-02 10:16 -------
Thanks, Martijn!

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235


jkf@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|ASSIGNED                    |RESOLVED
           Priority|P2                          |P3
         Resolution|                            |FIXED
   Target Milestone|---                         |1.8.0




------- Additional Comments From jkf@apache.org  2007-09-02 05:57 -------
Updated Touch task with the suggestions regarding the task here, including the
now (did not make the DateTime object, also didn't find other tasks that use
datetime)

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235





------- Additional Comments From gudnabrsam@yahoo.com  2007-08-31 08:13 -------
(In reply to comment #8)
> Remark to comment #7
> The only drawback is that this would prohibit using touch with mapper to do 
> the most normal task for touch (to update to time=now)
> 
> Alternative suggestion:
> Instead of a new attribute we could invent a new value for "datetime" the 
> value "now"
> 
> Touch used without mapper -> behaviour unchanged
> touch with mapper timestamp not specifeid -> inherrit time (as today)
> touch with mapper and timestamp specified -> use the time specified
> touch with mapper and timestamp specified as "now" -> set time to curent time
> 
> We could keep the current behaviour of timestamp transfering if no 

I also thought of timestamp="now" the other day.  :)  I think I would be okay with this but as it would 
only exist for this particular use case it's maybe a little weird... are you still with us, Peter?  WDYT?

-- 
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 43235] - Touch with mapper brokken

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=43235>.
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=43235


peterreilly@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED




------- Additional Comments From peterreilly@apache.org  2007-08-29 04:25 -------
Awesome, tak.
I will get a fix ready soon.
Peter



-- 
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