Skip Menu |
 

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

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

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

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

Attachments
0001-install-on-a-dry-run-would-touch-destination-files.patch



CC: MSCHWERN [...] cpan.org
Subject: fakeinstall touches manpages
Download (untitled) / with headers
text/plain 169b
This problem appears to have gone away with the latest MB in the repo plus EUI 1.52. I don't know what caused it originally, but I don't have the energy to investigate.
Download (untitled) / with headers
text/plain 490b
I lied, I went back and checked against both EUI 1.50 and 1.52 and it's not fixed. Man pages aren't installed, but existing out of date man pages are touched. You can see this by having a different installed man page (just edit one if you have to) and then doing a fakeinstall. In this example it's Module::Build::YAML.3. Check its mod time and run fakeinstall. You'll see "Installing /path/to/man/man3/Module::Build::YAML.3" and if you check the mod time on the file it'll be updated.
Download (untitled) / with headers
text/plain 121b
Ok, I tracked it down to a mistake in ExtUtils::Install. It was doing "unless $dry_run>1" rather than "unless $dry_run".
--- lib/ExtUtils/Install.pm +++ lib/ExtUtils/Install.pm @@ -680,7 +680,7 @@ sub install { #XXX OS-SPECIFIC delete $from_to{$_}; } my $tmpfile = install_rooted_file($pack{"read"}); - $packlist->read($tmpfile) if (-f $tmpfile); + $packlist->read($tmpfile) if defined $tmpfile and -f $tmpfile; my $cwd = cwd(); my @found_files; my %check_dirs; @@ -784,7 +784,7 @@ sub install { #XXX OS-SPECIFIC #XXX OS-SPECIFIC print "utime($atime,$mtime,$targetfile)\n" if $verbose>1; - utime($atime,$mtime + $Is_VMS,$targetfile) unless $dry_run>1; + utime($atime,$mtime + $Is_VMS,$targetfile) unless $dry_run; $mode = 0444 | ( $mode & 0111 ? 0111 : 0 ); --- /dev/null +++ t/install-dry-run.t @@ -0,0 +1,54 @@ +#!/usr/bin/perl -w + +# Test that install() dry-run does not touch any installed files when the source file +# has changed. See rt.cpan.org 41646. + +use strict; +use lib 't/lib'; + +use TieOut; +use Test::More tests => 6; + +use ExtUtils::Install; + +use MakeMaker::Test::Setup::BFD; +ok( setup_recurs(), 'setup' ); +END { + ok( chdir File::Spec->updir ); + ok( teardown_recurs(), 'teardown' ); +} + +chdir 'Big-Dummy'; +my $stdout = tie *STDOUT, 'TieOut'; + +{ + my $source = 'lib/Big/Dummy.pm'; + my $target = 'install-test/lib/perl/Big/Dummy.pm'; + + my %result; + install([ + from_to => { "lib" => "install-test/lib/perl" }, + dry_run => 0, + result => \%result + ]); + + ok -f $target, "$target installed"; + + my $orig_mtime = (stat $target)[9]; + + # sleep so we can see a time difference between the source and the target + sleep 2; + + # Change the source file so it diffs from the target + { + ok open my $fh, ">>", $source; + print $fh "Wibble\n"; + } + + install([ + from_to => { 'lib' => 'install-test/lib/perl' }, + dry_run => 1 + ]); + + is( (stat $target)[9], $orig_mtime, "install() dry-run does not touch installed files" ); +}
Download (untitled) / with headers
text/plain 627b
On Sun Feb 08 18:47:02 2009, MSCHWERN wrote: Show quoted text
> Ok, I tracked it down to a mistake in ExtUtils::Install. It was doing > "unless $dry_run>1" rather than "unless $dry_run".
It appears that the changes found in Schwern's diff from 2009 were never applied. ##### [ExtUtils-Install-2.04] 41 $ ack 'packlist.*?te?mpfile' . lib/ExtUtils/Install.pm 705: $packlist->read($tmpfile) if (-f $tmpfile); [ExtUtils-Install-2.04] 42 $ ack 'utime.*?dry[_-]?run' . lib/ExtUtils/Install.pm 809: utime($atime,$mtime + $Is_VMS,$targetfile) unless $dry_run>1; ##### Are these fixes still needed? Thank you very much. Jim Keenan


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.