Browse Source

more osx stuff

David Rose 16 years ago
parent
commit
f34034d7d4

+ 4 - 2
direct/src/plugin/handleStreamBuf.cxx

@@ -327,8 +327,10 @@ write_chars(const char *start, size_t length) {
   while (remaining > 0) {
     ssize_t result = ::write(_handle, start, remaining);
     if (result < 0) {
-      cerr
-        << "Error writing " << remaining << " bytes\n";
+      if (errno != EPIPE) {
+        cerr
+          << "Error writing " << remaining << " bytes\n";
+      }
       return length - remaining;
     }
     

+ 4 - 2
direct/src/plugin/make_package.py

@@ -1,4 +1,4 @@
-#! /bin/env python
+#! /usr/bin/env python
 
 """
 This command is used to build a downloadable package for the p3d
@@ -145,7 +145,9 @@ class PackageMaker:
         sub-directories. """
 
         startDir = self.startDir
-        if startDir.endswith(os.altsep) or startDir.endswith(os.sep):
+        if startDir.endswith(os.sep):
+            startDir = startDir[:-1]
+        elif os.altsep and startDir.endswith(os.altsep):
             startDir = startDir[:-1]
         prefix = startDir + os.sep
         for dirpath, dirnames, filenames in os.walk(startDir):

+ 1 - 1
direct/src/plugin/p3dPackage.cxx

@@ -23,7 +23,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/utime.h>
+#include <utime.h>
 
 #ifdef _WIN32
 #include <direct.h>

+ 10 - 2
direct/src/plugin/p3dSession.cxx

@@ -132,8 +132,8 @@ start_instance(P3DInstance *inst) {
   send_command(doc);
 
   P3DInstanceManager *inst_mgr = P3DInstanceManager::get_global_ptr();
-  P3DPackage *panda = inst_mgr->get_package("panda3d", "dev");
-  //  start_p3dpython();
+  //  P3DPackage *panda = inst_mgr->get_package("panda3d", "dev");
+  start_p3dpython();
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -257,6 +257,14 @@ start_p3dpython() {
   env += _python_root_dir;
   env += '\0';
 
+  env += "PRC_DIR=";
+  env += _python_root_dir;
+  env += '\0';
+
+  env += "PANDA_PRC_DIR=";
+  env += _python_root_dir;
+  env += '\0';
+
 #ifdef _WIN32
   _p3dpython_handle = win_create_process
     (p3dpython, _python_root_dir, env, _output_filename,