[Module::Build] Re: [Module-build-checkins] [svn:Module-Build] r5891 - in Module-Build/trunk: . lib/
Status: Beta
Brought to you by:
kwilliams
|
From: Ken W. <ke...@ma...> - 2006-04-11 22:36:20
|
Hey,
I wonder whether we should check for executability with "-x $file"
rather than "(stat $file)[2] & 0111". Besides being simpler, it
seems like it might DTRT on more platforms, where stat values might
be nontrustworthy.
-Ken
On Apr 11, 2006, at 3:30 AM, ra...@cv... wrote:
> ======================================================================
> ========
> --- Module-Build/trunk/lib/Module/Build/Base.pm (original)
> +++ Module-Build/trunk/lib/Module/Build/Base.pm Tue Apr 11 01:30:57
> 2006
> @@ -3933,12 +3933,10 @@
>
> $self->log_info("$file -> $to_path\n") if $args{verbose};
> File::Copy::copy($file, $to_path) or die "Can't copy('$file',
> '$to_path'): $!";
> - # preserve mode & timestamps; copied from
> ExtUtils::Install::pm_to_blib
> - my($mode, $atime, $mtime) = (stat $file)[2,8,9];
> - my $mtime_adj = ($self->os_type eq 'VMS') ? 1 : 0;
> - utime($atime, $mtime + $mtime_adj, $to_path);
> + # mode is read-only + (executable if source is executable)
> + my $mode = (stat $file)[2];
> $mode = 0444 | ( $mode & 0111 ? 0111 : 0 );
> - chmod($mode, $to_path);
> + chmod( $mode, $to_path );
>
> return $to_path;
> }
|