Fix writability for scripts and modules
Leon Timmermans
13 years ago
0 | 0 |
Revision history for Module::Build::Tiny
|
1 | 1 |
|
2 | 2 |
{{$NEXT}}
|
|
3 |
Fix writability for scripts and modules
|
3 | 4 |
|
4 | 5 |
0.007 2011-05-01 22:36:17 Europe/Bucharest
|
5 | 6 |
Now with corrent configure-requires meta-information
|
27 | 27 |
make_executable($_) for find(file => in => catdir(qw/blib script/));
|
28 | 28 |
manify($_, catdir('blib', 'bindoc', man1_pagename($_)), 1, \%opt) for @scripts;
|
29 | 29 |
manify($_, catdir('blib', 'libdoc', man3_pagename($_)), 3, \%opt) for @modules;
|
|
30 |
chmod +(stat $_)[2] & ~0222, $_ for map { catfile('blib', $_) } @scripts, @modules;
|
30 | 31 |
}
|
31 | 32 |
|
32 | 33 |
my %actions = (
|
|
0 |
#! perl
|
0 | 1 |
use strict;
|
1 | 2 |
use warnings;
|
2 | 3 |
use Config;
|
|
61 | 62 |
my $pmfile = _mod2pm($dist->name);
|
62 | 63 |
ok( -f 'blib/lib/' . $pmfile, "$dist->{name} copied to blib" );
|
63 | 64 |
is( _slurp("lib/$pmfile"), _slurp("blib/lib/$pmfile"), "pm contents are correct" );
|
64 | |
ok( ! -w "blib/lib/$pmfile", "pm file in blib is readonly" );
|
|
65 |
ok( ! ((stat "blib/lib/$pmfile")[2] & 0222), "pm file in blib is readonly" );
|
65 | 66 |
|
66 | 67 |
# check bin
|
67 | 68 |
ok( -f 'blib/script/simple', "bin/simple copied to blib" );
|
68 | 69 |
like( _slurp("blib/script/simple"), '/' .quotemeta(_slurp("blib/script/simple")) . "/",
|
69 | 70 |
"blib/script/simple contents are correct" );
|
70 | |
{
|
71 | |
local $TODO = 'What to do about this?';
|
72 | |
ok( ! -w "blib/script/simple", "blib/script/simple is readonly" );
|
73 | |
}
|
|
71 |
ok( ! ((stat "blib/script/simple")[2] & 0222), "blib/script/simple is readonly" );
|
74 | 72 |
ok( -x "blib/script/simple", "blib/script/simple is executable" );
|
75 | 73 |
open my $fh, "<", "blib/script/simple";
|
76 | 74 |
my $line = <$fh>;
|
|
78 | 76 |
|
79 | 77 |
}
|
80 | 78 |
|
81 | |
|