Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #32245] [BUG] Makefile $(TOUCH), doesn't

17 views
Skip to first unread message

Jeff Clites

unread,
Oct 31, 2004, 3:33:53 PM10/31/04
to bugs-bi...@rt.perl.org
# New Ticket Created by Jeff Clites
# Please include the string: [perl #32245]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=32245 >


The Makefile uses this in place of the 'touch' command:

perl -e 'open(A,qq{>>$_}) or die foreach @ARGV'

On Mac OS X at least, this doesn't result in updating the timestamp of
the passed-in files. (Also, by my reading of the POSIX/SUSv3 spec, this
is correct behavior--open() isn't supposed to update the timestamp of
an existing file.)

I wonder if this works on any platform--maybe Win32?

I suggest that the value of TOUCH be configurable, defaulting to the
'touch' command on Unix-like systems--not sure what to use for other
systems. Or we could try this, which might work for all systems:

perl -e '$now = time; open(A,qq{>>$_}) && utime($now, $now, $_) or die
foreach @ARGV'

I don't know the origin of what we currently have, so I thought I'd
send this in for comment before supplying a patch.

(I noticed this because the "ast" part of the Makefile was firing for
me every time.)

JEff

Michael G Schwern

unread,
Oct 31, 2004, 8:18:48 PM10/31/04
to perl6-i...@perl.org
On Sun, Oct 31, 2004 at 12:33:53PM -0800, Jeff Clites wrote:
> The Makefile uses this in place of the 'touch' command:
>
> perl -e 'open(A,qq{>>$_}) or die foreach @ARGV'
>
> On Mac OS X at least, this doesn't result in updating the timestamp of
> the passed-in files. (Also, by my reading of the POSIX/SUSv3 spec, this
> is correct behavior--open() isn't supposed to update the timestamp of
> an existing file.)
>
> I wonder if this works on any platform--maybe Win32?
>
> I suggest that the value of TOUCH be configurable, defaulting to the
> 'touch' command on Unix-like systems--not sure what to use for other
> systems. Or we could try this, which might work for all systems:

ExtUtils::Command provides tested cross-platform versions of the most
common shell functions. These should be used.

For example:

perl -"MExtUtils::Command" -e touch


--
Michael G Schwern sch...@pobox.com http://www.pobox.com/~schwern/
IIRC someone observed that they couldn't name identifiers in Ethiopian,
because there was an Ethiopian character similar in function to _ which
wasn't in \w
-- Nicholas Clark demonstrates that the Internet works
in <2003081216...@plum.flirble.org>

0 new messages