Changeset 53765 in webkit


Ignore:
Timestamp:
Jan 23, 2010 1:51:47 AM (14 years ago)
Author:
mitz@apple.com
Message:

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.

Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r53763 r53765  
     12010-01-23  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Mark Rowe.
     4
     5        Added a user default for specifying a fallback frameworks path in case
     6        the bundle does not contain frameworks for the current Mac OS X version.
     7
     8        * WebKitLauncher/main.m:
     9        (fallbackMacOSXVersion): Added. Looks up the fallback version in a dictionary
     10        keyed by the FallbackSystemVersions user default and returns it.
     11        (main): If a frameworks directory for the current system version is not found,
     12        try the fallback.
     13
    1142010-01-22  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
    215
  • trunk/WebKitTools/WebKitLauncher/main.m

    r46505 r53765  
    167167}
    168168
     169static NSString *fallbackMacOSXVersion(NSString *systemVersion)
     170{
     171    NSDictionary *fallbackVersionMap = [[NSUserDefaults standardUserDefaults] dictionaryForKey:@"FallbackSystemVersions"];
     172    if (!fallbackVersionMap)
     173        return nil;
     174    NSString *fallbackSystemVersion = [fallbackVersionMap objectForKey:systemVersion];
     175    if (!fallbackSystemVersion || ![fallbackSystemVersion isKindOfClass:[NSString class]])
     176        return nil;
     177    return fallbackSystemVersion;
     178}
     179
    169180static BOOL checkFrameworkPath(NSString *frameworkPath)
    170181{
     
    187198    NSString *systemVersion = currentMacOSXVersion();
    188199    NSString *frameworkPath = [[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:systemVersion];
     200
     201    BOOL frameworkPathIsUsable = checkFrameworkPath(frameworkPath);
     202
     203    if (!frameworkPathIsUsable) {
     204        NSString *fallbackSystemVersion = fallbackMacOSXVersion(systemVersion);
     205        if (fallbackSystemVersion) {
     206            frameworkPath = [[[NSBundle mainBundle] privateFrameworksPath] stringByAppendingPathComponent:fallbackSystemVersion];
     207            frameworkPathIsUsable = checkFrameworkPath(frameworkPath);
     208        }
     209    }
     210
     211    if (!frameworkPathIsUsable)
     212        displayErrorAndQuit([NSString stringWithFormat:@"Mac OS X %@ is not supported", systemVersion],
     213                            [NSString stringWithFormat:@"Nightly builds of WebKit are not supported on Mac OS X %@ at this time.", systemVersion]);
     214
    189215    NSString *pathToEnablerLib = [[NSBundle mainBundle] pathForResource:@"WebKitNightlyEnabler" ofType:@"dylib"];
    190216
    191217    NSBundle *safariBundle = locateSafariBundle();
    192218    NSString *executablePath = [safariBundle executablePath];
    193 
    194     if (!checkFrameworkPath(frameworkPath))
    195         displayErrorAndQuit([NSString stringWithFormat:@"Mac OS X %@ is not supported", systemVersion],
    196                             [NSString stringWithFormat:@"Nightly builds of WebKit are not supported on Mac OS X %@ at this time.", systemVersion]);
    197219
    198220    if (!checkSafariVersion(safariBundle)) {
Note: See TracChangeset for help on using the changeset viewer.