Author: jsdelfino
Date: Tue May 29 06:05:43 2012
New Revision: 1343550

URL: http://svn.apache.org/viewvc?rev=1343550&view=rev
Log:
Fix PyObject reference counting bugs causing memory violations in the Python 
component implementation. Build Python runtime from source with pydebug to 
diagnose memory issues.

Added:
    tuscany/sca-cpp/trunk/etc/valgrind-apr.supp   (contents, props changed)
      - copied, changed from r1343439, tuscany/sca-cpp/trunk/etc/memgrind
Modified:
    tuscany/sca-cpp/trunk/INSTALL
    tuscany/sca-cpp/trunk/etc/memgrind
    tuscany/sca-cpp/trunk/macos/macos-install
    tuscany/sca-cpp/trunk/modules/python/eval.hpp
    tuscany/sca-cpp/trunk/modules/wsgi/wsgi-start
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-image
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
    tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all

Modified: tuscany/sca-cpp/trunk/INSTALL
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/INSTALL?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/INSTALL (original)
+++ tuscany/sca-cpp/trunk/INSTALL Tue May 29 06:05:43 2012
@@ -238,7 +238,7 @@ dependencies installed under $build:
 --enable-libcloud \
 --with-libcloud=$build/libcloud-0.3.1-bin \
 --enable-threads \
---enable-python --with-python=/usr \
+--enable-python --with-python=$build/python-2.6.6-bin \
 --enable-opencl --with-opencl-include=/usr/include --with-opencl-lib=/usr/lib \
 --enable-gae --with-gae=$build/google_appengine \
 --enable-java --with-java=/usr/lib/jvm/default-java \

Modified: tuscany/sca-cpp/trunk/etc/memgrind
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/etc/memgrind?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/etc/memgrind (original)
+++ tuscany/sca-cpp/trunk/etc/memgrind Tue May 29 06:05:43 2012
@@ -18,6 +18,7 @@
 #  under the License.
 
 # Run valgrind to analyze memory usage and track memory leaks
