[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
mitz at apple.com
mitz at apple.com
Thu Feb 4 21:26:06 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 713e9869400e523b95b5816c2927d4be3500c948
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Jan 23 09:51:47 2010 +0000
Added a user default for specifying a fallback frameworks path in case
the bundle does not contain frameworks for the current Mac OS X version.
Reviewed by Mark Rowe.
* WebKitLauncher/main.m:
(fallbackMacOSXVersion): Added. Looks up the fallback version in a dictionary
keyed by the FallbackSystemVersions user default and returns it.
(main): If a frameworks directory for the current system version is not found,
try the fallback.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53765 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index e3cd7e3..11795ff 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-01-23 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Added a user default for specifying a fallback frameworks path in case
+ the bundle does not contain frameworks for the current Mac OS X version.
+
+ * WebKitLauncher/main.m:
+ (fallbackMacOSXVersion): Added. Looks up the fallback version in a dictionary
+ keyed by the FallbackSystemVersions user default and returns it.
+ (main): If a frameworks directory for the current system version is not found,
+ try the fallback.
+
2010-01-22 Tor Arne Vestbø <tor.arne.vestbo at nokia.com>
Reviewed by Simon Hausmann.
diff --git a/WebKitTools/WebKitLauncher/main.m b/WebKitTools/WebKitLauncher/main.m
index 20f130e..4fee68a 100644
--- a/WebKitTools/WebKitLauncher/main.m
+++ b/WebKitTools/WebKitLauncher/main.m
@@ -166,6 +166,17 @@ static NSString *currentMacOSXVersion()
return [NSString stringWithFormat:@"%x.%x", (version & 0xFF00) >> 8, (version & 0x00F0) >> 4];
}
+static NSString *fallbackMacOSXVersion(NSString *systemVersion)
+{
+ NSDictionary *fallbackVersionMap = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"FallbackSystemVersions"];
+ if (!fallbackVersionMap)
+ return nil;
+ NSString *fallbackSystemVersion = [fallbackVersionMap objectForKey:systemVersion];
+ if (!fallbackSystemVersion || ![fallbackSystemVersion isKindOfClass:[NSString class]])
+ return nil;
+ return fallbackSystemVersion;
+}
+
static BOOL checkFrameworkPath(NSString *frameworkPath)
{
BOOL isDirectory = NO;
@@ -186,15 +197,26 @@ int main(int argc, char *argv[])
NSString *systemVersion = currentMacOSXVersion();
NSString *frameworkPath = [[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:systemVersion];
- NSString *pathToEnablerLib = [[NSBundle mainBundle] pathForResource:@"WebKitNightlyEnabler" ofType:@"dylib"];
- NSBundle *safariBundle = locateSafariBundle();
- NSString *executablePath = [safariBundle executablePath];
+ BOOL frameworkPathIsUsable = checkFrameworkPath(frameworkPath);
- if (!checkFrameworkPath(frameworkPath))
+ if (!frameworkPathIsUsable) {
+ NSString *fallbackSystemVersion = fallbackMacOSXVersion(systemVersion);
+ if (fallbackSystemVersion) {
+ frameworkPath = [[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:fallbackSystemVersion];
+ frameworkPathIsUsable = checkFrameworkPath(frameworkPath);
+ }
+ }
+
+ if (!frameworkPathIsUsable)
displayErrorAndQuit([NSString stringWithFormat:@"Mac OS X %@ is not supported", systemVersion],
[NSString stringWithFormat:@"Nightly builds of WebKit are not supported on Mac OS X %@ at this time.", systemVersion]);
+ NSString *pathToEnablerLib = [[NSBundle mainBundle] pathForResource:@"WebKitNightlyEnabler" ofType:@"dylib"];
+
+ NSBundle *safariBundle = locateSafariBundle();
+ NSString *executablePath = [safariBundle executablePath];
+
if (!checkSafariVersion(safariBundle)) {
NSString *safariVersion = [[safariBundle localizedInfoDictionary] objectForKey:@"CFBundleShortVersionString"];
displayErrorAndQuit([NSString stringWithFormat:@"Safari %@ is not supported", safariVersion],
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list