X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=mkppport;h=4636d3e5639a59b554fe62eeb8376f7c89d8720b;hb=7efcbeefb3812bba5ff588d00b309f3591f5df08;hp=00462f95c9d9326eb24304ba5a257889967dfff1;hpb=42e075623c2bbf1fc51817682bfa7ee74e617478;p=p5sagit%2Fp5-mst-13.2.git diff --git a/mkppport b/mkppport index 00462f9..4636d3e 100644 --- a/mkppport +++ b/mkppport @@ -4,6 +4,7 @@ use warnings; use Getopt::Long; use Pod::Usage; use File::Spec; +use File::Compare qw( compare ); use File::Copy qw( copy ); use File::Basename qw( dirname ); @@ -11,7 +12,7 @@ sub iterdirs(&); my $rootdir = dirname($0); -unshift @INC, File::Spec->catfile($rootdir, 't', 'lib'); +unshift @INC, File::Spec->catdir($rootdir, 't', 'lib'); eval q{ use MakeMaker::Test::Utils qw( which_perl ) }; $@ and die $@; @@ -55,7 +56,7 @@ unshift @INC, File::Spec->catdir($absroot, 'lib'); # Change to Devel::PPPort directory, as it needs the stuff # from the parts/ directory -chdir File::Spec->catdir($rootdir, 'ext', 'Devel', 'PPPort'); +chdir File::Spec->catdir($rootdir, 'ext', 'Devel-PPPort'); # Capture and remove temporary files my @unlink; @@ -82,9 +83,14 @@ unless (-e 'ppport.h') { # Now install the created ppport.h into extension directories iterdirs { my($dir, $fulldir) = @_; - print "installing ppport.h for $dir\n"; my $dest = File::Spec->catfile($fulldir, 'ppport.h'); - copy('ppport.h', $dest) or die "copying ppport.h to $dest failed: $!\n"; + if (compare('ppport.h', $dest)) { + print "installing ppport.h for $dir\n"; + copy('ppport.h', $dest) or die "copying ppport.h to $dest failed: $!\n"; + } + else { + print "ppport.h in $dir is up-to-date\n"; + } }; exit 0; @@ -128,7 +134,7 @@ sub readlist #---------------------------------------------- sub run { - my @args = ("-I" . File::Spec->catdir((File::Spec->updir) x 3, 'lib'), @_); + my @args = ("-I" . File::Spec->catdir((File::Spec->updir) x 2, 'lib'), @_); my $run = $perl =~ m/\s/ ? qq("$perl") : $perl; for (@args) { $_ = qq("$_") if $^O eq 'VMS' && /^[^"]/;