From 1b46b2fe4723b0dda74c2f66a09df8259508fd4b Mon Sep 17 00:00:00 2001
From: Richard Haines <richard_c_haines@btinternet.com>
Date: Thu, 8 Aug 2013 15:13:29 +0100
Subject: [PATCH] Fix insertkeys.py to resolve keys.conf path entries in a
 portable way

Currently a path to a key in keys.conf must be fully qualified or have
the -d option appended. This fix will allow paths to have environment
variables that will be expanded. This will give portability to the
entries. For example the following entry will now be resolved correctly:
[@NET_APPS]
ALL : $ANDROID_BUILD_TOP/device/demo_vendor/demo_dev/security/net_apps.x509.pem

Change-Id: If4f169d9ed4f37b6ebd062508de058f3baeafead
Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
---
 tools/insertkeys.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/insertkeys.py b/tools/insertkeys.py
index cccb92f1d..dec6d8772 100755
--- a/tools/insertkeys.py
+++ b/tools/insertkeys.py
@@ -87,7 +87,8 @@ class ParseConfig(ConfigParser.ConfigParser):
                 if tag in keyMap:
                     sys.exit("Duplicate tag detected " + tag)
 
-                path = os.path.join(key_directory, self.get(tag, option))
+                tag_path = os.path.expandvars(self.get(tag, option))
+                path = os.path.join(key_directory, tag_path)
 
                 keyMap[tag] = GenerateKeys(path)
 
-- 
GitLab