From 7906e083ad518e821f89ead5ba47b8cfce989d28 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 14 Jun 2010 20:32:16 +0200 Subject: make install: Fixed script for finding PYTHON_SITE_DEST --- Makefile | 8 ++++++-- 1 file 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) -- cgit 1.4.1-2-gfad0