From 32d77d9fcf419f253ae1769f2e93352e69a35ebf Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Fri, 30 Dec 2011 12:41:53 -0600 Subject: [PATCH] linux.inc: don't choke on missing defconfig in lzop dep When a recipe is being parsed which will be skipped due to an incompatible machine, no local defconfig will exist for the current machine. It seems that the fetch localpath code doesn't error in that case, so we need to check for an IOError on the attempted open. Without this, we can hit parse errors. Signed-off-by: Christopher Larson Signed-off-by: Koen Kooi --- recipes-kernel/linux/linux.inc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/recipes-kernel/linux/linux.inc b/recipes-kernel/linux/linux.inc index e8a754f5..6996283e 100644 --- a/recipes-kernel/linux/linux.inc +++ b/recipes-kernel/linux/linux.inc @@ -269,9 +269,14 @@ python () { try: defconfig = bb.fetch2.localpath('file://defconfig', d) except bb.fetch2.FetchError: - pass - else: - if 'CONFIG_KERNEL_LZO=y\n' in open(defconfig).readlines(): - depends = d.getVar('DEPENDS', False) - d.setVar('DEPENDS', depends + ' lzop-native') + return + + try: + configfile = open(defconfig) + except IOError: + return + + if 'CONFIG_KERNEL_LZO=y\n' in configfile.readlines(): + depends = d.getVar('DEPENDS', False) + d.setVar('DEPENDS', depends + ' lzop-native') }