<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[14609] twext/trunk/bin</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/14609">14609</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2015-03-26 10:59:13 -0700 (Thu, 26 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>sync</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#twexttrunkbin_buildsh">twext/trunk/bin/_build.sh</a></li>
<li><a href="#twexttrunkbin_pysh">twext/trunk/bin/_py.sh</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="twexttrunkbin_buildsh"></a>
<div class="modfile"><h4>Modified: twext/trunk/bin/_build.sh (14608 => 14609)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/bin/_build.sh        2015-03-26 17:56:00 UTC (rev 14608)
+++ twext/trunk/bin/_build.sh        2015-03-26 17:59:13 UTC (rev 14609)
</span><span class="lines">@@ -82,6 +82,8 @@
</span><span class="cx"> 
</span><span class="cx"> # Initialize all the global state required to use this library.
</span><span class="cx"> init_build () {
</span><ins>+  cd &quot;${wd}&quot;;
+
</ins><span class="cx">   init_py;
</span><span class="cx"> 
</span><span class="cx">   # These variables are defaults for things which might be configured by
</span><span class="lines">@@ -109,10 +111,8 @@
</span><span class="cx">     dep_packages=&quot;${TWEXT_PKG_CACHE}&quot;;
</span><span class="cx">   fi;
</span><span class="cx"> 
</span><del>-  project=&quot;$(setup_print name)&quot;;
</del><ins>+  project=&quot;$(setup_print name)&quot; || project=&quot;&lt;unknown&gt;&quot;;
</ins><span class="cx"> 
</span><del>-  export _DEVELOP_PROJECT_=&quot;${project}&quot;;
-
</del><span class="cx">   # Find some hashing commands
</span><span class="cx">   # sha1() = sha1 hash, if available
</span><span class="cx">   # md5()  = md5 hash, if available
</span><span class="lines">@@ -121,34 +121,35 @@
</span><span class="cx"> 
</span><span class="cx">   hash=&quot;&quot;;
</span><span class="cx"> 
</span><del>-  if type -ft openssl &gt; /dev/null; then
</del><ins>+  if find_cmd openssl &gt; /dev/null; then
</ins><span class="cx">     if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
</span><del>-    md5 () { &quot;$(type -p openssl)&quot; dgst -md5 &quot;$@&quot;; }
-  elif type -ft md5 &gt; /dev/null; then
</del><ins>+    # remove &quot;(stdin)= &quot; from the front which openssl emits on some platforms
+    md5 () { &quot;$(find_cmd openssl)&quot; dgst -md5 &quot;$@&quot; | sed 's/^.* //'; }
+  elif find_cmd md5 &gt; /dev/null; then
</ins><span class="cx">     if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
</span><del>-    md5 () { &quot;$(type -p md5)&quot; &quot;$@&quot;; }
-  elif type -ft md5sum &gt; /dev/null; then
</del><ins>+    md5 () { &quot;$(find_cmd md5)&quot; &quot;$@&quot;; }
+  elif find_cmd md5sum &gt; /dev/null; then
</ins><span class="cx">     if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
</span><del>-    md5 () { &quot;$(type -p md5sum)&quot; &quot;$@&quot;; }
</del><ins>+    md5 () { &quot;$(find_cmd md5sum)&quot; &quot;$@&quot;; }
</ins><span class="cx">   fi;
</span><span class="cx"> 
</span><del>-  if type -ft sha1sum &gt; /dev/null; then
</del><ins>+  if find_cmd sha1sum &gt; /dev/null; then
</ins><span class="cx">     if [ -z &quot;${hash}&quot; ]; then hash=&quot;sha1sum&quot;; fi;
</span><del>-    sha1 () { &quot;$(type -p sha1sum)&quot; &quot;$@&quot;; }
</del><ins>+    sha1 () { &quot;$(find_cmd sha1sum)&quot; &quot;$@&quot;; }
</ins><span class="cx">   fi;
</span><del>-  if type -ft shasum &gt; /dev/null; then
</del><ins>+  if find_cmd shasum &gt; /dev/null; then
</ins><span class="cx">     if [ -z &quot;${hash}&quot; ]; then hash=&quot;sha1&quot;; fi;
</span><del>-    sha1 () { &quot;$(type -p shasum)&quot; &quot;$@&quot;; }
</del><ins>+    sha1 () { &quot;$(find_cmd shasum)&quot; &quot;$@&quot;; }
</ins><span class="cx">   fi;
</span><span class="cx"> 
</span><span class="cx">   if [ &quot;${hash}&quot; = &quot;sha1&quot; ]; then
</span><span class="cx">     hash () { sha1 &quot;$@&quot;; }
</span><span class="cx">   elif [ &quot;${hash}&quot; = &quot;md5&quot; ]; then
</span><span class="cx">     hash () { md5 &quot;$@&quot;; }
</span><del>-  elif type -t cksum &gt; /dev/null; then
</del><ins>+  elif find_cmd cksum &gt; /dev/null; then
</ins><span class="cx">     hash=&quot;hash&quot;;
</span><span class="cx">     hash () { cksum &quot;$@&quot; | cut -f 1 -d &quot; &quot;; }
</span><del>-  elif type -t sum &gt; /dev/null; then
</del><ins>+  elif find_cmd sum &gt; /dev/null; then
</ins><span class="cx">     hash=&quot;hash&quot;;
</span><span class="cx">     hash () { sum &quot;$@&quot; | cut -f 1 -d &quot; &quot;; }
</span><span class="cx">   else
</span><span class="lines">@@ -158,9 +159,9 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> setup_print () {
</span><del>-  what=&quot;$1&quot;; shift;
</del><ins>+  local what=&quot;$1&quot;; shift;
</ins><span class="cx"> 
</span><del>-  PYTHONPATH=&quot;${wd}:${PYTHONPATH:-}&quot; &quot;${bootstrap_python}&quot; - &lt;&lt; EOF
</del><ins>+  PYTHONPATH=&quot;${wd}:${PYTHONPATH:-}&quot; &quot;${bootstrap_python}&quot; - 2&gt;/dev/null &lt;&lt; EOF
</ins><span class="cx"> from __future__ import print_function
</span><span class="cx"> import setup
</span><span class="cx"> print(setup.${what})
</span><span class="lines">@@ -175,7 +176,7 @@
</span><span class="cx">   local  md5=&quot;&quot;;
</span><span class="cx">   local sha1=&quot;&quot;;
</span><span class="cx"> 
</span><del>-  OPTIND=1;
</del><ins>+  local OPTIND=1;
</ins><span class="cx">   while getopts &quot;m:s:&quot; option; do
</span><span class="cx">     case &quot;${option}&quot; in
</span><span class="cx">       'm')  md5=&quot;${OPTARG}&quot;; ;;
</span><span class="lines">@@ -193,9 +194,11 @@
</span><span class="cx">   fi;
</span><span class="cx">   if [ ! -d &quot;${path}&quot; ]; then
</span><span class="cx">     local ext=&quot;$(echo &quot;${url}&quot; | sed 's|^.*\.\([^.]*\)$|\1|')&quot;;
</span><ins>+    local decompress=&quot;&quot;;
+    local unpack=&quot;&quot;;
</ins><span class="cx"> 
</span><span class="cx">     untar () { tar -xvf -; }
</span><del>-    unzipstream () { tmp=&quot;$(mktemp -t ccsXXXXX)&quot;; cat &gt; &quot;${tmp}&quot;; unzip &quot;${tmp}&quot;; rm &quot;${tmp}&quot;; }
</del><ins>+    unzipstream () { local tmp=&quot;$(mktemp -t ccsXXXXX)&quot;; cat &gt; &quot;${tmp}&quot;; unzip &quot;${tmp}&quot;; rm &quot;${tmp}&quot;; }
</ins><span class="cx">     case &quot;${ext}&quot; in
</span><span class="cx">       gz|tgz) decompress=&quot;gzip -d -c&quot;; unpack=&quot;untar&quot;; ;;
</span><span class="cx">       bz2)    decompress=&quot;bzip2 -d -c&quot;; unpack=&quot;untar&quot;; ;;
</span><span class="lines">@@ -320,6 +323,8 @@
</span><span class="cx"> # Run 'make' with the given command line, prepending a -j option appropriate to
</span><span class="cx"> # the number of CPUs on the current machine, if that can be determined.
</span><span class="cx"> jmake () {
</span><ins>+  local ncpu=&quot;&quot;;
+
</ins><span class="cx">   case &quot;$(uname -s)&quot; in
</span><span class="cx">     Darwin|Linux)
</span><span class="cx">       ncpu=&quot;$(getconf _NPROCESSORS_ONLN)&quot;;
</span><span class="lines">@@ -345,13 +350,18 @@
</span><span class="cx"> c_dependency () {
</span><span class="cx">   local f_hash=&quot;&quot;;
</span><span class="cx">   local configure=&quot;configure&quot;;
</span><ins>+  local prebuild_cmd=&quot;&quot;; 
+  local build_cmd=&quot;jmake&quot;; 
+  local install_cmd=&quot;make install&quot;;
</ins><span class="cx"> 
</span><del>-  OPTIND=1;
-  while getopts &quot;m:s:c:&quot; option; do
</del><ins>+  local OPTIND=1;
+  while getopts &quot;m:s:c:p:b:&quot; option; do
</ins><span class="cx">     case &quot;${option}&quot; in
</span><span class="cx">       'm') f_hash=&quot;-m ${OPTARG}&quot;; ;;
</span><span class="cx">       's') f_hash=&quot;-s ${OPTARG}&quot;; ;;
</span><span class="cx">       'c') configure=&quot;${OPTARG}&quot;; ;;
</span><ins>+      'p') prebuild_cmd=&quot;${OPTARG}&quot;; ;;
+      'b') build_cmd=&quot;${OPTARG}&quot;; ;;
</ins><span class="cx">     esac;
</span><span class="cx">   done;
</span><span class="cx">   shift $((${OPTIND} - 1));
</span><span class="lines">@@ -364,8 +374,7 @@
</span><span class="cx"> 
</span><span class="cx">   mkdir -p &quot;${dep_sources}&quot;;
</span><span class="cx"> 
</span><del>-  srcdir=&quot;${dep_sources}/${path}&quot;;
-  # local dstroot=&quot;${srcdir}/_root&quot;;
</del><ins>+  local srcdir=&quot;${dep_sources}/${path}&quot;;
</ins><span class="cx">   local dstroot=&quot;${dev_roots}/${name}&quot;;
</span><span class="cx"> 
</span><span class="cx">   www_get ${f_hash} &quot;${name}&quot; &quot;${srcdir}&quot; &quot;${uri}&quot;;
</span><span class="lines">@@ -376,7 +385,7 @@
</span><span class="cx">   export          CPPFLAGS=&quot;-I${dstroot}/include ${CPPFLAGS:-} &quot;;
</span><span class="cx">   export           LDFLAGS=&quot;-L${dstroot}/lib -L${dstroot}/lib64 ${LDFLAGS:-} &quot;;
</span><span class="cx">   export DYLD_LIBRARY_PATH=&quot;${dstroot}/lib:${dstroot}/lib64:${DYLD_LIBRARY_PATH:-}&quot;;
</span><del>-  export PKG_CONFIG_PATH=&quot;${dstroot}/lib/pkgconfig:${PKG_CONFIG_PATH:-}&quot;;
</del><ins>+  export   PKG_CONFIG_PATH=&quot;${dstroot}/lib/pkgconfig:${PKG_CONFIG_PATH:-}&quot;;
</ins><span class="cx"> 
</span><span class="cx">   if &quot;${do_setup}&quot;; then
</span><span class="cx">     if &quot;${force_setup}&quot;; then
</span><span class="lines">@@ -386,8 +395,11 @@
</span><span class="cx">       echo &quot;Building ${name}...&quot;;
</span><span class="cx">       cd &quot;${srcdir}&quot;;
</span><span class="cx">       &quot;./${configure}&quot; --prefix=&quot;${dstroot}&quot; &quot;$@&quot;;
</span><del>-      jmake;
-      jmake install;
</del><ins>+      if [ ! -z &quot;${prebuild_cmd}&quot; ]; then
+        eval ${prebuild_cmd};
+      fi;
+      eval ${build_cmd};
+      eval ${install_cmd};
</ins><span class="cx">       cd &quot;${wd}&quot;;
</span><span class="cx">     else
</span><span class="cx">       echo &quot;Using built ${name}.&quot;;
</span><span class="lines">@@ -432,13 +444,13 @@
</span><span class="cx">   # value of OPENSSL_VERSION_NUBMER for use in inequality comparison.
</span><span class="cx">   ruler;
</span><span class="cx"> 
</span><del>-  local min_ssl_version=&quot;9470367000&quot;;  # OpenSSL 0.9.8y
</del><ins>+  local min_ssl_version=&quot;9470367&quot;;  # OpenSSL 0.9.8y
</ins><span class="cx"> 
</span><span class="cx">   local ssl_version=&quot;$(c_macro openssl/ssl.h OPENSSL_VERSION_NUMBER)&quot;;
</span><span class="cx">   if [ -z &quot;${ssl_version}&quot; ]; then ssl_version=&quot;0x0&quot;; fi;
</span><span class="cx">   ssl_version=&quot;$(&quot;${bootstrap_python}&quot; -c &quot;print ${ssl_version}&quot;)&quot;;
</span><span class="cx"> 
</span><del>-  if [ &quot;${ssl_version}&quot; -lt &quot;${min_ssl_version}&quot; ]; then
</del><ins>+  if [ &quot;${ssl_version}&quot; -ge &quot;${min_ssl_version}&quot; ]; then
</ins><span class="cx">     using_system &quot;OpenSSL&quot;;
</span><span class="cx">   else
</span><span class="cx">     local v=&quot;0.9.8y&quot;;
</span><span class="lines">@@ -448,8 +460,9 @@
</span><span class="cx">     # use 'config' instead of 'configure'; 'make' instead of 'jmake'.
</span><span class="cx">     # also pass 'shared' to config to build shared libs.
</span><span class="cx">     c_dependency -c &quot;config&quot; -m &quot;47c7fb37f78c970f1d30aa2f9e9e26d8&quot; \
</span><ins>+      -p &quot;make depend&quot; -b &quot;make&quot; \
</ins><span class="cx">       &quot;openssl&quot; &quot;${p}&quot; \
</span><del>-      &quot;http://www.openssl.org/source/${p}.tar.gz&quot; &quot;no-ssl2&quot;;
</del><ins>+      &quot;http://www.openssl.org/source/${p}.tar.gz&quot; &quot;shared&quot;;
</ins><span class="cx">   fi;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -484,7 +497,7 @@
</span><span class="cx">     c_dependency -m &quot;39831848c731bcaef235a04e0d14412f&quot; \
</span><span class="cx">       &quot;OpenLDAP&quot; &quot;${p}&quot; \
</span><span class="cx">       &quot;http://www.openldap.org/software/download/OpenLDAP/${n}-release/${p}.tgz&quot; \
</span><del>-      --disable-bdb --disable-hdb;
</del><ins>+      --disable-bdb --disable-hdb --with-tls=openssl;
</ins><span class="cx">   fi;
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -503,32 +516,12 @@
</span><span class="cx">     local p=&quot;${n}-${v}&quot;;
</span><span class="cx"> 
</span><span class="cx">     c_dependency -m &quot;a7f4e5e559a0e37b3ffc438c9456e425&quot; \
</span><del>-      &quot;Cyrus SASL&quot; &quot;${p}&quot; \
</del><ins>+      &quot;CyrusSASL&quot; &quot;${p}&quot; \
</ins><span class="cx">       &quot;ftp://ftp.cyrusimap.org/cyrus-sasl/${p}.tar.gz&quot; \
</span><span class="cx">       --disable-macos-framework;
</span><span class="cx">   fi;
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-  ruler;
-  if type -P postgres &gt; /dev/null; then
-    using_system &quot;Postgres&quot;;
-  else
-    local v=&quot;9.3.1&quot;;
-    local n=&quot;postgresql&quot;;
-    local p=&quot;${n}-${v}&quot;;
-
-    if type -P dtrace &gt; /dev/null; then
-      local enable_dtrace=&quot;--enable-dtrace&quot;;
-    else
-      local enable_dtrace=&quot;&quot;;
-    fi;
-
-    c_dependency -m &quot;c003d871f712d4d3895956b028a96e74&quot; \
-      &quot;PostgreSQL&quot; &quot;${p}&quot; \
-      &quot;http://ftp.postgresql.org/pub/source/v${v}/${p}.tar.bz2&quot; \
-      --with-python ${enable_dtrace};
-  fi;
-
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -537,11 +530,13 @@
</span><span class="cx"> #
</span><span class="cx"> py_dependencies () {
</span><span class="cx">   python=&quot;${py_bindir}/python&quot;;
</span><ins>+  py_ve_tools=&quot;${dev_home}/ve_tools&quot;;
</ins><span class="cx"> 
</span><span class="cx">   export PATH=&quot;${py_virtualenv}/bin:${PATH}&quot;;
</span><span class="cx">   export PYTHON=&quot;${python}&quot;;
</span><del>-  export PYTHONPATH=&quot;${wd}:${PYTHONPATH:-}&quot;;
</del><ins>+  export PYTHONPATH=&quot;${py_ve_tools}/lib:${wd}:${PYTHONPATH:-}&quot;;
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx">   # Work around a change in Xcode tools that breaks Python modules in OS X
</span><span class="cx">   # 10.9.2 and prior due to a hard error if the -mno-fused-madd is used, as
</span><span class="cx">   # it was in the system Python, and is therefore passed along by disutils.
</span><span class="lines">@@ -563,14 +558,17 @@
</span><span class="cx"> 
</span><span class="cx">   if [ ! -d &quot;${py_virtualenv}&quot; ]; then
</span><span class="cx">     bootstrap_virtualenv;
</span><del>-    &quot;${bootstrap_python}&quot; -m virtualenv --system-site-packages &quot;${py_virtualenv}&quot;;
</del><ins>+    &quot;${bootstrap_python}&quot; -m virtualenv  \
+      --system-site-packages             \
+      --no-setuptools                    \
+      &quot;${py_virtualenv}&quot;;
</ins><span class="cx">   fi;
</span><span class="cx"> 
</span><span class="cx">   cd &quot;${wd}&quot;;
</span><span class="cx"> 
</span><span class="cx">   # Make sure setup got called enough to write the version file.
</span><span class="cx"> 
</span><del>-  &quot;${python}&quot; &quot;${wd}/setup.py&quot; check &gt; /dev/null;
</del><ins>+  PYTHONPATH=&quot;${PYTHONPATH}&quot; &quot;${python}&quot; &quot;${wd}/setup.py&quot; check &gt; /dev/null;
</ins><span class="cx"> 
</span><span class="cx">   if [ -d &quot;${dev_home}/pip_downloads&quot; ]; then
</span><span class="cx">     pip_install=&quot;pip_install_from_cache&quot;;
</span><span class="lines">@@ -595,33 +593,23 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> bootstrap_virtualenv () {
</span><del>-  py_ve_tools=&quot;${dev_home}/ve_tools&quot;;
-
-  if [ -d &quot;${py_ve_tools}/lib&quot; ]; then
-    export PYTHONPATH=&quot;${py_ve_tools}/lib:${PYTHONPATH:-}&quot;;
-  fi;
-
-  if &quot;${bootstrap_python}&quot; -m virtualenv &gt; /dev/null 2&gt;&amp;1; then
-    return 0;
-  fi;
-
</del><span class="cx">   mkdir -p &quot;${py_ve_tools}&quot;;
</span><span class="cx">   mkdir -p &quot;${py_ve_tools}/lib&quot;;
</span><span class="cx">   mkdir -p &quot;${py_ve_tools}/junk&quot;;
</span><span class="cx"> 
</span><span class="cx">   for pkg in             \
</span><del>-      pip-1.5.4          \
-      virtualenv-1.11.4  \
-      setuptools-3.4.4   \
</del><ins>+      setuptools-12.0.5  \
+      pip-6.0.8          \
+      virtualenv-12.0.7  \
</ins><span class="cx">   ; do
</span><del>-         name=&quot;${pkg%-*}&quot;;
-      version=&quot;${pkg#*-}&quot;;
-       first=&quot;$(echo &quot;${name}&quot; | sed 's|^\(.\).*$|\1|')&quot;;
-         url=&quot;https://pypi.python.org/packages/source/${first}/${name}/${pkg}.tar.gz&quot;;
</del><ins>+      local    name=&quot;${pkg%-*}&quot;;
+      local version=&quot;${pkg#*-}&quot;;
+      local  first=&quot;$(echo &quot;${name}&quot; | sed 's|^\(.\).*$|\1|')&quot;;
+      local    url=&quot;https://pypi.python.org/packages/source/${first}/${name}/${pkg}.tar.gz&quot;;
</ins><span class="cx"> 
</span><span class="cx">       ruler &quot;Downloading ${pkg}&quot;;
</span><span class="cx"> 
</span><del>-      tmp=&quot;$(mktemp -d -t ccsXXXXX)&quot;;
</del><ins>+      local tmp=&quot;$(mktemp -d -t ccsXXXXX)&quot;;
</ins><span class="cx"> 
</span><span class="cx">       curl -L &quot;${url}&quot; | tar -C &quot;${tmp}&quot; -xvzf -;
</span><span class="cx"> 
</span><span class="lines">@@ -638,8 +626,6 @@
</span><span class="cx"> 
</span><span class="cx">       rm -rf &quot;${tmp}&quot;;
</span><span class="cx">   done;
</span><del>-
-  export PYTHONPATH=&quot;${py_ve_tools}/lib:${PYTHONPATH:-}&quot;;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -667,7 +653,6 @@
</span><span class="cx"> pip_download_and_install () {
</span><span class="cx">   &quot;${python}&quot; -m pip install                 \
</span><span class="cx">     --pre --allow-all-external               \
</span><del>-    --download-cache=&quot;${dev_home}/pip_cache&quot; \
</del><span class="cx">     --log-file=&quot;${dev_home}/pip.log&quot;         \
</span><span class="cx">     &quot;$@&quot;;
</span><span class="cx"> }
</span><span class="lines">@@ -681,3 +666,20 @@
</span><span class="cx">   c_dependencies;
</span><span class="cx">   py_dependencies;
</span><span class="cx"> }
</span><ins>+
+
+develop_clean () {
+  init_build;
+
+  # Clean
+  rm -rf &quot;${dev_roots}&quot;;
+  rm -rf &quot;${py_virtualenv}&quot;;
+}
+
+
+develop_distclean () {
+  init_build;
+
+  # Clean
+  rm -rf &quot;${dev_home}&quot;;
+}
</ins></span></pre></div>
<a id="twexttrunkbin_pysh"></a>
<div class="modfile"><h4>Modified: twext/trunk/bin/_py.sh (14608 => 14609)</h4>
<pre class="diff"><span>
<span class="info">--- twext/trunk/bin/_py.sh        2015-03-26 17:56:00 UTC (rev 14608)
+++ twext/trunk/bin/_py.sh        2015-03-26 17:59:13 UTC (rev 14609)
</span><span class="lines">@@ -15,6 +15,18 @@
</span><span class="cx"> # limitations under the License.
</span><span class="cx"> ##
</span><span class="cx"> 
</span><ins>+find_cmd () {
+  local cmd=&quot;$1&quot;; shift;
+
+  local path=&quot;$(type &quot;${cmd}&quot; 2&gt;/dev/null | sed &quot;s|^${cmd} is \(a tracked alias for \)\{0,1\}||&quot;)&quot;;
+
+  if [ -z &quot;${cmd}&quot; ]; then
+    return 1;
+  fi;
+
+  echo &quot;${path}&quot;;
+}
+
</ins><span class="cx"> # Echo the major.minor version of the given Python interpreter.
</span><span class="cx"> 
</span><span class="cx"> py_version () {
</span><span class="lines">@@ -38,7 +50,7 @@
</span><span class="cx">   fi;
</span><span class="cx"> 
</span><span class="cx">   local py_version=&quot;$(py_version &quot;${python}&quot;)&quot;;
</span><del>-  if [ &quot;${py_version/./}&quot; -lt &quot;25&quot; ]; then
</del><ins>+  if [ &quot;$(echo &quot;${py_version}&quot; | sed 's|\.||')&quot; -lt &quot;25&quot; ]; then
</ins><span class="cx">     return 1;
</span><span class="cx">   fi;
</span><span class="cx">   return 0;
</span><span class="lines">@@ -49,30 +61,20 @@
</span><span class="cx"> # Detect which version of Python to use, then print out which one was detected.
</span><span class="cx"> #
</span><span class="cx"> # This will prefer the python interpreter in the PYTHON environment variable.
</span><del>-# If that's not found, it will check for &quot;python2.7&quot;, &quot;python2.6&quot; and &quot;python&quot;,
-# looking for each in your PATH and, failing that, in a number of well-known
-# locations.
</del><ins>+# If that's not found, it will check for &quot;python2.7&quot; and &quot;python&quot;, looking for
+# each in your PATH.
</ins><span class="cx"> #
</span><span class="cx"> detect_python_version () {
</span><span class="cx">   local v;
</span><span class="cx">   local p;
</span><del>-  for v in &quot;2.7&quot; &quot;2.6&quot; &quot;&quot;
</del><ins>+  for v in &quot;2.7&quot; &quot;&quot;
</ins><span class="cx">   do
</span><del>-    for p in                                                            \
-      &quot;${PYTHON:=}&quot;                                                     \
-      &quot;python${v}&quot;                                                      \
-      &quot;/usr/local/bin/python${v}&quot;                                       \
-      &quot;/usr/local/python/bin/python${v}&quot;                                \
-      &quot;/usr/local/python${v}/bin/python${v}&quot;                            \
-      &quot;/opt/bin/python${v}&quot;                                             \
-      &quot;/opt/python/bin/python${v}&quot;                                      \
-      &quot;/opt/python${v}/bin/python${v}&quot;                                  \
-      &quot;/Library/Frameworks/Python.framework/Versions/${v}/bin/python&quot;   \
-      &quot;/opt/local/bin/python${v}&quot;                                       \
-      &quot;/sw/bin/python${v}&quot;                                              \
</del><ins>+    for p in         \
+      &quot;${PYTHON:=}&quot;  \
+      &quot;python${v}&quot;   \
</ins><span class="cx">       ;
</span><span class="cx">     do
</span><del>-      if p=&quot;$(type -p &quot;${p}&quot;)&quot;; then
</del><ins>+      if p=&quot;$(find_cmd &quot;${p}&quot;)&quot;; then
</ins><span class="cx">         if try_python &quot;${p}&quot;; then
</span><span class="cx">           echo &quot;${p}&quot;;
</span><span class="cx">           return 0;
</span><span class="lines">@@ -148,7 +150,7 @@
</span><span class="cx">   # the part of the PostgreSQL build process which builds pl_python.  Note that
</span><span class="cx">   # detect_python_version, above, already honors $PYTHON, so if this is already
</span><span class="cx">   # set it won't be stomped on, it will just be re-set to the same value.
</span><del>-  export PYTHON=&quot;$(type -p ${bootstrap_python})&quot;;
</del><ins>+  export PYTHON=&quot;$(find_cmd ${bootstrap_python})&quot;;
</ins><span class="cx"> 
</span><span class="cx">   if [ -z &quot;${bootstrap_python:-}&quot; ]; then
</span><span class="cx">     echo &quot;No suitable python found. Python 2.6 or 2.7 is required.&quot;;
</span></span></pre>
</div>
</div>

</body>
</html>