X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=FixInstall.PL;fp=FixInstall.PL;h=958f1f9e9da05be42b76c89f93c807b3ee9eab5a;hb=8d66aa098b18f8c9724b12bf446d330905122c57;hp=0000000000000000000000000000000000000000;hpb=4c46bbd0856ded38b0cefbabc61dc53b85025d42;p=perl%2Fmodules%2FTest-Valgrind.git diff --git a/FixInstall.PL b/FixInstall.PL new file mode 100755 index 0000000..958f1f9 --- /dev/null +++ b/FixInstall.PL @@ -0,0 +1,33 @@ +use strict; +use warnings; + +use File::Copy qw/copy/; + +my ($bak) = @ARGV; +exit 1 unless defined $bak; + +my $mk = './Makefile'; +exit 1 unless defined $mk and -e $mk and -r _ and -w _; + +select STDERR; + +print "Fixing Makefile install targets\n"; + +if (-e $bak && (stat $bak)[9] >= (stat $mk)[9]) { # mtime + print "Makefile is old\n"; + copy($bak, $mk); +} else { + print "Makefile is new\n"; + copy($mk, $bak); +} + +open my $in, '<', $bak or die "open(<$bak): $!"; +open my $out, '>', $mk or die "open(>$mk): $!"; +while (<$in>) { + s!^(\s*)\$\(INST_ARCHLIB\)\s+(\$\(DESTINSTALL(?:ARCHLIB|SITEARCH|VENDORARCH)\))\s*\\\s*!$1blib/archpub $2/\$(FULLEXT) \\\n!g; + print $out $_; +} +close $out; +close $in; + +utime time, time, $bak; # Update mtime