Title: [120878] trunk/Tools
Revision
120878
Author
[email protected]
Date
2012-06-20 16:01:14 -0700 (Wed, 20 Jun 2012)

Log Message

<http://webkit.org/b/89606> Teach run-safari and debug-safari to work with a Safari.app that has entitlements

Reviewed by Dan Bernstein.

* Scripts/webkitdirs.pm:
(executableHasEntitlements):
(safariPathFromSafariBundle):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (120877 => 120878)


--- trunk/Tools/ChangeLog	2012-06-20 22:57:58 UTC (rev 120877)
+++ trunk/Tools/ChangeLog	2012-06-20 23:01:14 UTC (rev 120878)
@@ -1,3 +1,13 @@
+2012-06-20  Mark Rowe  <[email protected]>
+
+        <http://webkit.org/b/89606> Teach run-safari and debug-safari to work with a Safari.app that has entitlements
+
+        Reviewed by Dan Bernstein.
+
+        * Scripts/webkitdirs.pm:
+        (executableHasEntitlements):
+        (safariPathFromSafariBundle):
+
 2012-06-20  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r120821.

Modified: trunk/Tools/Scripts/webkitdirs.pm (120877 => 120878)


--- trunk/Tools/Scripts/webkitdirs.pm	2012-06-20 22:57:58 UTC (rev 120877)
+++ trunk/Tools/Scripts/webkitdirs.pm	2012-06-20 23:01:14 UTC (rev 120878)
@@ -633,12 +633,22 @@
     $architecture = $passedArchitecture if $passedArchitecture;
 }
 
+sub executableHasEntitlements
+{
+    my $executablePath = shift;
+    return (`codesign -d --entitlements - $executablePath 2>&1` =~ /<key>/);
+}
 
 sub safariPathFromSafariBundle
 {
     my ($safariBundle) = @_;
 
-    return "$safariBundle/Contents/MacOS/Safari" if isAppleMacWebKit();
+    if (isAppleMacWebKit()) {
+        my $safariPath = "$safariBundle/Contents/MacOS/Safari";
+        my $safariForWebKitDevelopmentPath = "$safariBundle/Contents/MacOS/SafariForWebKitDevelopment";
+        return $safariForWebKitDevelopmentPath if -f $safariForWebKitDevelopmentPath && executableHasEntitlements($safariPath);
+        return $safariPath;
+    }
     return $safariBundle if isAppleWinWebKit();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to