<!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>[12439] CalendarServer/trunk</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/12439">12439</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2014-01-23 17:46:22 -0800 (Thu, 23 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>New build tools.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkgitignore">CalendarServer/trunk/.gitignore</a></li>
<li><a href="#CalendarServertrunkbintrial">CalendarServer/trunk/bin/trial</a></li>
<li><a href="#CalendarServertrunkbintwistd">CalendarServer/trunk/bin/twistd</a></li>
<li><a href="#CalendarServertrunksetuppy">CalendarServer/trunk/setup.py</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#CalendarServertrunkbin_buildsh">CalendarServer/trunk/bin/_build.sh</a></li>
<li><a href="#CalendarServertrunkbin_pysh">CalendarServer/trunk/bin/_py.sh</a></li>
<li><a href="#CalendarServertrunkbindevelop">CalendarServer/trunk/bin/develop</a></li>
<li><a href="#CalendarServertrunkbinpyflakes">CalendarServer/trunk/bin/pyflakes</a></li>
<li><a href="#CalendarServertrunkbinpython">CalendarServer/trunk/bin/python</a></li>
<li><a href="#CalendarServertrunkbinupdate_copyrights">CalendarServer/trunk/bin/update_copyrights</a></li>
<li>CalendarServer/trunk/requirements/</li>
<li><a href="#CalendarServertrunkrequirementsbasetxt">CalendarServer/trunk/requirements/base.txt</a></li>
<li><a href="#CalendarServertrunkrequirementsdeveloptxt">CalendarServer/trunk/requirements/develop.txt</a></li>
<li><a href="#CalendarServertrunkrequirementsopt_LDAPtxt">CalendarServer/trunk/requirements/opt_LDAP.txt</a></li>
<li><a href="#CalendarServertrunkrequirementsopt_Oracletxt">CalendarServer/trunk/requirements/opt_Oracle.txt</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#CalendarServertrunkpydoctor">CalendarServer/trunk/pydoctor</a></li>
<li><a href="#CalendarServertrunkpyflakes">CalendarServer/trunk/pyflakes</a></li>
<li><a href="#CalendarServertrunkpython">CalendarServer/trunk/python</a></li>
<li><a href="#CalendarServertrunksupportupdate_copyrights">CalendarServer/trunk/support/update_copyrights</a></li>
<li><a href="#CalendarServertrunksupportversionpy">CalendarServer/trunk/support/version.py</a></li>
<li><a href="#CalendarServertrunktest">CalendarServer/trunk/test</a></li>
<li><a href="#CalendarServertrunktestserver">CalendarServer/trunk/testserver</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkgitignore"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/.gitignore (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/.gitignore        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/.gitignore        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,3 +1,4 @@
</span><ins>+*.egg-info
</ins><span class="cx"> *.pyc
</span><span class="cx"> *.so
</span><span class="cx"> dropin.cache
</span><span class="lines">@@ -2,5 +3,6 @@
</span><span class="cx"> 
</span><ins>+/.develop/
</ins><span class="cx"> /build/
</span><span class="cx"> /data/
</span><span class="cx"> /calendarserver/version.py
</span><del>-/conf/caldavd-dev.plist
</del><span class="cx">\ No newline at end of file
</span><ins>+/conf/caldavd-dev.plist
</ins></span></pre></div>
<a id="CalendarServertrunkbin_buildsh"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/_build.sh (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/_build.sh                                (rev 0)
+++ CalendarServer/trunk/bin/_build.sh        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1,586 @@
</span><ins>+# -*- sh-basic-offset: 2 -*-
+##
+# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+. &quot;${wd}/bin/_py.sh&quot;;
+
+
+echo_header () {
+  echo &quot;$@&quot;;
+  echo &quot;&quot;;
+}
+
+
+using_system () {
+  local name=&quot;$1&quot;; shift;
+  echo_header &quot;Using system version of ${name}.&quot;;
+}
+
+
+# Provide a default value: if the variable named by the first argument is
+# empty, set it to the default in the second argument.
+conditional_set () {
+  local var=&quot;$1&quot;; shift;
+  local default=&quot;$1&quot;; shift;
+  if [ -z &quot;$(eval echo &quot;\${${var}:-}&quot;)&quot; ]; then
+    eval &quot;${var}=\${default:-}&quot;;
+  fi;
+}
+
+
+# Checks for presence of a C header, optionally with a version comparison.
+# With only a header file name, try to include it, returning nonzero if absent.
+# With 3 params, also attempt a version check, returning nonzero if too old.
+# Param 2 is a minimum acceptable version number
+# Param 3 is a #define from the source that holds the installed version number
+# Examples:
+#   Assert that ldap.h is present
+#     find_header &quot;ldap.h&quot;
+#   Assert that ldap.h is present with a version &gt;= 20344
+#     find_header &quot;ldap.h&quot; 20344 &quot;LDAP_VENDOR_VERSION&quot;
+find_header () {
+  local sys_header=&quot;$1&quot;; shift;
+  if [ $# -ge 1 ]; then
+      local   min_version=&quot;$1&quot;; shift;
+      local version_macro=&quot;$1&quot;; shift;
+  fi;
+
+  # No min_version given:
+  # Check for presence of a header. We use the &quot;-c&quot; cc option because we don't
+  # need to emit a file; cc exits nonzero if it can't find the header
+  if [ -z &quot;${min_version:-}&quot; ]; then
+    echo &quot;#include &lt;${sys_header}&gt;&quot; | cc -x c -c - -o /dev/null 2&gt; /dev/null;
+    return &quot;$?&quot;;
+  fi;
+
+  # Check for presence of a header of specified version
+  local found_version=&quot;$(printf &quot;#include &lt;${sys_header}&gt;\n${version_macro}\n&quot; | cc -x c -E - | tail -1)&quot;;
+
+  if [ &quot;${found_version}&quot; == &quot;${version_macro}&quot; ]; then
+    # Macro was not replaced
+    return 1;
+  fi;
+
+  if cmp_version &quot;${min_version}&quot; &quot;${found_version}&quot;; then
+    return 0;
+  else
+    return 1;
+  fi;
+};
+
+
+# Initialize all the global state required to use this library.
+init_build () {
+  init_py;
+
+       do_get=&quot;true&quot;;
+     do_setup=&quot;true&quot;;
+  force_setup=&quot;false&quot;;
+
+      dev_home=&quot;${wd}/.develop&quot;;
+      dev_root=&quot;${dev_home}/root&quot;;
+    dev_libdir=&quot;${dev_root}/lib/python&quot;;
+    dev_bindir=&quot;${dev_root}/bin&quot;;
+  dep_packages=&quot;${dev_home}/pkg&quot;;
+   dep_sources=&quot;${dev_home}/src&quot;;
+
+  mkdir -p &quot;${dep_sources}&quot;;
+
+  # Set up virtual environment
+
+  &quot;${bootstrap_python}&quot; -m virtualenv &quot;${dev_root}&quot;;
+
+  python=&quot;${dev_bindir}/python&quot;;
+
+  # These variables are defaults for things which might be configured by
+  # environment; only set them if they're un-set.
+
+  conditional_set wd &quot;$(pwd)&quot;;
+
+  # Find some hashing commands
+  # sha1() = sha1 hash, if available
+  # md5()  = md5 hash, if available
+  # hash() = default hash function
+  # $hash  = name of the type of hash used by hash()
+
+  hash=&quot;&quot;;
+
+  if type -ft openssl &gt; /dev/null; then
+    if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
+    md5 () { &quot;$(type -p openssl)&quot; dgst -md5 &quot;$@&quot;; }
+  elif type -ft md5 &gt; /dev/null; then
+    if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
+    md5 () { &quot;$(type -p md5)&quot; &quot;$@&quot;; }
+  elif type -ft md5sum &gt; /dev/null; then
+    if [ -z &quot;${hash}&quot; ]; then hash=&quot;md5&quot;; fi;
+    md5 () { &quot;$(type -p md5sum)&quot; &quot;$@&quot;; }
+  fi;
+
+  if type -ft sha1sum &gt; /dev/null; then
+    if [ -z &quot;${hash}&quot; ]; then hash=&quot;sha1sum&quot;; fi;
+    sha1 () { &quot;$(type -p sha1sum)&quot; &quot;$@&quot;; }
+  fi;
+  if type -ft shasum &gt; /dev/null; then
+    if [ -z &quot;${hash}&quot; ]; then hash=&quot;sha1&quot;; fi;
+    sha1 () { &quot;$(type -p shasum)&quot; &quot;$@&quot;; }
+  fi;
+
+  if [ &quot;${hash}&quot; == &quot;sha1&quot; ]; then
+    hash () { sha1 &quot;$@&quot;; }
+  elif [ &quot;${hash}&quot; == &quot;md5&quot; ]; then
+    hash () { md5 &quot;$@&quot;; }
+  elif type -t cksum &gt; /dev/null; then
+    hash=&quot;hash&quot;;
+    hash () { cksum &quot;$@&quot; | cut -f 1 -d &quot; &quot;; }
+  elif type -t sum &gt; /dev/null; then
+    hash=&quot;hash&quot;;
+    hash () { sum &quot;$@&quot; | cut -f 1 -d &quot; &quot;; }
+  else
+    hash () { echo &quot;INTERNAL ERROR: No hash function.&quot;; exit 1; }
+  fi;
+}
+
+
+# If do_get is turned on, get an archive file containing a dependency via HTTP.
+www_get () {
+  if ! &quot;${do_get}&quot;; then return 0; fi;
+
+  local  md5=&quot;&quot;;
+  local sha1=&quot;&quot;;
+
+  OPTIND=1;
+  while getopts &quot;m:s:&quot; option; do
+    case &quot;${option}&quot; in
+      'm')  md5=&quot;${OPTARG}&quot;; ;;
+      's') sha1=&quot;${OPTARG}&quot;; ;;
+    esac;
+  done;
+  shift $((${OPTIND} - 1));
+
+  local name=&quot;$1&quot;; shift;
+  local path=&quot;$1&quot;; shift;
+  local  url=&quot;$1&quot;; shift;
+
+  if &quot;${force_setup}&quot; || [ ! -d &quot;${path}&quot; ]; then
+    local ext=&quot;$(echo &quot;${url}&quot; | sed 's|^.*\.\([^.]*\)$|\1|')&quot;;
+
+    untar () { tar -xvf -; }
+    unzipstream () { tmp=&quot;$(mktemp -t ccsXXXXX)&quot;; cat &gt; &quot;${tmp}&quot;; unzip &quot;${tmp}&quot;; rm &quot;${tmp}&quot;; }
+    case &quot;${ext}&quot; in
+      gz|tgz) decompress=&quot;gzip -d -c&quot;; unpack=&quot;untar&quot;; ;;
+      bz2)    decompress=&quot;bzip2 -d -c&quot;; unpack=&quot;untar&quot;; ;;
+      tar)    decompress=&quot;untar&quot;; unpack=&quot;untar&quot;; ;;
+      zip)    decompress=&quot;cat&quot;; unpack=&quot;unzipstream&quot;; ;;
+      *)
+        echo &quot;Error in www_get of URL ${url}: Unknown extension ${ext}&quot;;
+        exit 1;
+        ;;
+    esac;
+
+    echo &quot;&quot;;
+
+    if [ -n &quot;${dep_packages}&quot; ] &amp;&amp; [ -n &quot;${hash}&quot; ]; then
+      mkdir -p &quot;${dep_packages}&quot;;
+
+      local cache_basename=&quot;$(echo ${name} | tr '[ ]' '_')-$(echo &quot;${url}&quot; | hash)-$(basename &quot;${url}&quot;)&quot;;
+      local cache_file=&quot;${dep_packages}/${cache_basename}&quot;;
+
+      check_hash () {
+        local file=&quot;$1&quot;; shift;
+
+        local sum=&quot;$(md5 &quot;${file}&quot; | perl -pe 's|^.*([0-9a-f]{32}).*$|\1|')&quot;;
+        if [ -n &quot;${md5}&quot; ]; then
+          echo &quot;Checking MD5 sum for ${name}...&quot;;
+          if [ &quot;${md5}&quot; != &quot;${sum}&quot; ]; then
+            echo &quot;ERROR: MD5 sum for downloaded file is wrong: ${sum} != ${md5}&quot;;
+            return 1;
+          fi;
+        else
+          echo &quot;MD5 sum for ${name} is ${sum}&quot;;
+        fi;
+
+        local sum=&quot;$(sha1 &quot;${file}&quot; | perl -pe 's|^.*([0-9a-f]{40}).*$|\1|')&quot;;
+        if [ -n &quot;${sha1}&quot; ]; then
+          echo &quot;Checking SHA1 sum for ${name}...&quot;;
+          if [ &quot;${sha1}&quot; != &quot;${sum}&quot; ]; then
+            echo &quot;ERROR: SHA1 sum for downloaded file is wrong: ${sum} != ${sha1}&quot;;
+            return 1;
+          fi;
+        else
+          echo &quot;SHA1 sum for ${name} is ${sum}&quot;;
+        fi;
+      }
+
+      if [ ! -f &quot;${cache_file}&quot; ]; then
+        echo &quot;No cache file: ${cache_file}&quot;;
+
+        echo &quot;Downloading ${name}...&quot;;
+
+        local pkg_host=&quot;static.calendarserver.org&quot;;
+        local pkg_path=&quot;/pkg&quot;;
+
+        #
+        # Try getting a copy from calendarserver.org.
+        #
+        local tmp=&quot;$(mktemp &quot;/tmp/${cache_basename}.XXXXXX&quot;)&quot;;
+        curl -L &quot;http://${pkg_host}${pkg_path}/${cache_basename}&quot; -o &quot;${tmp}&quot; || true;
+        echo &quot;&quot;;
+        if [ ! -s &quot;${tmp}&quot; ] || grep '&lt;title&gt;404 Not Found&lt;/title&gt;' &quot;${tmp}&quot; &gt; /dev/null; then
+          rm -f &quot;${tmp}&quot;;
+          echo &quot;${name} is not available from calendarserver.org; trying upstream source.&quot;;
+        elif ! check_hash &quot;${tmp}&quot;; then
+          rm -f &quot;${tmp}&quot;;
+          echo &quot;${name} from calendarserver.org is invalid; trying upstream source.&quot;;
+        fi;
+
+        #
+        # That didn't work. Try getting a copy from the upstream source.
+        #
+        if [ ! -f &quot;${tmp}&quot; ]; then
+          curl -L &quot;${url}&quot; -o &quot;${tmp}&quot;;
+          echo &quot;&quot;;
+
+          if [ ! -s &quot;${tmp}&quot; ] || grep '&lt;title&gt;404 Not Found&lt;/title&gt;' &quot;${tmp}&quot; &gt; /dev/null; then
+            rm -f &quot;${tmp}&quot;;
+            echo &quot;${name} is not available from upstream source: ${url}&quot;;
+            exit 1;
+          elif ! check_hash &quot;${tmp}&quot;; then
+            rm -f &quot;${tmp}&quot;;
+            echo &quot;${name} from upstream source is invalid: ${url}&quot;;
+            exit 1;
+          fi;
+
+          if egrep &quot;^${pkg_host}&quot; &quot;${HOME}/.ssh/known_hosts&quot; &gt; /dev/null 2&gt;&amp;1; then
+            echo &quot;Copying cache file up to ${pkg_host}.&quot;;
+            if ! scp &quot;${tmp}&quot; &quot;${pkg_host}:/var/www/static${pkg_path}/${cache_basename}&quot;; then
+              echo &quot;Failed to copy cache file up to ${pkg_host}.&quot;;
+            fi;
+            echo &quot;&quot;
+          fi;
+        fi;
+
+        #
+        # OK, we should be good
+        #
+        mv &quot;${tmp}&quot; &quot;${cache_file}&quot;;
+      else
+        #
+        # We have the file cached, just verify hash
+        #
+        if ! check_hash &quot;${cache_file}&quot;; then
+          exit 1;
+        fi;
+      fi;
+
+      echo &quot;Unpacking ${name} from cache...&quot;;
+      get () { cat &quot;${cache_file}&quot;; }
+    else
+      echo &quot;Downloading ${name}...&quot;;
+      get () { curl -L &quot;${url}&quot;; }
+    fi;
+
+    rm -rf &quot;${path}&quot;;
+    cd &quot;$(dirname &quot;${path}&quot;)&quot;;
+    get | ${decompress} | ${unpack};
+    cd /;
+  fi;
+}
+
+
+# If do_get is turned on, check a name out from SVN.
+svn_get () {
+  if ! &quot;${do_get}&quot;; then
+    return 0;
+  fi;
+
+  local     name=&quot;$1&quot;; shift;
+  local     path=&quot;$1&quot;; shift;
+  local      uri=&quot;$1&quot;; shift;
+  local revision=&quot;$1&quot;; shift;
+
+  if [ -d &quot;${path}&quot; ]; then
+    local wc_uri=&quot;$(svn info --xml &quot;${path}&quot; 2&gt; /dev/null | sed -n 's|^.*&lt;url&gt;\(.*\)&lt;/url&gt;.*$|\1|p')&quot;;
+
+    if &quot;${force_setup}&quot;; then
+      # Verify that we have a working copy checked out from the correct URI
+      if [ &quot;${wc_uri}&quot; != &quot;${uri}&quot; ]; then
+        echo &quot;Current working copy (${path}) is from the wrong URI: ${wc_uri} != ${uri}&quot;;
+        rm -rf &quot;${path}&quot;;
+        svn_get &quot;${name}&quot; &quot;${path}&quot; &quot;${uri}&quot; &quot;${revision}&quot;;
+        return $?;
+      fi;
+
+      echo &quot;Reverting ${name}...&quot;;
+      svn revert -R &quot;${path}&quot;;
+
+      echo &quot;Updating ${name}...&quot;;
+      svn update -r &quot;${revision}&quot; &quot;${path}&quot;;
+    else
+      # Verify that we have a working copy checked out from the correct URI
+      if [ &quot;${wc_uri}&quot; != &quot;${uri}&quot; ]; then
+        echo &quot;Current working copy (${path}) is from the wrong URI: ${wc_uri} != ${uri}&quot;;
+        echo &quot;Performing repository switch for ${name}...&quot;;
+        svn switch -r &quot;${revision}&quot; &quot;${uri}&quot; &quot;${path}&quot;;
+      else
+        local svnversion=&quot;$(svnversion &quot;${path}&quot;)&quot;;
+        if [ &quot;${svnversion%%[M:]*}&quot; != &quot;${revision}&quot; ]; then
+          echo &quot;Updating ${name}...&quot;;
+          svn update -r &quot;${revision}&quot; &quot;${path}&quot;;
+        fi;
+      fi;
+    fi;
+  else
+    checkout () {
+      echo &quot;Checking out ${name}...&quot;;
+      svn checkout -r &quot;${revision}&quot; &quot;${uri}@${revision}&quot; &quot;${path}&quot;;
+    }
+
+    if [ &quot;${revision}&quot; != &quot;HEAD&quot; ] &amp;&amp; \
+       [ -n &quot;${dep_packages}&quot; ] &amp;&amp; \
+       [ -n &quot;${hash}&quot; ] \
+    ; then
+      local cacheid=&quot;${name}-$(echo &quot;${uri}&quot; | hash)&quot;;
+      local cache_file=&quot;${dep_packages}/${cacheid}@r${revision}.tgz&quot;;
+
+      mkdir -p &quot;${dep_packages}&quot;;
+
+      if [ -f &quot;${cache_file}&quot; ]; then
+        echo &quot;Unpacking ${name} from cache...&quot;;
+        mkdir -p &quot;${path}&quot;;
+        tar -C &quot;${path}&quot; -xvzf &quot;${cache_file}&quot;;
+      else
+        checkout;
+        echo &quot;Caching ${name}...&quot;;
+        tar -C &quot;${path}&quot; -cvzf &quot;${cache_file}&quot; .;
+      fi;
+    else
+      checkout;
+    fi;
+  fi;
+}
+
+
+# Run 'make' with the given command line, prepending a -j option appropriate to
+# the number of CPUs on the current machine, if that can be determined.
+jmake () {
+  case &quot;$(uname -s)&quot; in
+    Darwin|Linux)
+      ncpu=&quot;$(getconf _NPROCESSORS_ONLN)&quot;;
+      ;;
+    FreeBSD)
+      ncpu=&quot;$(sysctl hw.ncpu)&quot;;
+      ncpu=&quot;${ncpu##hw.ncpu: }&quot;;
+      ;;
+  esac;
+
+  if [ -n &quot;${ncpu:-}&quot; ] &amp;&amp; [[ &quot;${ncpu}&quot; =~ ^[0-9]+$ ]]; then
+    make -j &quot;${ncpu}&quot; &quot;$@&quot;;
+  else
+    make &quot;$@&quot;;
+  fi;
+}
+
+# Declare a dependency on a C project built with autotools.
+c_dependency () {
+  local f_hash=&quot;&quot;;
+
+  OPTIND=1;
+  while getopts &quot;m:s:&quot; option; do
+    case &quot;${option}&quot; in
+      'm') f_hash=&quot;-m ${OPTARG}&quot;; ;;
+      's') f_hash=&quot;-s ${OPTARG}&quot;; ;;
+    esac;
+  done;
+  shift $((${OPTIND} - 1));
+
+  local name=&quot;$1&quot;; shift;
+  local path=&quot;$1&quot;; shift;
+  local  uri=&quot;$1&quot;; shift;
+
+  # Extra arguments are processed below, as arguments to './configure'.
+
+  srcdir=&quot;${dep_sources}/${path}&quot;;
+  # local dstroot=&quot;${srcdir}/_root&quot;;
+  local dstroot=&quot;${dev_root}&quot;;
+
+  www_get ${f_hash} &quot;${name}&quot; &quot;${srcdir}&quot; &quot;${uri}&quot;;
+
+  export              PATH=&quot;${dstroot}/bin:${PATH}&quot;;
+  export    C_INCLUDE_PATH=&quot;${dstroot}/include:${C_INCLUDE_PATH:-}&quot;;
+  export   LD_LIBRARY_PATH=&quot;${dstroot}/lib:${dstroot}/lib64:${LD_LIBRARY_PATH:-}&quot;;
+  export          CPPFLAGS=&quot;-I${dstroot}/include ${CPPFLAGS:-} &quot;;
+  export           LDFLAGS=&quot;-L${dstroot}/lib -L${dstroot}/lib64 ${LDFLAGS:-} &quot;;
+  export DYLD_LIBRARY_PATH=&quot;${dstroot}/lib:${dstroot}/lib64:${DYLD_LIBRARY_PATH:-}&quot;;
+  export PKG_CONFIG_PATH=&quot;${dstroot}/lib/pkgconfig:${PKG_CONFIG_PATH:-}&quot;;
+
+  if &quot;${do_setup}&quot;; then
+    if &quot;${force_setup}&quot; || [ ! -d &quot;${dstroot}&quot; ]; then
+      echo &quot;Building ${name}...&quot;;
+      cd &quot;${srcdir}&quot;;
+      ./configure --prefix=&quot;${dstroot}&quot; &quot;$@&quot;;
+      jmake;
+      jmake install;
+    else
+      echo &quot;Using built ${name}.&quot;;
+      echo &quot;&quot;;
+    fi;
+  fi;
+}
+
+
+ruler () {
+  echo &quot;____________________________________________________________&quot;;
+  echo &quot;&quot;;
+
+  if [ $# -gt 0 ]; then
+    echo &quot;$@&quot;;
+  fi;
+}
+
+
+
+#
+# Build C dependencies
+#
+c_dependencies () {
+
+  ruler;
+  if find_header ldap.h 20428 LDAP_VENDOR_VERSION; then
+    using_system &quot;OpenLDAP&quot;;
+  else
+    local v=&quot;2.4.38&quot;;
+    local n=&quot;openldap&quot;;
+    local p=&quot;${n}-${v}&quot;;
+    c_dependency -m &quot;39831848c731bcaef235a04e0d14412f&quot; \
+      &quot;OpenLDAP&quot; &quot;${p}&quot; \
+      &quot;http://www.openldap.org/software/download/OpenLDAP/${n}-release/${p}.tgz&quot; \
+      --disable-bdb --disable-hdb;
+  fi;
+
+  ruler;
+  if find_header sasl/sasl.h &amp;&amp; ! find_header sasl.h; then
+    mkdir -p &quot;${dev_root}/include&quot;;
+    echo &quot;#include &lt;sasl/sasl.h&gt;&quot; &gt; &quot;${dev_root}/include/sasl.h&quot;
+    using_system &quot;SASL&quot;;
+  elif find_header sasl.h; then
+    using_system &quot;SASL&quot;;
+  else
+    local v=&quot;2.1.26&quot;;
+    local n=&quot;cyrus-sasl&quot;;
+    local p=&quot;${n}-${v}&quot;;
+    c_dependency -m &quot;a7f4e5e559a0e37b3ffc438c9456e425&quot; \
+      &quot;Cyrus SASL&quot; &quot;${p}&quot; \
+      &quot;ftp://ftp.cyrusimap.org/cyrus-sasl/${p}.tar.gz&quot; \
+      --disable-macos-framework;
+  fi;
+
+  ruler;
+  if find_header ffi/ffi.h; then
+    using_system &quot;libffi&quot;;
+  else
+    c_dependency -m &quot;45f3b6dbc9ee7c7dfbbbc5feba571529&quot; \
+      &quot;libffi&quot; &quot;libffi-3.0.13&quot; \
+      &quot;ftp://sourceware.org/pub/libffi/libffi-3.0.13.tar.gz&quot;
+  fi;
+
+  ruler;
+  if type -P memcached &gt; /dev/null; then
+    using_system &quot;memcached&quot;;
+  else
+    local le=&quot;libevent-2.0.21-stable&quot;;
+    local mc=&quot;memcached-1.4.16&quot;;
+    c_dependency -m &quot;b2405cc9ebf264aa47ff615d9de527a2&quot; \
+      &quot;libevent&quot; &quot;${le}&quot; \
+      &quot;http://github.com/downloads/libevent/libevent/${le}.tar.gz&quot;;
+    c_dependency -m &quot;1c5781fecb52d70b615c6d0c9c140c9c&quot; \
+      &quot;memcached&quot; &quot;${mc}&quot; \
+      &quot;http://www.memcached.org/files/${mc}.tar.gz&quot;;
+  fi;
+
+  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;
+
+}
+
+
+#
+# Build Python dependencies
+#
+py_dependencies () {
+  # export PYTHONPATH=&quot;${dev_libdir}:${PYTHONPATH:-}&quot;
+
+  # export              PATH=&quot;${dev_root}/bin:${PATH}&quot;;
+  # export    C_INCLUDE_PATH=&quot;${dev_root}/include:${C_INCLUDE_PATH:-}&quot;;
+  # export   LD_LIBRARY_PATH=&quot;${dev_root}/lib:${dev_root}/lib64:${LD_LIBRARY_PATH:-}&quot;;
+  # export          CPPFLAGS=&quot;-I${dev_root}/include ${CPPFLAGS:-} &quot;;
+  # export           LDFLAGS=&quot;-L${dev_root}/lib -L${dev_root}/lib64 ${LDFLAGS:-} &quot;;
+  # export DYLD_LIBRARY_PATH=&quot;${dev_root}/lib:${dev_root}/lib64:${DYLD_LIBRARY_PATH:-}&quot;;
+  # export PKG_CONFIG_PATH=&quot;${dev_root}/lib/pkgconfig:${PKG_CONFIG_PATH:-}&quot;;
+
+  # cd &quot;${wd}&quot;;
+
+  for requirements in &quot;${wd}/requirements/&quot;*; do
+
+    ruler &quot;Preparing Python requirements: ${requirements}&quot;;
+    echo &quot;&quot;;
+
+    if ! &quot;${python}&quot; -m pip install               \
+        --requirement &quot;${requirements}&quot;           \
+        --download-cache &quot;${dev_home}/pip_cache&quot;  \
+        --log &quot;${dev_home}/pip.log&quot;               \
+    ; then
+      err=$?;
+      echo &quot;Unable to set up Python requirements: ${requirements}&quot;;
+      if [ &quot;${requirements#${wd}/requirements/opt_}&quot; != &quot;${requirements}&quot; ]; then
+        echo &quot;Requirements ${requirements} are optional; continuing.&quot;;
+      else
+        echo &quot;&quot;;
+        exit ${err};
+      fi;
+    fi;
+
+  done;
+
+  echo &quot;&quot;;
+}
+
+
+
+#
+# Set up for development
+#
+develop () {
+  init_build;
+  c_dependencies;
+  py_dependencies;
+}
</ins></span></pre></div>
<a id="CalendarServertrunkbin_pysh"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/_py.sh (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/_py.sh                                (rev 0)
+++ CalendarServer/trunk/bin/_py.sh        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1,157 @@
</span><ins>+# -*- sh-basic-offset: 2 -*-
+##
+# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+# Echo the major.minor version of the given Python interpreter.
+
+py_version () {
+  local python=&quot;$1&quot;; shift;
+  echo &quot;$(&quot;${python}&quot; -c &quot;from distutils.sysconfig import get_python_version; print get_python_version()&quot;)&quot;;
+}
+
+#
+# Test if a particular python interpreter is available, given the full path to
+# that interpreter.
+#
+try_python () {
+  local python=&quot;$1&quot;; shift;
+
+  if [ -z &quot;${python}&quot; ]; then
+    return 1;
+  fi;
+
+  if ! type &quot;${python}&quot; &gt; /dev/null 2&gt;&amp;1; then
+    return 1;
+  fi;
+
+  local py_version=&quot;$(py_version &quot;${python}&quot;)&quot;;
+  if [ &quot;${py_version/./}&quot; -lt &quot;25&quot; ]; then
+    return 1;
+  fi;
+  return 0;
+}
+
+
+#
+# Detect which version of Python to use, then print out which one was detected.
+#
+# This will prefer the python interpreter in the PYTHON environment variable.
+# 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.
+#
+detect_python_version () {
+  local v;
+  local p;
+  for v in &quot;2.7&quot; &quot;2.6&quot; &quot;&quot;
+  do
+    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;                                              \
+      ;
+    do
+      if p=&quot;$(type -p &quot;${p}&quot;)&quot;; then
+        if try_python &quot;${p}&quot;; then
+          echo &quot;${p}&quot;;
+          return 0;
+        fi;
+      fi;
+    done;
+  done;
+  return 1;
+}
+
+
+#
+# Compare version numbers
+#
+cmp_version () {
+  local  v=&quot;$1&quot;; shift;
+  local mv=&quot;$1&quot;; shift;
+
+  local vh;
+  local mvh;
+  local result;
+
+  while true; do
+     vh=&quot;${v%%.*}&quot;; # Get highest-order segment
+    mvh=&quot;${mv%%.*}&quot;;
+
+    if [ &quot;${vh}&quot; -gt &quot;${mvh}&quot; ]; then
+      result=1;
+      break;
+    fi;
+
+    if [ &quot;${vh}&quot; -lt &quot;${mvh}&quot; ]; then
+      result=0;
+      break;
+    fi;
+
+    if [ &quot;${v}&quot; == &quot;${v#*.}&quot; ]; then
+      # No dots left, so we're ok
+      result=0;
+      break;
+    fi;
+
+    if [ &quot;${mv}&quot; == &quot;${mv#*.}&quot; ]; then
+      # No dots left, so we're not gonna match
+      result=1;
+      break;
+    fi;
+
+     v=&quot;${v#*.}&quot;;
+    mv=&quot;${mv#*.}&quot;;
+  done;
+
+  return ${result};
+}
+
+
+#
+# Detect which python to use, and store it in the 'python' variable, as well as
+# setting up variables related to version and build configuration.
+#
+init_py () {
+  # First, detect the appropriate version of Python to use, based on our version
+  # requirements and the environment.  Note that all invocations of python in
+  # our build scripts should therefore be '&quot;${python}&quot;', not 'python'; this is
+  # important on systems with older system pythons (2.4 or earlier) with an
+  # alternate install of Python, or alternate python installation mechanisms
+  # like virtualenv.
+  bootstrap_python=&quot;$(detect_python_version)&quot;;
+
+  # Set the $PYTHON environment variable to an absolute path pointing at the
+  # appropriate python executable, a standard-ish mechanism used by certain
+  # non-distutils things that need to find the &quot;right&quot; python.  For instance,
+  # the part of the PostgreSQL build process which builds pl_python.  Note that
+  # detect_python_version, above, already honors $PYTHON, so if this is already
+  # set it won't be stomped on, it will just be re-set to the same value.
+  export PYTHON=&quot;$(type -p ${bootstrap_python})&quot;;
+
+  if [ -z &quot;${bootstrap_python:-}&quot; ]; then
+    echo &quot;No suitable python found. Python 2.6 or 2.7 is required.&quot;;
+    exit 1;
+  fi;
+}
</ins></span></pre></div>
<a id="CalendarServertrunkbindevelop"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/develop (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/develop                                (rev 0)
+++ CalendarServer/trunk/bin/develop        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+#!/bin/sh
+
+##
+# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+set -e;
+set -u;
+
+if [ -z &quot;${wd:-}&quot; ]; then
+  wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)/..&quot; &amp;&amp; pwd)&quot;;
+fi;
+
+export CALENDARSERVER_DEVELOP=&quot;true&quot;;
+
+. &quot;${wd}/bin/_build.sh&quot;;
+
+develop;
</ins><span class="cx">Property changes on: CalendarServer/trunk/bin/develop
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="CalendarServertrunkbinpyflakes"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/pyflakes (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/pyflakes                                (rev 0)
+++ CalendarServer/trunk/bin/pyflakes        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+#!/bin/sh
+
+##
+# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+set -e;
+set -u;
+
+wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)/..&quot; &amp;&amp; pwd -L)&quot;;
+
+export CALENDARSERVER_DEVELOP=&quot;true&quot;;
+
+. &quot;${wd}/bin/_build.sh&quot;;
+
+init_build &gt; /dev/null;
+
+if [ $# -eq 0 ]; then
+  set - calendarserver contrib twisted twistedcaldav txdav txweb2;
+fi;
+
+&quot;${python}&quot; -m pip install pyflakes --upgrade &gt;&gt; &quot;${dev_home}/setup.log&quot;;
+
+echo &quot;Checking modules:&quot; &quot;$@&quot;;
+exec &quot;${python}&quot; -m pyflakes &quot;$@&quot;;
</ins><span class="cx">Property changes on: CalendarServer/trunk/bin/pyflakes
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="CalendarServertrunkbinpython"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/python (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/python                                (rev 0)
+++ CalendarServer/trunk/bin/python        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+#!/bin/sh
+
+##
+# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+set -e
+set -u
+
+wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)/..&quot; &amp;&amp; pwd)&quot;;
+
+export CALENDARSERVER_DEVELOP=&quot;true&quot;;
+
+. &quot;${wd}/bin/_build.sh&quot;;
+
+init_build &gt; /dev/null;
+c_dependencies &gt;&gt; &quot;${dev_home}/setup.log&quot;;
+py_dependencies &gt;&gt; &quot;${dev_home}/setup.log&quot;;
+
+exec &quot;${python}&quot; &quot;$@&quot;;
</ins><span class="cx">Property changes on: CalendarServer/trunk/bin/python
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="CalendarServertrunkbintrial"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/bin/trial (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/trial        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/bin/trial        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,13 +1,13 @@
</span><del>-#!/usr/bin/env python
</del><ins>+#!/bin/sh
</ins><span class="cx"> 
</span><span class="cx"> ##
</span><del>-# Copyright (c) 2006-2014 Apple Inc. All rights reserved.
</del><ins>+# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
</span><span class="cx"> # you may not use this file except in compliance with the License.
</span><span class="cx"> # You may obtain a copy of the License at
</span><span class="cx"> #
</span><del>-# http://www.apache.org/licenses/LICENSE-2.0
</del><ins>+#     http://www.apache.org/licenses/LICENSE-2.0
</ins><span class="cx"> #
</span><span class="cx"> # Unless required by applicable law or agreed to in writing, software
</span><span class="cx"> # distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
</span><span class="lines">@@ -16,24 +16,17 @@
</span><span class="cx"> # limitations under the License.
</span><span class="cx"> ##
</span><span class="cx"> 
</span><del>-from __future__ import print_function
</del><ins>+set -e
+set -u
</ins><span class="cx"> 
</span><del>-import sys
-import os
</del><ins>+wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)/..&quot; &amp;&amp; pwd)&quot;;
</ins><span class="cx"> 
</span><del>-#PYTHONPATH
</del><ins>+export CALENDARSERVER_DEVELOP=&quot;true&quot;;
</ins><span class="cx"> 
</span><del>-if __name__ == &quot;__main__&quot;:
-    if &quot;PYTHONPATH&quot; in globals():
-        sys.path.insert(0, PYTHONPATH)
-    else:
-        try:
-            import _calendarserver_preamble
-        except ImportError:
-            sys.exc_clear()
</del><ins>+. &quot;${wd}/bin/_build.sh&quot;;
</ins><span class="cx"> 
</span><del>-    for name, value in os.environ.items():
-        print(&quot;{0}={1}&quot;.format(name, value))
</del><ins>+init_build &gt; /dev/null;
+c_dependencies &gt;&gt; &quot;${dev_home}/setup.log&quot;;
+py_dependencies &gt;&gt; &quot;${dev_home}/setup.log&quot;;
</ins><span class="cx"> 
</span><del>-    from twisted.scripts.trial import run
-    run()
</del><ins>+exec &quot;${dev_bindir}/trial&quot; &quot;$@&quot;;
</ins></span></pre></div>
<a id="CalendarServertrunkbintwistd"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/bin/twistd (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/twistd        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/bin/twistd        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,13 +1,13 @@
</span><del>-#!/usr/bin/env python
</del><ins>+#!/bin/sh
</ins><span class="cx"> 
</span><span class="cx"> ##
</span><del>-# Copyright (c) 2006-2014 Apple Inc. All rights reserved.
</del><ins>+# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
</ins><span class="cx"> #
</span><span class="cx"> # Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
</span><span class="cx"> # you may not use this file except in compliance with the License.
</span><span class="cx"> # You may obtain a copy of the License at
</span><span class="cx"> #
</span><del>-# http://www.apache.org/licenses/LICENSE-2.0
</del><ins>+#     http://www.apache.org/licenses/LICENSE-2.0
</ins><span class="cx"> #
</span><span class="cx"> # Unless required by applicable law or agreed to in writing, software
</span><span class="cx"> # distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
</span><span class="lines">@@ -16,18 +16,17 @@
</span><span class="cx"> # limitations under the License.
</span><span class="cx"> ##
</span><span class="cx"> 
</span><del>-import sys
</del><ins>+set -e
+set -u
</ins><span class="cx"> 
</span><del>-#PYTHONPATH
</del><ins>+wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)/..&quot; &amp;&amp; pwd)&quot;;
</ins><span class="cx"> 
</span><del>-if __name__ == &quot;__main__&quot;:
-    if &quot;PYTHONPATH&quot; in globals():
-        sys.path.insert(0, PYTHONPATH)
-    else:
-        try:
-            import _calendarserver_preamble
-        except ImportError:
-            sys.exc_clear()
</del><ins>+export CALENDARSERVER_DEVELOP=&quot;true&quot;;
</ins><span class="cx"> 
</span><del>-    from twisted.scripts.twistd import run
-    run()
</del><ins>+. &quot;${wd}/bin/_build.sh&quot;;
+
+init_build &gt; /dev/null;
+c_dependencies &gt;&gt; &quot;${dev_home}/setup.log&quot;;
+py_dependencies &gt;&gt; &quot;${dev_home}/setup.log&quot;;
+
+exec &quot;${dev_bindir}/twistd&quot; &quot;$@&quot;;
</ins></span></pre></div>
<a id="CalendarServertrunkbinupdate_copyrights"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/bin/update_copyrights (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/bin/update_copyrights                                (rev 0)
+++ CalendarServer/trunk/bin/update_copyrights        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+#!/bin/sh
+# -*- sh-basic-offset: 2 -*-
+
+##
+# Copyright (c) 2013 Apple Inc. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+##
+
+set -e;
+set -u;
+
+find_files () {
+  where=&quot;$1&quot;; shift;
+
+  find &quot;${where}&quot;               \
+    ! \(                        \
+      -type d                   \
+      \(                        \
+        -name .svn -o           \
+        -name build -o          \
+        -name data -o          \
+        -name '_trial_temp*'    \
+      \)                        \
+      -prune                    \
+    \)                          \
+    -type f                     \
+    ! -name '.#*'               \
+    ! -name '#*#'               \
+    ! -name '*~'                \
+    ! -name '*.pyc'             \
+    ! -name '*.log'             \
+    ! -name update_copyrights   \
+    -print0;
+}
+
+wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)/..&quot; &amp;&amp; pwd)&quot;;
+
+this_year=&quot;$(date &quot;+%Y&quot;)&quot;;
+last_year=$((${this_year} - 1));
+
+tmp=&quot;$(mktemp -t &quot;$$&quot;)&quot;;
+find_files &quot;${wd}&quot; &gt; &quot;${tmp}&quot;;
+
+ff () { cat &quot;${tmp}&quot;; }
+
+echo &quot;Updating copyrights from ${last_year} to ${this_year}...&quot;;
+
+ff | xargs -0 perl -i -pe 's|(Copyright \(c\) .*-)'&quot;${last_year}&quot;'( Apple)|${1}'&quot;${this_year}&quot;'${2}|';
+ff | xargs -0 perl -i -pe 's|(Copyright \(c\) )'&quot;${last_year}&quot;'( Apple)|${1}'&quot;${last_year}-${this_year}&quot;'${2}|';
+
+ff | xargs -0 grep -e 'Copyright (c) .* Apple' \
+  | grep -v -e 'Copyright (c) .*'&quot;${this_year}&quot;' Apple' \
+  ;
+
+rm &quot;${tmp}&quot;;
</ins><span class="cx">Property changes on: CalendarServer/trunk/bin/update_copyrights
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="CalendarServertrunkpydoctor"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/pydoctor (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/pydoctor        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/pydoctor        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,31 +0,0 @@
</span><del>-#!/bin/sh
-
-##
-# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-set -e
-set -u
-
-wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)&quot; &amp;&amp; pwd -P)&quot;;
-
-. &quot;${wd}/support/build.sh&quot;;
-
-do_setup=&quot;false&quot;;
-  do_get=&quot;false&quot;;
-
-dependencies;
-
-pydoctor &quot;$@&quot;;
</del></span></pre></div>
<a id="CalendarServertrunkpyflakes"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/pyflakes (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/pyflakes        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/pyflakes        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,30 +0,0 @@
</span><del>-#!/bin/sh
-
-set -e
-set -u
-
-wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)&quot; &amp;&amp; pwd)&quot;;
-
-if type -P pyflakes &gt; /dev/null; then
-    pyflakes=&quot;pyflakes&quot;;
-else
-    flakes=&quot;$(cd &quot;${wd}/../pyflakes-0.6.1&quot; &amp;&amp; pwd)&quot;;
-    export PYTHONPATH=&quot;${flakes}:${PYTHONPATH:-}&quot;;
-    pyflakes=&quot;${flakes}/bin/pyflakes&quot;;
-fi;
-
-if [ $# -eq 0 ]; then
-  set - calendarserver twisted twistedcaldav txdav contrib;
-fi;
-
-tmp=&quot;$(mktemp &quot;/tmp/pyflakes.XXXXX&quot;)&quot;;
-
-cd &quot;${wd}&quot; &amp;&amp; &quot;${pyflakes}&quot; &quot;$@&quot; | sed  \
-  -e &quot;/xmlext.py:[0-9][0-9]*: /d&quot;       \
-  | tee &quot;${tmp}&quot;;
-
-if [ -s &quot;${tmp}&quot; ]; then error=&quot;true&quot;; else error=&quot;false&quot;; fi;
-
-rm -f &quot;${tmp}&quot;;
-
-if &quot;${error}&quot;; then exit 1; fi;
</del></span></pre></div>
<a id="CalendarServertrunkpython"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/python (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/python        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/python        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,8 +0,0 @@
</span><del>-#!/usr/bin/env bash
-
-wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)&quot; &amp;&amp; pwd)&quot;;
-
-. &quot;${wd}/support/shell.sh&quot;
-
-exec &quot;${python}&quot; &quot;$@&quot;;
-
</del></span></pre></div>
<a id="CalendarServertrunkrequirementsbasetxt"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/requirements/base.txt (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements/base.txt                                (rev 0)
+++ CalendarServer/trunk/requirements/base.txt        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+zope.interface==4.0.5
+twisted==13.2.0
+-e svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk#egg=twextpy [DAL]
+
+# Twisted &lt;3's SSL
+pyOpenSSL==0.12
+pycrypto==2.6.1
+pyasn1==0.1.7
+
+-e svn+http://svn.calendarserver.org/repository/calendarserver/PyKerberos/trunk#egg=kerberos
+
+# Data store
+xattr==0.6.4
+PyGreSQL==4.1.1
+sqlparse==0.1.2
+
+# Calendar
+python-dateutil==1.5
+pytz==2013.8
+-e svn+http://svn.calendarserver.org/repository/calendarserver/PyCalendar/trunk#egg=pycalendar
+
+# Process info
+psutil==1.2.0
+setproctitle==1.1.8
+
+# pycparser==2.10
</ins><span class="cx">Property changes on: CalendarServer/trunk/requirements/base.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="CalendarServertrunkrequirementsdeveloptxt"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/requirements/develop.txt (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements/develop.txt                                (rev 0)
+++ CalendarServer/trunk/requirements/develop.txt        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+docutils&gt;=0.11
</ins><span class="cx">Property changes on: CalendarServer/trunk/requirements/develop.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="CalendarServertrunkrequirementsopt_LDAPtxt"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/requirements/opt_LDAP.txt (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements/opt_LDAP.txt                                (rev 0)
+++ CalendarServer/trunk/requirements/opt_LDAP.txt        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+-e svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk#egg=twextpy [LDAP]
</ins><span class="cx">Property changes on: CalendarServer/trunk/requirements/opt_LDAP.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="CalendarServertrunkrequirementsopt_Oracletxt"></a>
<div class="addfile"><h4>Added: CalendarServer/trunk/requirements/opt_Oracle.txt (0 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements/opt_Oracle.txt                                (rev 0)
+++ CalendarServer/trunk/requirements/opt_Oracle.txt        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+-e svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk#egg=twextpy [Oracle]
</ins><span class="cx">Property changes on: CalendarServer/trunk/requirements/opt_Oracle.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="CalendarServertrunksetuppy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/setup.py (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/setup.py        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/setup.py        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -18,101 +18,189 @@
</span><span class="cx"> 
</span><span class="cx"> from __future__ import print_function
</span><span class="cx"> 
</span><del>-import sys
-import os
</del><ins>+import errno
+from os import listdir, environ as environment
+from os.path import dirname, basename, abspath, join as joinpath, normpath
+from itertools import chain
+import subprocess
+from setuptools import setup, find_packages as setuptools_find_packages
+from pip.req import parse_requirements
</ins><span class="cx"> 
</span><del>-sys.path.insert(0, os.path.join(os.path.dirname(__file__), &quot;support&quot;))
</del><span class="cx"> 
</span><del>-from version import version
</del><span class="cx"> 
</span><ins>+#
+# Utilities
+#
</ins><span class="cx"> 
</span><del>-
</del><span class="cx"> def find_packages():
</span><span class="cx">     modules = [
</span><span class="cx">         &quot;twisted.plugins&quot;,
</span><span class="cx">     ]
</span><span class="cx"> 
</span><del>-    excludes = [
-        &quot;.svn&quot;,
-        &quot;_trial_temp&quot;,
-        &quot;build&quot;,
-    ]
</del><ins>+    return modules + setuptools_find_packages()
</ins><span class="cx"> 
</span><del>-    for root, dirs, files in os.walk(&quot;.&quot;):
-        if root == &quot;.&quot;:
-            excludes.append(&quot;data&quot;)
</del><span class="cx"> 
</span><del>-        for exclude in excludes:
-            if exclude in dirs:
-                dirs.remove(exclude)
</del><ins>+def version():
+    &quot;&quot;&quot;
+    Compute the version number.
+    &quot;&quot;&quot;
</ins><span class="cx"> 
</span><del>-        if &quot;__init__.py&quot; in files:
-            modules.append(&quot;.&quot;.join(root.split(os.path.sep)[1:]))
</del><ins>+    base_version = &quot;6.0&quot;
</ins><span class="cx"> 
</span><del>-    return modules
</del><ins>+    branches = tuple(
+        branch.format(
+            project=&quot;twext&quot;,
+            version=base_version,
+        )
+        for branch in (
+            &quot;tags/release/{project}-{version}&quot;,
+            &quot;branches/release/{project}-{version}-dev&quot;,
+            &quot;trunk&quot;,
+        )
+    )
</ins><span class="cx"> 
</span><ins>+    source_root = dirname(abspath(__file__))
</ins><span class="cx"> 
</span><ins>+    for branch in branches:
+        cmd = [&quot;svnversion&quot;, &quot;-n&quot;, source_root, branch]
+
+        try:
+            svn_revision = subprocess.check_output(cmd)
+
+        except OSError as e:
+            if e.errno == errno.ENOENT:
+                full_version = base_version + &quot;-unknown&quot;
+                break
+            raise
+
+        if &quot;S&quot; in svn_revision:
+            continue
+
+        full_version = base_version
+
+        if branch == &quot;trunk&quot;:
+            full_version += &quot;b.trunk&quot;
+        elif branch.endswith(&quot;-dev&quot;):
+            full_version += &quot;c.dev&quot;
+
+        if svn_revision in (&quot;exported&quot;, &quot;Unversioned directory&quot;):
+            full_version += &quot;-unknown&quot;
+        else:
+            full_version += &quot;-r{revision}&quot;.format(revision=svn_revision)
+
+        break
+    else:
+        full_version += &quot;a.unknown&quot;
+        full_version += &quot;-r{revision}&quot;.format(revision=svn_revision)
+
+    return full_version
+
+
+
</ins><span class="cx"> #
</span><span class="cx"> # Options
</span><span class="cx"> #
</span><span class="cx"> 
</span><del>-description = &quot;Calendar and Contacts Server&quot;,
-long_description = &quot;&quot;&quot;
-Calendar and Contacts Server, implementing the CalDAV and CardDAV protocols.
-&quot;&quot;&quot;
</del><ins>+description = &quot;Calendar and Contacts Server&quot;
</ins><span class="cx"> 
</span><del>-classifiers = None
</del><ins>+long_description = file(joinpath(dirname(__file__), &quot;README.rst&quot;)).read()
</ins><span class="cx"> 
</span><ins>+classifiers = [
+    &quot;Development Status :: 5 - Production/Stable&quot;,
+    &quot;Framework :: Twisted&quot;,
+    &quot;Intended Audience :: Information Technology&quot;,
+    &quot;License :: OSI Approved :: Apache Software License&quot;,
+    &quot;Operating System :: OS Independent&quot;,
+    &quot;Programming Language :: Python :: 2.7&quot;,
+    &quot;Programming Language :: Python :: 2 :: Only&quot;,
+    &quot;Topic :: Communications&quot;,
+    &quot;Topic :: Internet :: WWW/HTTP :: HTTP Servers&quot;,
+    &quot;Topic :: Office/Business :: Groupware&quot;,
+    &quot;Topic :: Office/Business :: Scheduling&quot;,
+]
</ins><span class="cx"> 
</span><ins>+
+
</ins><span class="cx"> #
</span><del>-# Write version file
</del><ins>+# Dependencies
</ins><span class="cx"> #
</span><span class="cx"> 
</span><del>-version_number, version_info = version()
</del><ins>+requirements_dir = joinpath(dirname(__file__), &quot;requirements&quot;)
</ins><span class="cx"> 
</span><del>-version_string = (
-    &quot;{number} ({info})&quot;
-    .format(number=version_number, info=version_info)
</del><ins>+
+def read_requirements(reqs_filename):
+    return [
+        str(r.req) for r in
+        parse_requirements(joinpath(requirements_dir, reqs_filename))
+    ]
+
+
+setup_requirements = []
+
+install_requirements = read_requirements(&quot;base.txt&quot;)
+
+extras_requirements = dict(
+    (reqs_filename[4:-4], read_requirements(reqs_filename))
+    for reqs_filename in listdir(requirements_dir)
+    if reqs_filename.startswith(&quot;opt_&quot;) and reqs_filename.endswith(&quot;.txt&quot;)
</ins><span class="cx"> )
</span><del>-version_file = file(os.path.join(&quot;calendarserver&quot;, &quot;version.py&quot;), &quot;w&quot;)
-version_file.write('version = &quot;{version}&quot;\n'.format(version=version_string))
-version_file.close()
</del><span class="cx"> 
</span><ins>+# Requirements for development and testing
+develop_requirements = read_requirements(&quot;develop.txt&quot;)
</ins><span class="cx"> 
</span><ins>+if environment.get(&quot;CALENDARSERVER_DEVELOP&quot;, &quot;false&quot;) == &quot;true&quot;:
+    install_requirements.extend(develop_requirements)
+    install_requirements.extend(chain(*extras_requirements.values()))
+
+
+
</ins><span class="cx"> #
</span><span class="cx"> # Set up Extension modules that need to be built
</span><span class="cx"> #
</span><span class="cx"> 
</span><del>-from distutils.core import Extension
-
</del><span class="cx"> extensions = []
</span><span class="cx"> 
</span><del>-if sys.platform == &quot;darwin&quot;:
-    extensions.append(
-        Extension(
-            &quot;calendarserver.platform.darwin._sacl&quot;,
-            extra_link_args=[&quot;-framework&quot;, &quot;Security&quot;],
-            sources=[&quot;calendarserver/platform/darwin/_sacl.c&quot;]
-        )
-    )
</del><ins>+# if sys.platform == &quot;darwin&quot;:
+#     extensions.append(
+#         Extension(
+#             &quot;calendarserver.platform.darwin._sacl&quot;,
+#             extra_link_args=[&quot;-framework&quot;, &quot;Security&quot;],
+#             sources=[&quot;calendarserver/platform/darwin/_sacl.c&quot;]
+#         )
+#     )
</ins><span class="cx"> 
</span><span class="cx"> 
</span><ins>+
</ins><span class="cx"> #
</span><span class="cx"> # Run setup
</span><span class="cx"> #
</span><span class="cx"> 
</span><span class="cx"> def doSetup():
</span><del>-    from distutils.core import setup
</del><ins>+    # Write version file
+    version_string = version()
+    version_filename = joinpath(
+        dirname(__file__), &quot;calendarserver&quot;, &quot;version.py&quot;
+    )
+    version_file = file(version_filename, &quot;w&quot;)
+    try:
+        version_file.write(
+            'version = &quot;{0}&quot;\n\n'.format(version_string)
+        )
+    finally:
+        version_file.close()
</ins><span class="cx"> 
</span><ins>+
+
+
</ins><span class="cx">     dist = setup(
</span><del>-        name=&quot;Calendar and Contacts Server&quot;,
</del><ins>+        name=&quot;CalendarServer&quot;,
</ins><span class="cx">         version=version_string,
</span><span class="cx">         description=description,
</span><span class="cx">         long_description=long_description,
</span><span class="cx">         url=&quot;http://www.calendarserver.org/&quot;,
</span><span class="cx">         classifiers=classifiers,
</span><span class="cx">         author=&quot;Apple Inc.&quot;,
</span><del>-        author_email=None,
</del><ins>+        author_email=&quot;calendarserver-dev@lists.macosforge.org&quot;,
</ins><span class="cx">         license=&quot;Apache License, Version 2.0&quot;,
</span><span class="cx">         platforms=[&quot;all&quot;],
</span><span class="cx">         packages=find_packages(),
</span><span class="lines">@@ -161,29 +249,32 @@
</span><span class="cx">             &quot;bin/calendarserver_upgrade&quot;,
</span><span class="cx">             # &quot;bin/calendarserver_verify_data&quot;,
</span><span class="cx">         ],
</span><del>-        data_files=[(&quot;caldavd&quot;, [&quot;conf/caldavd.plist&quot;]), ],
</del><ins>+        data_files=[
+            (&quot;caldavd&quot;, [&quot;conf/caldavd.plist&quot;]),
+        ],
</ins><span class="cx">         ext_modules=extensions,
</span><span class="cx">         py_modules=[],
</span><ins>+        setup_requires=setup_requirements,
+        install_requires=install_requirements,
+        extras_require=extras_requirements,
</ins><span class="cx">     )
</span><span class="cx"> 
</span><span class="cx">     if &quot;install&quot; in dist.commands:
</span><span class="cx">         install_obj = dist.command_obj[&quot;install&quot;]
</span><span class="cx">         if install_obj.root is None:
</span><span class="cx">             return
</span><del>-        install_scripts = os.path.normpath(install_obj.install_scripts)
-        install_lib = os.path.normpath(install_obj.install_lib)
-        root = os.path.normpath(install_obj.root)
-        base = os.path.normpath(install_obj.install_base)
</del><ins>+        install_scripts = normpath(install_obj.install_scripts)
+        install_lib = normpath(install_obj.install_lib)
+        root = normpath(install_obj.root)
+        base = normpath(install_obj.install_base)
</ins><span class="cx"> 
</span><span class="cx">         if root:
</span><span class="cx">             install_lib = install_lib[len(root):]
</span><span class="cx"> 
</span><span class="cx">         for script in dist.scripts:
</span><del>-            scriptPath = os.path.join(
-                install_scripts, os.path.basename(script)
-            )
</del><ins>+            scriptPath = joinpath(install_scripts, basename(script))
</ins><span class="cx"> 
</span><del>-            print(&quot;rewriting {0}&quot;.format(scriptPath))
</del><ins>+            print(&quot;Rewriting {0}&quot;.format(scriptPath))
</ins><span class="cx"> 
</span><span class="cx">             script = []
</span><span class="cx"> 
</span><span class="lines">@@ -207,7 +298,7 @@
</span><span class="cx">                     elif line == &quot;#PATH&quot;:
</span><span class="cx">                         script.append(
</span><span class="cx">                             'PATH=&quot;{add}:$PATH&quot;'
</span><del>-                            .format(add=os.path.join(base, &quot;usr&quot;, &quot;bin&quot;))
</del><ins>+                            .format(add=joinpath(base, &quot;usr&quot;, &quot;bin&quot;))
</ins><span class="cx">                         )
</span><span class="cx">                     else:
</span><span class="cx">                         script.append(line)
</span><span class="lines">@@ -221,7 +312,7 @@
</span><span class="cx">                     elif line == &quot;#PATH&quot;:
</span><span class="cx">                         script.append(
</span><span class="cx">                             'PATH=&quot;{path}&quot;'
</span><del>-                            .format(path=os.path.join(base, &quot;usr&quot;, &quot;bin&quot;))
</del><ins>+                            .format(path=joinpath(base, &quot;usr&quot;, &quot;bin&quot;))
</ins><span class="cx">                         )
</span><span class="cx">                     else:
</span><span class="cx">                         script.append(line)
</span></span></pre></div>
<a id="CalendarServertrunksupportupdate_copyrights"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/support/update_copyrights (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/support/update_copyrights        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/support/update_copyrights        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,66 +0,0 @@
</span><del>-#!/bin/sh
-# -*- sh-basic-offset: 2 -*-
-
-##
-# Copyright (c) 2013 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-set -e;
-set -u;
-
-find_files () {
-  where=&quot;$1&quot;; shift;
-
-  find &quot;${where}&quot;               \
-    ! \(                        \
-      -type d                   \
-      \(                        \
-        -name .svn -o           \
-        -name build -o          \
-        -name data -o          \
-        -name '_trial_temp*'    \
-      \)                        \
-      -prune                    \
-    \)                          \
-    -type f                     \
-    ! -name '.#*'               \
-    ! -name '#*#'               \
-    ! -name '*~'                \
-    ! -name '*.pyc'             \
-    ! -name '*.log'             \
-    ! -name update_copyrights   \
-    -print0;
-}
-
-wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)/..&quot; &amp;&amp; pwd)&quot;;
-
-this_year=&quot;$(date &quot;+%Y&quot;)&quot;;
-last_year=$((${this_year} - 1));
-
-tmp=&quot;$(mktemp -t &quot;$$&quot;)&quot;;
-find_files &quot;${wd}&quot; &gt; &quot;${tmp}&quot;;
-
-ff () { cat &quot;${tmp}&quot;; }
-
-echo &quot;Updating copyrights from ${last_year} to ${this_year}...&quot;;
-
-ff | xargs -0 perl -i -pe 's|(Copyright \(c\) .*-)'&quot;${last_year}&quot;'( Apple)|${1}'&quot;${this_year}&quot;'${2}|';
-ff | xargs -0 perl -i -pe 's|(Copyright \(c\) )'&quot;${last_year}&quot;'( Apple)|${1}'&quot;${last_year}-${this_year}&quot;'${2}|';
-
-ff | xargs -0 grep -e 'Copyright (c) .* Apple' \
-  | grep -v -e 'Copyright (c) .*'&quot;${this_year}&quot;' Apple' \
-  ;
-
-rm &quot;${tmp}&quot;;
</del></span></pre></div>
<a id="CalendarServertrunksupportversionpy"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/support/version.py (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/support/version.py        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/support/version.py        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,71 +0,0 @@
</span><del>-#!/usr/bin/env python
-
-##
-# Copyright (c) 2006-2014 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-from __future__ import print_function
-
-import os
-from os.path import dirname
-import subprocess
-
-def version():
-    #
-    # Compute the version number.
-    #
-
-    base_version = &quot;6.0&quot;
-
-    branches = tuple(
-        branch.format(version=base_version)
-        for branch in (
-            &quot;tags/release/CalendarServer-{version}&quot;,
-            &quot;branches/release/CalendarServer-{version}-dev&quot;,
-            &quot;trunk&quot;,
-        )
-    )
-
-    source_root = dirname(dirname(__file__))
-
-    for branch in branches:
-        svn_revision = subprocess.check_output([&quot;svnversion&quot;, &quot;-n&quot;, source_root, branch])
-
-        if &quot;S&quot; in svn_revision:
-            continue
-
-        if branch == &quot;trunk&quot;:
-            base_version += &quot;-trunk&quot;
-        elif branch.endswith(&quot;-dev&quot;):
-            base_version += &quot;-dev&quot;
-
-        if svn_revision in (&quot;exported&quot;, &quot;Unversioned directory&quot;):
-            if os.environ.get(&quot;RC_XBS&quot;, None) == &quot;YES&quot;:
-                xbs_version = os.environ.get(&quot;RC_ProjectSourceVersion&quot;, &quot;?&quot;)
-                comment = &quot;Apple Calendar Server {version}&quot;.format(version=xbs_version)
-            else:
-                comment = &quot;unknown&quot;
-        else:
-            comment = &quot;r{revision}&quot;.format(revision=svn_revision)
-
-        break
-    else:
-        base_version += &quot;-unknown&quot;
-        comment = &quot;r{revision}&quot;.format(revision=svn_revision)
-
-    return (base_version, comment)
-
-if __name__ == &quot;__main__&quot;:
-    base_version, comment = version()
-    print(&quot;{version} ({comment})&quot;.format(version=base_version, comment=comment))
</del></span></pre></div>
<a id="CalendarServertrunktest"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/test (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/test        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/test        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,151 +0,0 @@
</span><del>-#!/usr/bin/env bash
-
-##
-# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-set -e;
-set -u;
-
-wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)&quot; &amp;&amp; pwd -L)&quot;;
-
-##
-# Options
-##
-
-do_setup=&quot;false&quot;;
-do_get=&quot;false&quot;;
-
-random=&quot;--random=$(date &quot;+%s&quot;)&quot;;
-no_colour=&quot;&quot;;
-until_fail=&quot;&quot;;
-coverage=&quot;&quot;;
-m_twisted=&quot;&quot;;
-numjobs=&quot;&quot;;
-reactor=&quot;&quot;;
-
-if [ &quot;$(uname -s)&quot; == &quot;Darwin&quot; ]; then
-  reactor=&quot;--reactor=kqueue&quot;;
-fi;
-
-usage ()
-{
-  program=&quot;$(basename &quot;$0&quot;)&quot;;
-
-  if [ &quot;${1--}&quot; != &quot;-&quot; ]; then echo &quot;$@&quot;; echo; fi;
-
-  echo &quot;Usage: ${program} [options]&quot;;
-  echo &quot;Options:&quot;;
-  echo &quot;        -h  Print this help and exit&quot;;
-  echo &quot;        -n  Do not use color&quot;;
-  echo &quot;        -o  Do not run tests in random order.&quot;;
-  echo &quot;        -r&lt;num&gt;  Use specified seed to determine order.&quot;;
-  echo &quot;        -u  Run until the tests fail.&quot;;
-  echo &quot;        -c  Generate coverage reports.&quot;;
-
-  if [ &quot;${1-}&quot; == &quot;-&quot; ]; then return 0; fi;
-  exit 64;
-}
-
-while getopts &quot;nhoucr:j:&quot; option; do
-  case &quot;${option}&quot; in
-    '?') usage; ;;
-    'h') usage -; exit 0; ;;
-    'o')     random=&quot;&quot;; ;;
-    'r')     random=&quot;--random=$OPTARG&quot;; ;;
-    'n')  no_colour=&quot;--reporter=bwverbose&quot;; ;;
-    'u') until_fail=&quot;--until-failure&quot;; ;;
-    'c')   coverage=&quot;--coverage&quot;; ;;
-    't')  m_twisted=&quot;twisted&quot;; ;;
-    'j')    numjobs=&quot;-j $OPTARG&quot;; ;;
-  esac;
-done;
-shift $((${OPTIND} - 1));
-
-export PYTHONPATH=&quot;${wd}:${PYTHONPATH:-}&quot;;
-
-if [ $# -gt 0 ]; then
-  test_modules=&quot;$@&quot;;
-  flaky=true;
-else
-  test_modules=&quot;calendarserver twistedcaldav txdav contrib ${m_twisted}&quot;;
-  flaky=true;
-fi;
-
-
-##
-# Clean up
-##
-
-find &quot;${wd}&quot; -name \*.pyc -print0 | xargs -0 rm;
-
-
-##
-# Unit tests
-##
-
-mkdir -p &quot;${wd}/data&quot;;
-cd &quot;${wd}&quot; &amp;&amp; &quot;${wd}/bin/trial&quot; --temp-directory=&quot;${wd}/data/trial&quot; --rterrors ${reactor} ${random} ${until_fail} ${no_colour} ${coverage} ${numjobs} ${test_modules};
-
-
-##
-# Code linting
-##
-
-if ${flaky}; then
-  echo &quot;&quot;;
-  echo &quot;Running pyflakes...&quot;;
-  tmp=&quot;$(mktemp &quot;/tmp/calendarserver_test_flakes.XXXXX&quot;)&quot;;
-  cd &quot;${wd}&quot; &amp;&amp; ./pyflakes ${test_modules} | tee &quot;${tmp}&quot; 2&gt;&amp;1;
-  if [ -s &quot;${tmp}&quot; ]; then
-    echo &quot;**** Pyflakes says you have some code to clean up. ****&quot;;
-    exit 1;
-  fi;
-  rm -f &quot;${tmp}&quot;;
-fi;
-
-search_py ()
-{
-  find . \
-    ! '(' -type d '(' -path '*/.*' -or -name data ')' -prune ')' \
-    -type f -name '*.py' \
-    -print0 \
-    | xargs -0 -n 100 grep &quot;$@&quot;;
-}
-
-#tmp=&quot;$(mktemp &quot;/tmp/calendarserver_test_flakish.XXXXX&quot;)&quot;;
-#echo &quot;&quot;;
-#echo &quot;Checking for legacy print statements...&quot;
-#search_py 'print  *[^(]' | sed 's|#.*||' | grep 'print  *[^(]' &gt; &quot;${tmp}&quot; || true;
-#if [ -s &quot;${tmp}&quot; ]; then
-#    echo &quot;**** Use of legacy print statement found. ****&quot;;
-#    cat &quot;${tmp}&quot;;
-#    exit 1;
-#fi;
-#rm -f &quot;${tmp}&quot;;
-
-
-##
-# Empty files
-##
-
-tmp=&quot;$(mktemp &quot;/tmp/calendarserver_test_emtpy.XXXXX&quot;)&quot;;
-find &quot;${wd}&quot; '!' '(' -type d '(' -path '*/.*' -or -name data ')' -prune ')' -type f -size 0 &gt; &quot;${tmp}&quot;;
-if [ -s &quot;${tmp}&quot; ]; then
-    echo &quot;**** Empty files: ****&quot;;
-    cat &quot;${tmp}&quot;;
-    exit 1;
-fi;
-rm -f &quot;${tmp}&quot;;
</del></span></pre></div>
<a id="CalendarServertrunktestserver"></a>
<div class="delfile"><h4>Deleted: CalendarServer/trunk/testserver (12438 => 12439)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/testserver        2014-01-24 01:43:49 UTC (rev 12438)
+++ CalendarServer/trunk/testserver        2014-01-24 01:46:22 UTC (rev 12439)
</span><span class="lines">@@ -1,81 +0,0 @@
</span><del>-#!/usr/bin/env bash
-
-##
-# Copyright (c) 2005-2014 Apple Inc. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-##
-
-wd=&quot;$(cd &quot;$(dirname &quot;$0&quot;)&quot; &amp;&amp; pwd)&quot;;
-cdt=&quot;${wd}/../CalDAVTester&quot;;
-
-##
-# Command line handling
-##
-
-verbose=&quot;&quot;;
-serverinfo=&quot;${cdt}/scripts/server/serverinfo.xml&quot;;
-printres=&quot;&quot;;
-subdir=&quot;&quot;;
-random=&quot;--random&quot;;
-seed=&quot;&quot;;
-ssl=&quot;&quot;;
-
-usage ()
-{
-  program=&quot;$(basename &quot;$0&quot;)&quot;;
-  echo &quot;Usage: ${program} [-v] [-s serverinfo]&quot;;
-  echo &quot;Options:&quot;;
-  echo &quot;        -d  Set the script subdirectory&quot;;
-  echo &quot;        -h  Print this help and exit&quot;;
-  echo &quot;        -o  Execute tests in order&quot;;
-  echo &quot;        -r  Print request and response&quot;;
-  echo &quot;        -s  Set the serverinfo.xml&quot;;
-  echo &quot;        -t  Set the CalDAVTester directory&quot;;
-  echo &quot;        -x  Random seed to use.&quot;;
-  echo &quot;        -v  Verbose.&quot;;
-  echo &quot;        -z  Use SSL.&quot;;
-
-  if [ &quot;${1-}&quot; == &quot;-&quot; ]; then return 0; fi;
-  exit 64;
-}
-
-while getopts 'hvrozt:s:d:x:' option; do
-  case &quot;$option&quot; in 
-    '?') usage; ;;
-    'h') usage -; exit 0; ;;
-    't') cdt=&quot;${OPTARG}&quot;; serverinfo=&quot;${OPTARG}/scripts/server/serverinfo.xml&quot;; ;;
-    'd') subdir=&quot;--subdir=${OPTARG}&quot;; ;;
-    's') serverinfo=&quot;${OPTARG}&quot;; ;;
-    'r') printres=&quot;--always-print-request --always-print-response&quot;; ;;
-    'v') verbose=&quot;v&quot;; ;;
-    'o') random=&quot;&quot;; ;;
-    'x') seed=&quot;--random-seed ${OPTARG}&quot;; ;;
-    'z') ssl=&quot;--ssl&quot;; ;;
-  esac;
-done;
-
-shift $((${OPTIND} - 1));
-
-if [ $# == 0 ]; then
-  set - &quot;--all&quot;;
-fi;
-
-##
-# Do The Right Thing
-##
-
-source &quot;${wd}/support/shell.sh&quot;;
-
-cd &quot;${cdt}&quot; &amp;&amp; &quot;${python}&quot; testcaldav.py ${random} ${seed} ${ssl} --print-details-onfail ${printres} -s &quot;${serverinfo}&quot; ${subdir} &quot;$@&quot;;
-
</del></span></pre>
</div>
</div>

</body>
</html>