From 38642ec7bb0e55d24b7dc2e8f7d5b6677d5b9a7c Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 26 Feb 2013 17:13:03 +0000 Subject: [PATCH] Added support for Arch Use python2 if available, in preference to python. --- 0export | 7 ++++++- test.py | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/0export b/0export index 8acfb0b..1dd4edc 100755 --- a/0export +++ b/0export @@ -19,7 +19,12 @@ extract_header = """#!/bin/sh archive_offset=00000 archive_format=application/x-tar package_version=2 -exec python - "$0" "$archive_offset" "$@" << EOF +if [ -x /usr/bin/python2 ]; then + PYTHON=/usr/bin/python2 +else + PYTHON=python +fi +exec "$PYTHON" - "$0" "$archive_offset" "$@" << EOF """ + file(os.path.join(os.path.dirname(__file__), 'unpacker.py')).read() + """ EOF exit 1 diff --git a/test.py b/test.py index 56af09e..8a00e54 100755 --- a/test.py +++ b/test.py @@ -34,8 +34,7 @@ class TestCompile(unittest.TestCase): def testSimple(self): setup_sh = os.path.join(self.tmpdir, 'setup.sh') - print export_bin - subprocess.check_call([export_bin, setup_sh, PUBLISH_URI]) + subprocess.check_call([sys.executable, export_bin, setup_sh, PUBLISH_URI]) env = { 'HOME': self.tmpdir, -- 2.11.4.GIT