Skip Menu |

This queue is for tickets about the ExtUtils-Install CPAN distribution.

Report information
The Basics
Id: 61587
Status: open
Priority: 0/
Queue: ExtUtils-Install

People
Owner: Nobody in particular
Requestors: FERRENCY [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.54
Fixed in: (no value)



Subject: fakeinstall modifies permissions of installed files
sub install runs _chmod on the installed file targets even when in $dry_run. As far as I can tell, it should not be touching any installed files at all, during a fakeinstall. Here's a patch that adds a $dry_run parameter to sub _chmod, and provides that parameter when called from sub install: --- lib/ExtUtils/Install.pm.orig Thu Sep 23 10:50:03 2010 +++ lib/ExtUtils/Install.pm Thu Sep 23 10:51:50 2010 @@ -154,10 +154,10 @@ } -sub _chmod($$;$) { - my ( $mode, $item, $verbose )=@_; +sub _chmod($$;$$) { + my ( $mode, $item, $verbose, $dry_run )=@_; $verbose ||= 0; - if (chmod $mode, $item) { + if ($dry_run or chmod $mode, $item) { printf "chmod(0%o, %s)\n",$mode, $item if $verbose > 1; } else { my $err="$!"; @@ -816,7 +816,7 @@ $mode = 0444 | ( $mode & 0111 ? 0111 : 0 ); $mode = $mode | 0222 if $realtarget ne $targetfile; - _chmod( $mode, $targetfile, $verbose ); + _chmod( $mode, $targetfile, $verbose, $dry_run ); $result->{install}{$targetfile} = $sourcefile; 1 } or do { Thanks, Alan Ferrency
On Thu Sep 23 10:57:37 2010, FERRENCY wrote: Show quoted text
> sub install runs _chmod on the installed file targets even when in > $dry_run. As far as I can tell, it should not be touching any installed > files at all, during a fakeinstall. > > Here's a patch that adds a $dry_run parameter to sub _chmod, and > provides that parameter when called from sub install: > > > --- lib/ExtUtils/Install.pm.orig Thu Sep 23 10:50:03 2010 > +++ lib/ExtUtils/Install.pm Thu Sep 23 10:51:50 2010 > @@ -154,10 +154,10 @@ > } > > > -sub _chmod($$;$) { > - my ( $mode, $item, $verbose )=@_; > +sub _chmod($$;$$) { > + my ( $mode, $item, $verbose, $dry_run )=@_; > $verbose ||= 0; > - if (chmod $mode, $item) { > + if ($dry_run or chmod $mode, $item) { > printf "chmod(0%o, %s)\n",$mode, $item if $verbose > 1; > } else { > my $err="$!"; > @@ -816,7 +816,7 @@ > $mode = 0444 | ( $mode & 0111 ? 0111 : 0 ); > $mode = $mode | 0222 > if $realtarget ne $targetfile; > - _chmod( $mode, $targetfile, $verbose ); > + _chmod( $mode, $targetfile, $verbose, $dry_run ); > $result->{install}{$targetfile} = $sourcefile; > 1 > } or do { > > > Thanks, > Alan Ferrency
This patch has never been applied to lib/ExtUtils/Install.pm. Should it be? And is this related to https://rt.cpan.org/Ticket/Display.html?id=41646? Thank you very much. Jim Keenan