Codebase list libmodule-build-tiny-perl / f8f1a2b
Fix writability for scripts and modules Leon Timmermans 13 years ago
3 changed file(s) with 5 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
00 Revision history for Module::Build::Tiny
11
22 {{$NEXT}}
3 Fix writability for scripts and modules
34
45 0.007 2011-05-01 22:36:17 Europe/Bucharest
56 Now with corrent configure-requires meta-information
2727 make_executable($_) for find(file => in => catdir(qw/blib script/));
2828 manify($_, catdir('blib', 'bindoc', man1_pagename($_)), 1, \%opt) for @scripts;
2929 manify($_, catdir('blib', 'libdoc', man3_pagename($_)), 3, \%opt) for @modules;
30 chmod +(stat $_)[2] & ~0222, $_ for map { catfile('blib', $_) } @scripts, @modules;
3031 }
3132
3233 my %actions = (
0 #! perl
01 use strict;
12 use warnings;
23 use Config;
6162 my $pmfile = _mod2pm($dist->name);
6263 ok( -f 'blib/lib/' . $pmfile, "$dist->{name} copied to blib" );
6364 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" );
6566
6667 # check bin
6768 ok( -f 'blib/script/simple', "bin/simple copied to blib" );
6869 like( _slurp("blib/script/simple"), '/' .quotemeta(_slurp("blib/script/simple")) . "/",
6970 "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" );
7472 ok( -x "blib/script/simple", "blib/script/simple is executable" );
7573 open my $fh, "<", "blib/script/simple";
7674 my $line = <$fh>;
7876
7977 }
8078
81