5 # This test checks that anything with an executable bit is
6 # identified in Porting/exec-bit.txt to makerel will set
7 # the exe bit in the release tarball
8 # and that anything with an executable bit also has a shebang
12 open my $fh, '<', $fname or die "Can't open '$fname': $!";
16 return $line =~ /^\#!\s*([A-Za-z0-9_\-\/\.])+\s?/ ? 1 : 0;
20 if ( $^O eq "MSWin32" ) {
21 skip_all( "-x on MSWin32 only indicates file has executable suffix. Try Cygwin?" );
25 skip_all( "Filename case may not be preserved and other porting issues." );
29 skip_all( "VOS combines the read and execute permission bits." );
34 use ExtUtils::Manifest qw(maniread);
36 # Copied from Porting/makerel - these will get +x in the tarball
37 # XXX refactor? -- dagolden, 2010-07-23
40 map { my ($f) = split; glob("../$f") }
41 grep { $_ !~ /\A#/ && $_ !~ /\A\s*\z/ }
43 do { local (@ARGV, $/) = '../Porting/exec-bit.txt'; <> };
46 $ExtUtils::Manifest::Quiet = 1;
47 my @manifest = sort keys %{ maniread("../MANIFEST") };
49 # Check that +x files in repo get +x from makerel
50 for my $f ( map { "../$_" } @manifest ) {
53 ok( has_shebang($f), "File $f has shebang" );
55 ok( $exe_list{$f}, "tarball will chmod +x $f" )
56 or diag( "Remove the exec bit or add '$f' to Porting/exec-bit.txt" );
58 delete $exe_list{$f}; # seen it
61 ok( ! %exe_list, "Everything in Porting/exec-bit.txt has +x in repo" )
62 or diag( "Files missing exec bit:\n " . join("\n ", sort keys %exe_list) . "\n");