summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-14 20:32:16 +0200
committerhut <hut@lavabit.com>2010-06-14 20:32:16 +0200
commit7906e083ad518e821f89ead5ba47b8cfce989d28 (patch)
treea9d9aea912a68e88c0a9d0d3dd4104f3942af437
parente74222ee48435895a636812f908c862f3fb7acb6 (diff)
downloadranger-7906e083ad518e821f89ead5ba47b8cfce989d28.tar.gz
make install: Fixed script for finding PYTHON_SITE_DEST
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index dc030b5a..57a3f8f2 100644
--- a/Makefile
+++ b/Makefile
@@ -20,8 +20,12 @@ DOCDIR ?= doc/pydoc
 PREFIX ?= /usr
 MANPREFIX ?= /share/man
 PYOPTIMIZE ?= 1
-PYTHON_SITE_DEST ?= $(shell $(PYTHON) -c 'import sys; sys.stdout.write( \
-	[p for p in sys.path if "site" in p][0])' 2> /dev/null)
+# this finds the shortest item in sys.path that contains "site" or "dist"
+# for example: /usr/lib/python2.6/site-packages
+PYTHON_SITE_DEST ?= $(shell $(PYTHON) -c 'import sys; \
+	dests = sorted([p for p in sys.path if "site" in p or "dist" in p], \
+	key=lambda dest: len(dest)); \
+	sys.stdout.write(dests[0])' 2> /dev/null)
 BMCOUNT ?= 5  # how often to run the benchmarks?
 
 CWD = $(shell pwd)
136'>136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185