[OE-core] [PATCH 2/3] oe/gpg_sign: check for python-pexpect when using local signing
Markus Lehtonen
markus.lehtonen at linux.intel.com
Fri Feb 5 14:00:23 UTC 2016
Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>
---
meta/lib/oe/gpg_sign.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/meta/lib/oe/gpg_sign.py b/meta/lib/oe/gpg_sign.py
index 8832ea9..ea35564 100644
--- a/meta/lib/oe/gpg_sign.py
+++ b/meta/lib/oe/gpg_sign.py
@@ -17,13 +17,17 @@ class LocalSigner(object):
@classmethod
def check_sanity(cls, d, keyid, passphrase_file):
"""(Pre-)check the sanity of a configuration"""
- msg = ""
+ msgs = []
+ try:
+ import pexpect
+ except ImportError:
+ msgs.append("Please install python-pexpect that is needed by lcocal gpg signing.")
missing_vars = ['%(keyid)s'] if not keyid else []
if not passphrase_file:
missing_vars.append('%(passphrase_file)s')
if missing_vars:
- msg += "You need to define " + ' and '.join(missing_vars) + " in the config."
- return msg
+ msgs.append("You need to define " + ' and '.join(missing_vars) + " in the config.")
+ return ' '.join(msgs)
def export_pubkey(self, output_file):
"""Export GPG public key to a file"""
--
2.6.2
More information about the Openembedded-core
mailing list