From: Steve Hay Date: Thu, 3 May 2007 07:51:17 +0000 (+0000) Subject: Fix a CPANPLUS test that fails when run on a read-only source tree X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=808cb88e26f50aa982b59730bcba3cf312610440;p=p5sagit%2Fp5-mst-13.2.git Fix a CPANPLUS test that fails when run on a read-only source tree (such as a p4 client repository) p4raw-id: //depot/perl@31121 --- diff --git a/lib/CPANPLUS/Internals.pm b/lib/CPANPLUS/Internals.pm index 17760cb..897a4a7 100644 --- a/lib/CPANPLUS/Internals.pm +++ b/lib/CPANPLUS/Internals.pm @@ -40,7 +40,7 @@ use vars qw[@ISA $VERSION]; CPANPLUS::Internals::Report ]; -$VERSION = "0.79_01"; +$VERSION = "0.79_02"; =pod diff --git a/lib/CPANPLUS/Internals/Source.pm b/lib/CPANPLUS/Internals/Source.pm index c58632b..f527618 100644 --- a/lib/CPANPLUS/Internals/Source.pm +++ b/lib/CPANPLUS/Internals/Source.pm @@ -318,8 +318,11 @@ sub _update_source { ### `touch` the file, so windoze knows it's new -jmb ### works on *nix too, good fix -Kane - utime ( $now, $now, File::Spec->catfile($path, $file) ) or + ### make sure it is writable first, otherwise the `touch` will fail + unless (chmod ( 0644, File::Spec->catfile($path, $file) ) && + utime ( $now, $now, File::Spec->catfile($path, $file) )) { error( loc("Couldn't touch %1", $file) ); + } } return 1;