]> err.no Git - sope/blobdiff - sope-core/NGExtensions/NGBundleManager.m
Add libxml2-dev to libsope-xml4.7-dev deps
[sope] / sope-core / NGExtensions / NGBundleManager.m
index 305e11afd075d7be84b135e856401aa82f22b139..61113ff3eb53d6d691c8766d7e279aa61bd91514 100644 (file)
@@ -1,5 +1,6 @@
 /*
-  Copyright (C) 2000-2005 SKYRIX Software AG
+  Copyright (C) 2000-2006 SKYRIX Software AG
+  Copyright (C) 2006      Helge Hess
 
   This file is part of SOPE.
 
@@ -568,17 +569,17 @@ static NSString *NGEnvVarPathSeparator = @":";
       p = [bundle bundlePath];
       if ([p hasSuffix:@"Libraries"]) {
        if (debugOn) {
-         fprintf(stderr, "%s: Dylib bundle: 0x%08X: %s\n",
+         fprintf(stderr, "%s: Dylib bundle: 0x%p: %s\n",
                  __PRETTY_FUNCTION__,
-                 (unsigned int )bundle, [[bundle bundlePath] cString]);
+                 bundle, [[bundle bundlePath] cString]);
        }
        bundle = nil;
       }
       else if ([p hasSuffix:@"Tools"]) {
        if (debugOn) {
-         fprintf(stderr, "%s: Tool bundle: 0x%08X: %s\n",
+         fprintf(stderr, "%s: Tool bundle: 0x%p: %s\n",
                  __PRETTY_FUNCTION__,
-                 (unsigned int )bundle, [[bundle bundlePath] cString]);
+                 bundle, [[bundle bundlePath] cString]);
        }
        bundle = nil;
       }
@@ -825,7 +826,7 @@ static NSString *NGEnvVarPathSeparator = @":";
   bundleInfo = [NSDictionary dictionaryWithContentsOfFile:_path];
 #endif
   if (bundleInfo == nil) {
-    NSLog(@"couldn't load bundle-info at path '%@' !", _path);
+    NSLog(@"could not load bundle-info at path '%@' !", _path);
     return nil;
   }
   
@@ -895,6 +896,8 @@ static NSString *NGEnvVarPathSeparator = @":";
   NSDictionary   *requires;
   NSMutableArray *requiredBundles = nil;
   NSBundle       *requiredBundle  = nil;
+  
+  if (debugOn) NSLog(@"NGBundleManager: preload bundle: %@", _bundle);
 
   requires = [_bundleInfo objectForKey:@"requires"];
   
@@ -948,6 +951,11 @@ static NSString *NGEnvVarPathSeparator = @":";
   {
     NSEnumerator *e;
     
+    if (debugOn) {
+      NSLog(@"NGBundleManager:   preload required bundles: %@",
+           requiredBundles);
+    }
+    
     e = [requiredBundles objectEnumerator];
     while ((requiredBundle = [e nextObject]) != nil) {
       Class bundleMaster;
@@ -1081,9 +1089,11 @@ static NSString *NGEnvVarPathSeparator = @":";
   
   if (![self _preLoadBundle:_bundle info:bundleInfo])
     goto done;
-  
+
+  if (debugOn) NSLog(@"NGBundleManager: will load bundle: %@", _bundle);
   if (![_bundle _loadForBundleManager:self])
     goto done;
+  if (debugOn) NSLog(@"NGBundleManager: did load bundle: %@", _bundle);
   
   if (![self _postLoadBundle:_bundle info:bundleInfo])
     goto done;
@@ -1400,7 +1410,7 @@ static BOOL _doesInfoMatch(NSArray *keys, NSDictionary *dict, NSDictionary *info
   
   rnKeys = ([_resourceName respondsToSelector:@selector(objectForKey:)])
     ? [_resourceName allKeys]
-    : nil;
+    : (NSArray *)nil;
   
   menum = NSEnumerateMapTable(self->pathToBundleInfo);
   while (NSNextMapEnumeratorPair(&menum, (void *)&path, (void *)&bundleInfo)) {
@@ -1958,7 +1968,7 @@ static BOOL _doesInfoMatch(NSArray *keys, NSDictionary *dict, NSDictionary *info
                            providedByBundle:self];
 }
 
-// loading
+/* loading */
 
 - (BOOL)_loadForBundleManager:(NGBundleManager *)_manager {
   return [self load];