This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Porting/sync-with-cpan: honour exec-bit whitelist
authorAaron Crane <arc@cpan.org>
Sun, 19 Mar 2017 09:57:37 +0000 (09:57 +0000)
committerAaron Crane <arc@cpan.org>
Sun, 19 Mar 2017 10:11:37 +0000 (10:11 +0000)
Reported by kid51++

Porting/sync-with-cpan

index 510ff0a..e6cfd8f 100755 (executable)
@@ -482,6 +482,15 @@ if (@de_exec && @delete) {
     @de_exec = grep {!$delete {$_}} @de_exec;
 }
 
+#
+# Mustn't change the +x bit on files that are whitelisted
+#
+if (@de_exec) {
+    my %permitted = map +(tr/\n//dr => 1), grep !/^#/,
+        do { local @ARGV = '../Porting/exec-bit.txt'; <> };
+    @de_exec = grep !$permitted{"cpan/$pkg_dir/$_"}, @de_exec;
+}
+
 say "unlink $pkg_dir/$_" for @delete;
 say "git add $pkg_dir/$_" for @commit;
 say "git rm -f $pkg_dir/$_" for @gone;