From 8d98b4104a7c8ff068c10e33aade524027ff75cd Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Thu, 10 Nov 2011 11:43:20 -0800 Subject: [PATCH 1/2] Check for virtualenv collisions. Warn if folders exist. Reject if a conflict will occur. --- bin/compile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index ecb9109..e03fc08 100755 --- a/bin/compile +++ b/bin/compile @@ -33,6 +33,18 @@ if [ "$NAME" = "Python" ]; then [ -f manage.py ] && [ -f settings.py ] && { echo " ! Django app must be in a package subdirectory"; exit 1; } fi +# warn a checked-in virtualenv +if [ -d "lib" ] || [ -d "bin" ]; then + echo " ! You have a virtualenv checked in. You should ignore the appropriate paths in your repo. See http://devcenter.heroku.com/articles/gitignore for more info."; +fi + +# reject a conflicting checked-in virtualenv +if [ -f "lib/python2.7" ]; then + echo " ! Checked-in virtualenv conflict." + exit 1; +fi + + # copy artifacts out of cache if exists mkdir -p $CACHE_DIR for dir in $VIRTUALENV_DIRS; do @@ -49,7 +61,7 @@ if [ "$NAME" = "Python/Django" ]; then SETTINGS_FILE=$(ls **/settings.py | head -1) PROJECT=$(dirname $SETTINGS_FILE) echo "Injecting code into $SETTINGS_FILE to read from DATABASE_URL" | indent - + cat >>$SETTINGS_FILE < Date: Fri, 11 Nov 2011 10:46:46 -0800 Subject: [PATCH 2/2] pylibmc --- bin/compile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/compile b/bin/compile index e03fc08..889c4df 100755 --- a/bin/compile +++ b/bin/compile @@ -11,6 +11,7 @@ CACHE_DIR=$2 NAME=$($BIN_DIR/detect $BUILD_DIR) PIP_DOWNLOAD_CACHE=${PIP_DOWNLOAD_CACHE:-$CACHE_DIR/pip_downloads} VIRTUALENV_DIRS="bin include lib" +VENDORED_MEMCACHED="http://cl.ly/0a191R3K160t1w1P0N25/vendor-libmemcached.tar.gz" indent() { RE="s/^/ /" @@ -54,6 +55,19 @@ done echo "-----> Preparing virtualenv version $(virtualenv --version)" virtualenv --no-site-packages . | indent + +# if pylibmc within requirements, use vendored libmemcached +if grep -Fxq "pylibmc" requirements.txt +then + echo "-----> Noticed pylibmc. Bootstrapping libmemcached." + curl -O $VENDORED_MEMCACHED + tar -zxvf vendor-libmemcached.tar.gz + ls +fi + + + + # if Django, append settings if [ "$NAME" = "Python/Django" ]; then echo "-----> Django settings injection"