From 14dfc92d9aee9430a81e5a71a26d002dbd6d5d04 Mon Sep 17 00:00:00 2001 From: JF Ding Date: Thu, 3 Nov 2011 20:21:04 +0800 Subject: [PATCH] make tools/mic more flexible for python path to make it live with virtualenv --- setup.py | 13 ++++++------- tools/mic | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 2fef1f5..69fee8d 100644 --- a/setup.py +++ b/setup.py @@ -28,22 +28,21 @@ try: ver_file.close() except IOError: print 'WARNING: Cannot write version number file' - pass # --install-layout is recognized after 2.5 if sys.version_info[:2] > (2, 5): if len(sys.argv) > 1 and 'install' in sys.argv: - dist=None - import platform try: + import platform (dist, ver, id) = platform.linux_distribution() + + # for debian-like distros, mods will be installed to + # ${PYTHONLIB}/dist-packages + if dist in ('debian', 'Ubuntu'): + sys.argv.append('--install-layout=deb') except: pass - # for debian-like distros, set deb-layout py-lib - if dist in ('debian', 'Ubuntu'): - sys.argv.append('--install-layout=deb') - PACKAGES = [MOD_NAME, MOD_NAME + '/utils', MOD_NAME + '/imager', diff --git a/tools/mic b/tools/mic index 85e6afe..b32a360 100755 --- a/tools/mic +++ b/tools/mic @@ -1,4 +1,4 @@ -#!/usr/bin/python -tt +#!/usr/bin/setenv python # # Copyright (c) 2011 Intel, Inc. # -- 2.7.4