Skip to content

Commit

Permalink
much better
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Reitz committed Jan 3, 2013
1 parent 9177aa2 commit 0ff4df4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
2 changes: 1 addition & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ set -e
source $BIN_DIR/steps/pylibmc

# Install Mercurial if it appears to be required.
if (in-req "hg+" requirements.txt) then
if (grep -Fiq "hg+" requirements.txt) then
pip install --use-mirrors mercurial | cleanup | indent
fi

Expand Down
2 changes: 1 addition & 1 deletion bin/steps/pylibmc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ VENDORED_MEMCACHED="http://cl.ly/0a191R3K160t1w1P0N25/vendor-libmemcached.tar.gz
source $BIN_DIR/utils

# If pylibmc exists within requirements, use vendored libmemcached.
if (in-req "pylibmc" requirements.txt) then
if (grep -Fiq "pylibmc" requirements.txt) then
echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
cd .heroku

Expand Down
22 changes: 0 additions & 22 deletions bin/utils
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,3 @@ function deep-mv (){
rm -fr $1/!(tmp)
find -H $1 -maxdepth 1 -name '.*' -a \( -type d -o -type f -o -type l \) -exec rm -fr '{}' \;
}

# Recursively finds requirements.txt files
function list-req (){
echo $@
for req in $(grep -Fie "-r " $@ | sed 's/-r //g')
do
path="$(dirname $@)/$req"
list-req $path
done
}

# Find pattern in requirements files recursively
# Usage: $ in-req pattern file
function in-req (){
for file in $(list-req $2)
do
if (grep -Fiqe "$1" "$file") then
return 0
fi
done
return 1
}

0 comments on commit 0ff4df4

Please sign in to comment.