[CalendarServer-changes] [6290] CalendarServer/trunk

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 14 19:15:32 PDT 2010


Revision: 6290
          http://trac.macosforge.org/projects/calendarserver/changeset/6290
Author:   glyph at apple.com
Date:     2010-09-14 19:15:31 -0700 (Tue, 14 Sep 2010)
Log Message:
-----------
Remove special-case setup code for PYTHONPATH, and allow 'dependencies' to be the sole function which manipulates it.  Also, trust $PATH (also set up by 'dependencies') to locate 'trial', so that the 'trial' script we're running and the Twisted library we're importing are more likely to match.

Modified Paths:
--------------
    CalendarServer/trunk/run
    CalendarServer/trunk/support/py.sh
    CalendarServer/trunk/test

Modified: CalendarServer/trunk/run
===================================================================
--- CalendarServer/trunk/run	2010-09-14 18:40:17 UTC (rev 6289)
+++ CalendarServer/trunk/run	2010-09-15 02:15:31 UTC (rev 6290)
@@ -181,15 +181,6 @@
     fi;
   fi;
 
-  # Prepare to set up PYTHONPATH et. al.
-  if [ -z "${PYTHONPATH:-}" ]; then
-    user_python_path="";
-  else
-    user_python_path=":${PYTHONPATH}";
-  fi;
-
-  export PYTHONPATH="${caldav}";
-
   # About to do something for real; let's enumerate (and depending on options,
   # possibly download and/or install) the dependencies.
   dependencies;
@@ -208,11 +199,6 @@
     do_home_install;
   fi;
 
-  # Finish setting up PYTHONPATH (put the user's original path at the *end* so
-  # that CalendarServer takes precedence).
-
-  export PYTHONPATH="${PYTHONPATH}${user_python_path}";
-
   # Finally, run the server.
   run;
 }

Modified: CalendarServer/trunk/support/py.sh
===================================================================
--- CalendarServer/trunk/support/py.sh	2010-09-14 18:40:17 UTC (rev 6289)
+++ CalendarServer/trunk/support/py.sh	2010-09-15 02:15:31 UTC (rev 6290)
@@ -87,13 +87,13 @@
 
   local module="$1"; shift;
 
-  PYTHONPATH="" "${python}" -c "import ${module}" > /dev/null 2>&1;
+  "${python}" -c "import ${module}" > /dev/null 2>&1;
   result=$?;
 
   if [ $result == 0 ] && [ -n "${version}" ]; then
     for symbol in "xxxx" "__version__" "version"; do
       if module_version="$(
-        PYTHONPATH="" "${python}" -c \
+        "${python}" -c \
         'print __import__("'"${module}"'").'"$symbol"';' \
         2>/dev/null
       )"; then

Modified: CalendarServer/trunk/test
===================================================================
--- CalendarServer/trunk/test	2010-09-14 18:40:17 UTC (rev 6289)
+++ CalendarServer/trunk/test	2010-09-15 02:15:31 UTC (rev 6290)
@@ -67,13 +67,10 @@
 done;
 shift $((${OPTIND} - 1));
 
-export PYTHONPATH="${wd}";
+export PYTHONPATH="${wd}:${PYTHONPATH}";
+
 dependencies;
-if [ -d "${wd}/../Twisted" ]; then
-  trial="${wd}/../Twisted/bin/trial";
-else
-  trial="$(type -p trial)";
-fi;
+trial="$(type -p trial)";
 
 if [ $# -gt 0 ]; then
     test_modules="$@";
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100914/ae71e9c7/attachment-0001.html>


More information about the calendarserver-changes mailing list