On Wed, Apr 16, 2014 at 08:38:19AM +0100, Chris 'BinGOs' Williams wrote:
> On Tue, Apr 15, 2014 at 10:17:49PM +0100, Dave Mitchell wrote:> > Hi Chris, you pushed this just now:> > > > commit 84d7dacc0cf1fae82700fa22ee4991accd0a084e> > > > Skip writable tests in ExtUtils-Install when root> > > > ...> > - ok( !-w "$bigdir/DummyHard.pm", 'DummyHard.pm not writeable' );> > + SKIP: {> > + skip 'everywhere is writable to root', 1 if $> == 0;> > + ok( !-w "$bigdir/DummyHard.pm", 'DummyHard.pm not writeable' );> > + }> > > > At almost the same time that I was about to push my own fix:> > > > +# do a -w style test, but based on just on file perms rather than UID> > +# (on UNIX, root sees everything as writeable)> > +> > +sub writeable {> > + my ($file) = @_;> > + my @stat = stat $file;> > + return 0 unless defined $stat[2]; # mode> > + return $stat[2] & 0200;> > +}> > +> > +> > > > ...> > > > - ok( !-w "$bigdir/DummyHard.pm", 'DummyHard.pm not writeable' );> > + ok( !writeable("$bigdir/DummyHard.pm"), 'DummyHard.pm not writeable' );> > > > I think I prefer my own fix, because it still tests that the file is ok> > regardless of who runs the test.> > Go with yours, and bump the version in ExtUtils::Install and I'll release it to CPAN.
Now done with 68659711dbd73fcf02340a35b5fe8666c1fce2f8
--
"Strange women lying in ponds distributing swords is no basis for a system
of government. Supreme executive power derives from a mandate from the
masses, not from some farcical aquatic ceremony."
-- Dennis, "Monty Python and the Holy Grail"