This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In installperl, simplify the strip/chmod code for libraries on Darwin.
authorNicholas Clark <nick@ccl4.org>
Sat, 24 Dec 2011 12:40:24 +0000 (13:40 +0100)
committerNicholas Clark <nick@ccl4.org>
Mon, 2 Jan 2012 11:18:53 +0000 (12:18 +0100)
installperl

index 0cd6ec9..7b122a0 100755 (executable)
@@ -788,14 +788,9 @@ sub installlib {
            # HP-UX (at least) needs to maintain execute permissions
            # on dynamically-loaded libraries.
             if (copy_if_diff($_, "$installlib/$name")) {
-                if ($name =~ /\.(so|$dlext)$/o) {
-                    strip("-S", "$installlib/$name") if $^O =~ /^(rhapsody|darwin)$/;
-                    chmod(0555, "$installlib/$name");
-                } else {
-                    strip("-S", "$installlib/$name")
-                        if ($name =~ /\.a$/o and $^O =~ /^(rhapsody|darwin)$/);
-                    chmod(0444, "$installlib/$name");
-               }
+                strip("-S", "$installlib/$name")
+                    if $^O =~ /^(rhapsody|darwin)$/ and /\.(?:so|$dlext|a)$/;
+                chmod(/\.(so|$dlext)$/ ? 0555 : 0444, "$installlib/$name");
             }
        }
     }