From fefcd7170ea990d8898fbbc4dd1ff367ce0636dc Mon Sep 17 00:00:00 2001
From: Mitchel Humpherys <mitchelh@codeaurora.org>
Date: Thu, 24 Apr 2014 11:03:51 -0700
Subject: [PATCH] lrdp-v2: README: ramparse.py: add more help about python2.7

If the user has python2.7 installed but it's not the default interpreter
on their system, they might get confused when they invoke the parser and
get a message about needing to install 2.7 even though they already have
it installed. Add some instructional messages about this situation to
the 2.6 invocation warning message as well as the README.

Change-Id: Ib1ee7df39199f715b236dbda2f75093ba0501648
---
 linux-ramdump-parser-v2/README      | 11 +++++++++++
 linux-ramdump-parser-v2/ramparse.py | 13 ++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/linux-ramdump-parser-v2/README b/linux-ramdump-parser-v2/README
index ba3f419..ab3704b 100644
--- a/linux-ramdump-parser-v2/README
+++ b/linux-ramdump-parser-v2/README
@@ -49,6 +49,17 @@ Python 2.7 is required to run this tool. It can be downloaded and
 installed from https://www.python.org/ or through your system's
 software package manager.
 
+If you already have python2.7 installed but it's not the default
+python2 interpreter on your system (e.g. if python2 points to
+python2.6) then you'll need to invoke the script with python2.7
+explicitly, for example:
+
+    $ python2.7 $(which ramparse.py) ...
+
+instead of:
+
+    $ ramparse.py ...
+
 Setting up the toolchains
 -------------------------------
 The parser relies on having access to gdb and nm to work. You will need to
diff --git a/linux-ramdump-parser-v2/ramparse.py b/linux-ramdump-parser-v2/ramparse.py
index 1283458..7caf609 100755
--- a/linux-ramdump-parser-v2/ramparse.py
+++ b/linux-ramdump-parser-v2/ramparse.py
@@ -40,12 +40,23 @@ if major != 2:
 if minor != 7 and '--force-26' not in sys.argv:
     from textwrap import dedent
     print(dedent("""
-    Warning! This script is developed and tested with Python 2.7.
+    WARNING! This script is developed and tested with Python 2.7.
     You might be able to get things working on 2.6 by installing
     a few dependencies (most notably, OrderedDict [1])
     and then passing --force-26 to bypass this version check, but
     the recommended and supported approach is to install python2.7.
 
+    If you already have python2.7 installed but it's not the default
+    python2 interpreter on your system (e.g. if python2 points to
+    python2.6) then you'll need to invoke the scripts with python2.7
+    explicitly, for example:
+
+        $ python2.7 $(which ramparse.py) ...
+
+    instead of:
+
+        $ ramparse.py ...
+
     [1] https://pypi.python.org/pypi/ordereddict"""))
     sys.exit(1)
 if '--force-26' in sys.argv:
-- 
GitLab