+here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname 
$here`
 
-valgrind --tool=memcheck --leak-check=yes --show-reachable=yes 
--num-callers=40 --track-fds=yes --trace-children=yes $* 2>&1 | tee memgrind.log
+valgrind --tool=memcheck --leak-check=yes --show-reachable=yes 
--num-callers=50 --track-fds=yes --trace-children=yes 
--suppressions=$here/../../Python-2.6.6/Misc/valgrind-python.supp 
--suppressions=$here/valgrind-apr.supp $* 2>&1 | tee memgrind.log
 

Copied: tuscany/sca-cpp/trunk/etc/valgrind-apr.supp (from r1343439, 
tuscany/sca-cpp/trunk/etc/memgrind)
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/etc/valgrind-apr.supp?p2=tuscany/sca-cpp/trunk/etc/valgrind-apr.supp&p1=tuscany/sca-cpp/trunk/etc/memgrind&r1=1343439&r2=1343550&rev=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/etc/memgrind (original)
+++ tuscany/sca-cpp/trunk/etc/valgrind-apr.supp Tue May 29 06:05:43 2012
@@ -1,5 +1,3 @@
-#!/bin/sh
-
 #  Licensed to the Apache Software Foundation (ASF) under one
 #  or more contributor license agreements.  See the NOTICE file
 #  distributed with this work for additional information
@@ -17,7 +15,13 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-# Run valgrind to analyze memory usage and track memory leaks
+# This is a valgrind suppression file.
 
-valgrind --tool=memcheck --leak-check=yes --show-reachable=yes 
--num-callers=40 --track-fds=yes --trace-children=yes $* 2>&1 | tee memgrind.log
+{
+   Suppress APR pool cleanup registrations.
+   Memcheck:Leak
+   fun:malloc
+   fun:apr_palloc
+   fun:apr_pool_cleanup_register
+}
 

Modified: tuscany/sca-cpp/trunk/macos/macos-install
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/macos/macos-install?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/macos/macos-install (original)
+++ tuscany/sca-cpp/trunk/macos/macos-install Tue May 29 06:05:43 2012
@@ -299,6 +299,18 @@ if [ "$?" != "0" ]; then
 fi
 cd $build
 
+# Build Python
+curl -OL http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz
+tar xzf Python-2.6.6.tgz
+cd Python-2.6.6
+./configure --prefix=$build/python-2.6.6-bin --enable-shared
+make
+make install
+if [ "$?" != "0" ]; then
+    exit $?
+fi
+cd $build
+
 # Build Apache Libcloud
 curl -OL 
http://archive.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2
 tar xjf apache-libcloud-incubating-0.4.2.tar.bz2
@@ -321,7 +333,7 @@ cd $build
 git clone git://git.apache.org/tuscany-sca-cpp.git
 cd tuscany-sca-cpp
 ./bootstrap
-./configure --prefix=$build/tuscany-sca-cpp-bin 
--with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin 
--with-httpd=$build/httpd-2.3.15-bin 
--with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin 
--with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js 
--with-js-lib=$build/js-1.8.5-bin/lib --enable-libcloud 
--with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python 
--enable-opencl --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat 
--with-libstrophe=$build/libstrophe-bin --enable-sqldb 
--with-pgsql=$build/postgresql-9.1.2-bin 
--with-pgbouncer=$build/pgbouncer-1.5-bin --enable-openid 
--with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth 
--with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security 
--with-mod-security=$build/modsecurity-apache-2.6.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin 
--with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin 
--with-httpd=$build/httpd-2.3.15-bin 
--with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin 
--with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js 
--with-js-lib=$build/js-1.8.5-bin/lib --enable-libcloud 
--with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python 
--with-python=$build/python-2.6.6-bin --enable-opencl 
--with-libxml2=$build/libxml2-2.7.7-bin --enable-chat 
--with-libstrophe=$build/libstrophe-bin --enable-sqldb 
--with-pgsql=$build/postgresql-9.1.2-bin 
--with-pgbouncer=$build/pgbouncer-1.5-bin --enable-openid 
--with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth 
--with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security 
--with-mod-security=$build/modsecurity-apache-2.6.1-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -330,8 +342,8 @@ fi
 cd $build
 
 # Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 
autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.24.0 curl-7.24.0-bin 
curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin 
httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin 
js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.13-stable 
libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz liboauth-0.9.1 
liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe 
libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz 
memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid 
mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin 
modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-c
 onfig-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz pgbouncer-1.5 
pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp 
tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 
autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.24.0 curl-7.24.0-bin 
curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin 
httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin 
js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.13-stable 
libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz liboauth-0.9.1 
liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe 
libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz 
memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid 
mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin 
modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-c
 onfig-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz pgbouncer-1.5 
pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz Python-2.6.6 python-2.6.6-bin Python-2.6.6.tgz tidy 
tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin
 
 # Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin 
expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin 
libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin 
libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin 
modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin 
pgbouncer-1.5-bin postgresql-9.1.2-bin tinycdb-bin leveldb tuscany-sca-cpp 
tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin 
expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin 
libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin 
libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin 
modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin 
pgbouncer-1.5-bin postgresql-9.1.2-bin python-2.6.6-bin tinycdb-bin leveldb 
tuscany-sca-cpp tuscany-sca-cpp-bin
 

Modified: tuscany/sca-cpp/trunk/modules/python/eval.hpp
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/python/eval.hpp?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/python/eval.hpp (original)
+++ tuscany/sca-cpp/trunk/modules/python/eval.hpp Tue May 29 06:05:43 2012
@@ -27,8 +27,14 @@
  */
 #if PYTHON_VERSION == 27
 #include <python2.7/Python.h>
+#include <python2.7/frameobject.h>
+#include <python2.7/traceback.h>
 #else
+#undef _POSIX_C_SOURCE
+#undef _XOPEN_SOURCE
 #include <python2.6/Python.h>
+#include <python2.6/frameobject.h>
+#include <python2.6/traceback.h>
 #endif
 
 #include "list.hpp"
@@ -40,6 +46,21 @@ namespace python {
 class PythonThreadIn;
 class PythonThreadOut;
 class PythonRuntimeLock;
+class PythonRuntime;
+
+/**
+ * Maintain a garbage collected reference to a Python object.
+ */
+const bool pyIncRef(PyObject* o);
+const bool pyDecRef(PyObject* o, PythonRuntime* py);
+
+/**
+ * Write to debug log from Python.
+ */
+const value pyDebug(const list<value>& args) {
+    debug(args, "python::debug");
+    return true;
+}
 
 /**
  * Represent a Python runtime.
@@ -63,10 +84,12 @@ public:
         // Initialize the Python interpreter
 #ifdef IS_DARWIN
         debug("python::pythonruntime::initialize");
+        Py_SetPythonHome(const_cast<char*>(PYTHON_PREFIX));
         Py_InitializeEx(0);
 #else
         if (!Py_IsInitialized()) {
             debug("python::pythonruntime::initialize");
+            Py_SetPythonHome(const_cast<char*>(PYTHON_PREFIX));
             Py_InitializeEx(0);
         }
 #endif
@@ -84,12 +107,22 @@ public:
 #endif
 #endif
 
-        // Set default interpreter args
 #ifdef WANT_THREADS
         PyGILState_STATE gstate = PyGILState_Ensure();
 #endif
+
+        // Set default interpreter args
         const char* arg0 = "";
         PySys_SetArgv(0, const_cast<char**>(&arg0));
+
+        // Install debug log function
+        PyObject* mkPyLambda(const lambda<value(const list<value>&)>& l, 
PythonRuntime* py);
+        PyObject* pyd= mkPyLambda(pyDebug, this);
+        PyObject* sys = PyImport_ImportModule("sys");
+        PyObject_SetAttrString(sys, "debug", pyd);
+        pyDecRef(pyd, this);
+        pyDecRef(sys, this);
+
 #ifdef WANT_THREADS
         PyGILState_Release(gstate);
 #endif
@@ -115,24 +148,46 @@ private:
 /**
  * Return the last python error.
  */
-const string lastError() {
+const string lastErrorTrace(PyObject *trace) {
+    if (trace == NULL)
+        return "";
+    PyTracebackObject* tb = (PyTracebackObject*)trace;
+    const int limit = 16;
+    int depth = 0;
+    PyTracebackObject *tb1 = tb;
+    while (tb1 != NULL) {
+        depth++;
+        tb1 = tb1->tb_next;
+    }
+    ostringstream os;
+    while (tb != NULL) {
+        if (depth <= limit)
+            os << ", File " << 
PyString_AsString(tb->tb_frame->f_code->co_filename) <<
+                " line " << tb->tb_lineno << " in " << 
PyString_AsString(tb->tb_frame->f_code->co_name);
+        depth--;
+        tb = tb->tb_next;
+    }
+    return str(os);
+}
+
+const string lastError(PythonRuntime* py) {
     if(PyErr_Occurred()) {
-        PyObject* type;
-        PyObject* val;
-        PyObject* trace;
+        PyObject* type = NULL;
+        PyObject* val = NULL;
+        PyObject* trace = NULL;
         PyErr_Fetch(&type, &val, &trace);
         if (type != NULL && val != NULL) {
             PyObject* stype = PyObject_Str(type);    
             PyObject* sval = PyObject_Str(val);    
-            string msg = string() + PyString_AsString(stype) + " : " + 
PyString_AsString(sval);
-            Py_DECREF(stype);
-            Py_DECREF(sval);
+            string msg = string() + PyString_AsString(stype) + " : " + 
PyString_AsString(sval) + lastErrorTrace(trace);
+            pyDecRef(stype, py);
+            pyDecRef(sval, py);
             PyErr_Restore(type, val, trace);
-            PyErr_Print();
+            PyErr_Clear();
             return msg;
         }
         PyErr_Restore(type, val, trace);
-        PyErr_Print();
+        PyErr_Clear();
         return "Unknown Python error";
     }
     return "";
@@ -235,6 +290,44 @@ private:
 };
 
 /**
+ * A gargabe collected Python object reference.
+ */
+class PyGCRef {
+public:
+    PyGCRef(PyObject* o, PythonRuntime* py) : o(o), py(py) {
+    }
+
+    ~PyGCRef() {
+        if (o == NULL)
+            return;
+        PythonThreadIn pyin(py);
+        Py_DECREF(o);
+    }
+
+private:
+    PyObject* o;
+    PythonRuntime* py;
+};
+
+/**
+ * Maintain a garbage collected reference to a Python object.
+ */
+const bool pyIncRef(PyObject* o) {
+    if (o == NULL)
+        return true;
+    Py_INCREF(o);
+    return true;
+}
+
+const bool pyDecRef(unused PyObject* o, unused PythonRuntime* py) {
+    if (o == NULL)
+        return true;
+    //new (gc_new<PyGCRef>()) PyGCRef(o, py);
+    Py_DECREF(o);
+    return true;
+}
+
+/**
  * Declare conversion functions.
  */
 PyObject* valueToPyObject(const value& v, PythonRuntime* py);
@@ -254,14 +347,14 @@ typedef struct {
 PyObject *mkPyLambda(const lambda<value(const list<value>&)>& l, 
PythonRuntime* py);
 
 void pyLambda_dealloc(PyObject* self) {
-    debug(self, "python::pylambda_dealloc");
+    //debug(self, "python::pylambda_dealloc");
     PyObject_Del(self);
 }
 
-const string pyRepr(PyObject* o) {
+const string pyRepr(PyObject* o, PythonRuntime* py) {
     PyObject* r = PyObject_Repr(o);
     const string s = PyString_AsString(r);
-    Py_DECREF(r);
+    pyDecRef(r, py);
     return s;
 }
 
@@ -300,7 +393,7 @@ PyObject* pyLambda_getattr(PyObject *sel
         return PyObject_GenericGetAttr(self, attrname);
 
     if (name == "eval") {
-        Py_INCREF(self);
+        pyIncRef(self);
         return self;
     }
 
@@ -371,7 +464,7 @@ PyObject *mkPyLambda(const lambda<value(
         pyl->func = new (gc_new<lambda<value(const list<value>&)> >()) 
lambda<value(const list<value>&)>(l);
         pyl->py = py;
     }
-    debug(pyl, "python::mkpylambda");
+    //debug(pyl, "python::mkpylambda");
     return (PyObject*)pyl;
 }
 
@@ -383,14 +476,14 @@ PyObject* valuesToPyListHelper(PyObject*
         return l;
     PyObject* pyv = valueToPyObject(car(v), py);
     PyList_Append(l, pyv);
-    Py_DECREF(pyv);
+    pyDecRef(pyv, py);
     return valuesToPyListHelper(l, cdr(v), py);
 }
 
 PyObject* valuesToPyTuple(const list<value>& v, PythonRuntime* py) {
     PyObject* pyl = valuesToPyListHelper(PyList_New(0), v, py);
     PyObject* pyt = PyList_AsTuple(pyl);
-    Py_DECREF(pyl);
+    pyDecRef(pyl, py);
     return pyt;
 }
 
@@ -411,10 +504,16 @@ PyObject* valueToPyObject(const value& v
     }
     case value::Number:
         return PyFloat_FromDouble((double)v);
-    case value::Bool:
-        return (bool)v? Py_True : Py_False;
-    default:
-        return Py_None;
+    case value::Bool: {
+        PyObject* b = (bool)v? Py_True : Py_False;
+        pyIncRef(b);
+        return b;
+    }
+    default: {
+        PyObject* n = Py_None;
+        pyIncRef(n);
+        return n;
+    }
     }
 }
 
@@ -438,22 +537,46 @@ const list<value> pyTupleToValues(PyObje
 struct pyCallable {
     PyObject* func;
     PythonRuntime* py;
+    bool owner;
+
+    pyCallable(PyObject* func, PythonRuntime* py) : func(func), py(py), 
owner(true) {
+        pyIncRef(func);
+    }
 
-    pyCallable(PyObject* func, PythonRuntime* py) : func(func), py(py) {
-        Py_INCREF(func);
+    pyCallable(const pyCallable& c) : func(c.func), py(c.py), owner(false) {
     }
 
     ~pyCallable() {
-        Py_DECREF(func);
+        if (!owner)
+            return;
+        pyDecRef(func, py);
     }
 
     const value operator()(const list<value>& args) const {
         PythonThreadIn pyin(py);
+        {
+            // Temp
+            PyObject* rfunc = PyObject_Repr(func);
+            char* s = NULL;
+            Py_ssize_t l = 0;
+            PyString_AsStringAndSize(rfunc, &s, &l);
+            debug(string(s, l), "python::operator()::func");
+            pyDecRef(rfunc, py);
+        }
         PyObject* pyargs = valuesToPyTuple(args, py);
+        {
+            // Temp
+            PyObject* rargs = PyObject_Repr(pyargs);
+            char* s = NULL;
+            Py_ssize_t l = 0;
+            PyString_AsStringAndSize(rargs, &s, &l);
+            debug(string(s, l), "python::operator()::args");
+            pyDecRef(rargs, py);
+        }
         PyObject* result = PyObject_CallObject(func, pyargs);
         const value v = pyObjectToValue(result, py);
-        Py_DECREF(pyargs);
-        Py_DECREF(result);
+        pyDecRef(pyargs, py);
+        pyDecRef(result, py);
         return v;
     }
 };
@@ -462,6 +585,8 @@ struct pyCallable {
  * Convert a python object to a value.
  */
 const value pyObjectToValue(PyObject *o, PythonRuntime* py) {
+    if (o == NULL)
+        return value();
     if (PyString_Check(o)) {
         char* s = NULL;
         Py_ssize_t l = 0;
@@ -509,10 +634,10 @@ const failable<value> evalScript(const v
             return value(lambda<value(const list<value>&)>());
         }
 
-        return mkfailure<value>(string("Couldn't find function: ") + 
car<value>(expr) + " : " + lastError());
+        return mkfailure<value>(string("Couldn't find function: ") + 
car<value>(expr) + " : " + lastError(&py));
     }
     if (!PyCallable_Check(func)) {
-        Py_DECREF(func);
+        pyDecRef(func, &py);
         return mkfailure<value>(string("Couldn't find callable function: ") + 
car<value>(expr));
     }
 
@@ -521,14 +646,14 @@ const failable<value> evalScript(const v
 
     // Call the function
     PyObject* result = PyObject_CallObject(func, args);
-    Py_DECREF(func);
-    Py_DECREF(args);
+    pyDecRef(func, &py);
+    pyDecRef(args, &py);
     if (result == NULL)
-        return mkfailure<value>(string("Function call failed: ") + 
car<value>(expr) + " : " + lastError());
+        return mkfailure<value>(string("Function call failed: ") + 
car<value>(expr) + " : " + lastError(&py));
 
     // Convert python result to a value
     const value v = pyObjectToValue(result, &py);
-    Py_DECREF(result);
+    pyDecRef(result, &py);
     return v;
 }
 
@@ -538,27 +663,35 @@ const failable<value> evalScript(const v
 const failable<PyObject*> readScript(const string& name, const string& path, 
istream& is, PythonRuntime& py) {
     PythonThreadIn pyin(&py);
 
+    // Lookup already loaded module
+    PyObject *mods = PyImport_GetModuleDict();
+    PyObject *emod = PyDict_GetItemString(mods, 
const_cast<char*>(c_str(name)));
+    if (emod != NULL)
+        return emod;
+
+    // Compile and import new module
+    debug(name, "python::readScript::compile::name");
+    debug(path, "python::readScript::compile::path");
     const list<string> ls = streamList(is);
     ostringstream os;
     write(ls, os);
     PyObject* code = Py_CompileStringFlags(c_str(str(os)), c_str(path), 
Py_file_input, NULL);
     if (code == NULL)
-        return mkfailure<PyObject*>(string("Couldn't compile script: ") + path 
+ " : " + lastError());
+        return mkfailure<PyObject*>(string("Couldn't compile script: ") + path 
+ " : " + lastError(&py));
     PyObject* mod = PyImport_ExecCodeModuleEx(const_cast<char*>(c_str(name)), 
code, const_cast<char*>(c_str(path)));
     if (mod == NULL) {
-        Py_DECREF(code);
-        return mkfailure<PyObject*>(string("Couldn't import module: ") + path 
+ " : " + lastError());
+        pyDecRef(code, &py);
+        return mkfailure<PyObject*>(string("Couldn't import module: ") + path 
+ " : " + lastError(&py));
     }
-    Py_DECREF(code);
     return mod;
 }
 
 /**
  * Release a python script.
  */
-const failable<bool> releaseScript(PyObject* script, PythonRuntime& py) {
+const failable<bool> releaseScript(unused PyObject* script, PythonRuntime& py) 
{
     PythonThreadIn pyin(&py);
-    Py_DECREF(script);
+    // No need to decref the script here, as it's referenced only once from 
sys.modules
     return true;
 }
 
@@ -566,9 +699,10 @@ const failable<bool> releaseScript(PyObj
  * Evaluate an expression against a script provided as an input stream.
  */
 const failable<value> evalScript(const value& expr, istream& is, 
PythonRuntime& py) {
-    failable<PyObject*> script = readScript("script", "script.py", is, py);
+    const value uuid = mkuuid();
+    failable<PyObject*> script = readScript(string("script") + string(uuid), 
string("script") + string(uuid) + string(".py"), is, py);
     if (!hasContent(script))
-        return mkfailure<value>(reason(script));
+        return mkfailure<value>(script);
     return evalScript(expr, content(script), py);
 }
 

Modified: tuscany/sca-cpp/trunk/modules/wsgi/wsgi-start
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/modules/wsgi/wsgi-start?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/modules/wsgi/wsgi-start (original)
+++ tuscany/sca-cpp/trunk/modules/wsgi/wsgi-start Tue May 29 06:05:43 2012
@@ -24,5 +24,6 @@ port=$2
 
 python_prefix=`cat $here/../python/python.prefix`
 cd $root
+export LD_LIBRARY_PATH=$python_prefix/lib:$LD_LIBRARY_PATH
 $python_prefix/bin/python composite.py $port &
 

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup Tue May 29 06:05:43 2012
@@ -23,8 +23,8 @@
 set -x
 
 # Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 
curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin 
expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz 
httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin 
liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin 
libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin 
libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin 
memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin 
modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin 
modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 
pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz scribe s
 cribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin 
thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin 
tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 
curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin 
expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz 
httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin 
liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin 
libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin 
libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin 
memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin 
modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin 
modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 
pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz Python-2
 .6.6 python-2.6.6-bin Python-2.6.6.tgz scribe scribe-2.2-bin scribe-2.2.tar.gz 
thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 
tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
 
 # Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin 
expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin 
liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin 
memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin 
nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin 
postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin 
tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin 
expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin 
liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin 
memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin 
nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin 
postgresql-9.1.2-bin python-2.6.6-bin scribe-2.2-bin thrift-0.2.0-bin 
tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
 

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-backup-all Tue May 29 06:05:43 2012
@@ -23,8 +23,8 @@
 set -x
 
 # Create src archive
-tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin 
axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 
curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin 
expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin 
httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin 
js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 
liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe 
libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz 
memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid 
mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin 
modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgb
 ouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe 
scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin 
thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin 
tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 
vysper-0.6-bin.tar.gz
+tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin 
axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 
curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin 
expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin 
httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin 
js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 
liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe 
libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz 
memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid 
mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin 
modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgb
 ouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz Python-2.6.6 python-2.6.6-bin Python-2.6.6.tgz 
qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin 
scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz 
tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp 
tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
 
 # Create bin archive
-tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin 
curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin 
js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin 
libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin 
modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel 
page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin qpidc-0.6-bin 
scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp 
tuscany-sca-cpp-bin vysper-0.6
+tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin 
curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin 
js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin 
libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin 
modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel 
page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin python-2.6.6-bin 
qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp 
tuscany-sca-cpp-bin vysper-0.6
 

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image Tue May 29 06:05:43 2012
@@ -74,7 +74,7 @@ if [ "$?" != "0" ]; then
     exit $?
 fi
 # Required by Apache Thrift
-sudo apt-get -y install bison flex python-dev
+sudo apt-get -y install bison flex
 if [ "$?" != "0" ]; then
     exit $?
 fi

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-image
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-image?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-image (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-bin-image Tue May 29 06:05:43 2012
@@ -59,7 +59,7 @@ if [ "$?" != "0" ]; then
     exit $?
 fi
 # Required by Apache Thrift
-sudo apt-get -y install bison flex python-dev libboost-dev 
libboost-filesystem-dev
+sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev
 if [ "$?" != "0" ]; then
     exit $?
 fi

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-install
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-install (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-install Tue May 29 06:05:43 2012
@@ -285,7 +285,7 @@ curl -OL http://archive.apache.org/dist/
 tar xzf thrift-0.2.0-incubating.tar.gz
 cd thrift-0.2.0
 ./bootstrap.sh
-./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no 
--with-perl=no --with-ruby=no --with-csharp=no --disable-static
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no 
--with-py=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
 make
 make install
 if [ "$?" != "0" ]; then
@@ -324,6 +324,18 @@ fi
 cp src/lib/libscribe.so $build/scribe-2.2-bin/lib
 cd $build
 
+# Build Python
+curl -OL http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz
+tar xzf Python-2.6.6.tgz
+cd Python-2.6.6
+./configure --prefix=$build/python-2.6.6-bin --enable-shared
+make
+make install
+if [ "$?" != "0" ]; then
+    exit $?
+fi
+cd $build
+
 # Build Apache Libcloud
 curl -OL 
http://archive.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2
 tar xjf apache-libcloud-incubating-0.4.2.tar.bz2
@@ -356,7 +368,7 @@ cd $build
 git clone git://git.apache.org/tuscany-sca-cpp.git
 cd tuscany-sca-cpp
 ./bootstrap
-./configure --prefix=$build/tuscany-sca-cpp-bin 
--with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin 
--with-httpd=$build/httpd-2.3.15-bin 
--with-memcached=$build/memcached-1.4.7-bin 
--with-tinycdb=$build/tinycdb-0.77-bin 
--with-js-include=$build/js-1.8.5-bin/include/js 
--with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed 
--with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud 
--with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python 
--with-libxml2=$build/libxml2-2.7.7-bin --enable-chat 
--with-libstrophe=$build/libstrophe-bin --enable-sqldb 
--with-pgsql=$build/postgresql-9.1.2-bin 
--with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log 
--with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin 
--enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin 
--enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security 
--with-mod-security=$build/modsecurity-apache-2.6.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin 
--with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin 
--with-httpd=$build/httpd-2.3.15-bin 
--with-memcached=$build/memcached-1.4.7-bin 
--with-tinycdb=$build/tinycdb-0.77-bin 
--with-js-include=$build/js-1.8.5-bin/include/js 
--with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed 
--with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud 
--with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python 
--with-python=$build/python-2.6.6-bin --with-libxml2=$build/libxml2-2.7.7-bin 
--enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb 
--with-pgsql=$build/postgresql-9.1.2-bin 
--with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log 
--with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin 
--enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin 
--enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security 
--with-mod-security=$build/modsecurity-apache-2.6.
 1-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -365,8 +377,8 @@ fi
 cd $build
 
 # Create src archive
-tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 
curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin 
expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz 
httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin 
liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin 
libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin 
libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin 
memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin 
modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin 
modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 
pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz scribe s
 cribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin 
thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin 
tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 
curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin 
expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz 
httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin 
liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin 
libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin 
libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin 
memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin 
modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin 
modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 
pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz Python-2
 .6.6 python-2.6.6-bin Python-2.6.6.tgz scribe scribe-2.2-bin scribe-2.2.tar.gz 
thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 
tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin
 
 # Create bin archive
-tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin 
expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin 
liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin 
memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin 
nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin 
postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin 
tuscany-sca-cpp tuscany-sca-cpp-bin
+tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin 
expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin 
liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin 
memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin 
nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin 
postgresql-9.1.2-bin python-2.6.6-bin scribe-2.2-bin thrift-0.2.0-bin 
tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin
 

Modified: tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all
URL: 
http://svn.apache.org/viewvc/tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all?rev=1343550&r1=1343549&r2=1343550&view=diff
==============================================================================
--- tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all (original)
+++ tuscany/sca-cpp/trunk/ubuntu/ubuntu-install-all Tue May 29 06:05:43 2012
@@ -339,7 +339,7 @@ curl -OL http://archive.apache.org/dist/
 tar xzf thrift-0.2.0-incubating.tar.gz
 cd thrift-0.2.0
 ./bootstrap.sh
-./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no 
--with-perl=no --with-ruby=no --with-csharp=no --disable-static
+./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no 
--with-py=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static
 make
 make install
 if [ "$?" != "0" ]; then
@@ -378,6 +378,18 @@ fi
 cp src/lib/libscribe.so $build/scribe-2.2-bin/lib
 cd $build
 
+# Build Python
+curl -OL http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz
+tar xzf Python-2.6.6.tgz
+cd Python-2.6.6
+./configure --prefix=$build/python-2.6.6-bin --enable-shared
+make
+make install
+if [ "$?" != "0" ]; then
+    exit $?
+fi
+cd $build
+
 # Build Apache Libcloud
 curl -OL 
http://archive.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2
 tar xjf apache-libcloud-incubating-0.4.2.tar.bz2
@@ -410,7 +422,7 @@ cd $build
 git clone git://git.apache.org/tuscany-sca-cpp.git
 cd tuscany-sca-cpp
 ./bootstrap
-./configure --prefix=$build/tuscany-sca-cpp-bin 
--with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin 
--with-httpd=$build/httpd-2.3.15-bin 
--with-memcached=$build/memcached-1.4.7-bin 
--with-tinycdb=$build/tinycdb-0.77-bin 
--with-js-include=$build/js-1.8.5-bin/include/js 
--with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed 
--with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud 
--with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python 
--enable-gae --with-gae=$build/google_appengine --enable-java 
--with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice 
--with-libxml2=$build/libxml2-2.7.7-bin --with-axis2c=$build/axis2c-1.6.0-bin 
--enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat 
--with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.6 
--enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin 
--with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log 
--with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-
 2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin 
--enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security 
--with-mod-security=$build/modsecurity-apache-2.6.1-bin
+./configure --prefix=$build/tuscany-sca-cpp-bin 
--with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin 
--with-httpd=$build/httpd-2.3.15-bin 
--with-memcached=$build/memcached-1.4.7-bin 
--with-tinycdb=$build/tinycdb-0.77-bin 
--with-js-include=$build/js-1.8.5-bin/include/js 
--with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed 
--with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud 
--with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python 
--with-python=$build/python-2.6.6-bin --enable-gae 
--with-gae=$build/google_appengine --enable-java 
--with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice 
--with-libxml2=$build/libxml2-2.7.7-bin --with-axis2c=$build/axis2c-1.6.0-bin 
--enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat 
--with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.6 
--enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin 
--with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log 
--with-thrift=$build/thrift-
 0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid 
--with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth 
--with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security 
--with-mod-security=$build/modsecurity-apache-2.6.1-bin
 make
 make install
 if [ "$?" != "0" ]; then
@@ -419,8 +431,8 @@ fi
 cd $build
 
 # Create src archive
-tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin 
axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 
curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin 
expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin 
httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin 
js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 
liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe 
libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz 
memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid 
mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin 
modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgb
 ouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe 
scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin 
thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin 
tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 
vysper-0.6-bin.tar.gz
+tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 
apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin 
axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 
curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin 
expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin 
httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin 
js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 
liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe 
libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz 
memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid 
mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin 
modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 
modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem 
page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgb
 ouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin 
postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz 
Python-2.6.6 python-2.6.6-bin Python-2.6.6.tgz scribe scribe-2.2-bin 
scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz 
tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp 
tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz
 
 # Create bin archive
-tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin 
curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin 
js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin 
libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin 
modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel 
page-speed-1.9-bin postgresql-9.1.2-bin qpidc-0.6-bin scribe-2.2-bin 
thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6
+tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin 
curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin 
js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin 
libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin 
modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel 
page-speed-1.9-bin postgresql-9.1.2-bin python-2.6.6-bin qpidc-0.6-bin 
scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp 
tuscany-sca-cpp-bin vysper-0.6
 


Reply via email to