Subject: | Forcing installs of up-to-date copies |
ExtUtils::Install skips installs of up-to-date copies. This is a problem with tools like "installwatch" and "checkinstall" because these hook into the actual copy process to detect files that are needed for an installation.
It'd be nice if installing files, even if they're up-to-date, could be forced by setting an environment variable like MM_FORCE_INSTALL. I've attached a simple two-line patch plus documentation.
Would be great if it could make it into the next release.
Thanks,
-- Mike
diff -Naur ExtUtils-MakeMaker-6.30/lib/ExtUtils/Install.pm ExtUtils-MakeMaker-6.30.patched/lib/ExtUtils/Install.pm
--- ExtUtils-MakeMaker-6.30/lib/ExtUtils/Install.pm 2005-03-21 20:30:24.000000000 -0800
+++ ExtUtils-MakeMaker-6.30.patched/lib/ExtUtils/Install.pm 2005-07-17 10:19:02.879331664 -0700
@@ -76,6 +76,12 @@
If $uninstall_shadows is true any differing versions throughout @INC
will be uninstalled. This is "make install UNINST=1"
+Before actually installing each file, C<install> will check if there
+already is an up-to-date copy installed. If there is, it will skip
+this step for performance reasons. If this is undesirable, copying
+the file can be forced by setting the environment variable
+C<MM_FORCE_INSTALL> to a true value.
+
=cut
sub install {
@@ -122,6 +128,8 @@
$packlist->read($tmpfile) if (-f $tmpfile);
my $cwd = cwd();
+ my $force_install = $ENV{MM_FORCE_INSTALL};
+
MOD_INSTALL: foreach my $source (sort keys %from_to) {
#copy the tree to the target directory without altering
#timestamp and permission and remember for the .packlist
@@ -163,7 +171,7 @@
my $diff = 0;
if ( -f $targetfile && -s _ == $size) {
# We have a good chance, we can skip this one
- $diff = compare($sourcefile, $targetfile);
+ $diff = $force_install || compare($sourcefile, $targetfile);
} else {
print "$sourcefile differs\n" if $verbose>1;
$diff++;