瀏覽代碼

support disney-style Cg file

David Rose 16 年之前
父節點
當前提交
c5638bc1fd
共有 1 個文件被更改,包括 11 次插入3 次删除
  1. 11 3
      direct/src/p3d/Packager.py

+ 11 - 3
direct/src/p3d/Packager.py

@@ -89,7 +89,14 @@ class Packager:
 
 
             if self.executable:
             if self.executable:
                 # Look up the filename along the system PATH, if necessary.
                 # Look up the filename along the system PATH, if necessary.
-                self.filename.resolveFilename(packager.executablePath)
+                if not self.filename.resolveFilename(packager.executablePath):
+                    # If it wasn't found, try looking it up under its
+                    # basename only.  Sometimes a Mac user will copy
+                    # the library file out of a framework and put that
+                    # along the PATH, instead of the framework itself.
+                    basename = Filename(self.filename.getBasename())
+                    if basename.resolveFilename(packager.executablePath):
+                        self.filename = basename
 
 
             # Convert the filename to an unambiguous filename for
             # Convert the filename to an unambiguous filename for
             # searching.
             # searching.
@@ -736,6 +743,7 @@ class Packager:
             if file.text is None and not file.filename.exists():
             if file.text is None and not file.filename.exists():
                 if not file.isExcluded(self):
                 if not file.isExcluded(self):
                     self.packager.notify.warning("No such file: %s" % (file.filename))
                     self.packager.notify.warning("No such file: %s" % (file.filename))
+                    import pdb; pdb.set_trace()
                 return None
                 return None
             
             
             self.files.append(file)
             self.files.append(file)
@@ -834,8 +842,8 @@ class Packager:
             return filenames
             return filenames
             
             
         def __locateFrameworkLibrary(self, library):
         def __locateFrameworkLibrary(self, library):
-            """ Locates the given library inside it's framework on the
-            default framework paths, and returns it's location as Filename. """
+            """ Locates the given library inside its framework on the
+            default framework paths, and returns its location as Filename. """
             
             
             # If it's already a full existing path, we
             # If it's already a full existing path, we
             # don't search for it anymore, of course.
             # don't search for it anymore, of course.