From 0ff4df4dc3b03e9321dd24fbbad1a17ffbffd3ce Mon Sep 17 00:00:00 2001
From: Kenneth Reitz <me@kennethreitz.com>
Date: Thu, 3 Jan 2013 14:57:08 -0500
Subject: [PATCH] much better

---
 bin/compile       |  2 +-
 bin/steps/pylibmc |  2 +-
 bin/utils         | 22 ----------------------
 3 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/bin/compile b/bin/compile
index 4678b547..2c470c3e 100755
--- a/bin/compile
+++ b/bin/compile
@@ -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
 
diff --git a/bin/steps/pylibmc b/bin/steps/pylibmc
index 949142a1..fa7c45f4 100755
--- a/bin/steps/pylibmc
+++ b/bin/steps/pylibmc
@@ -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
 
diff --git a/bin/utils b/bin/utils
index c3eef8aa..d849e0c7 100755
--- a/bin/utils
+++ b/bin/utils
@@ -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
-}
-- 
GitLab