Skip to contentSkip to conversation

linux.inc: don't choke on missing defconfig in lzop dep

PATCH In review Christopher Larson 2 participants 2 messages Dec 20, 2011 – Dec 30, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 recipes-kernel/linux/linux.inc |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
recipes-kernel/linux/linux.inc +10 -5
index e8a754f..6996283 100644
@@ -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')
 }
Signature · 1 line
1.7.8
#1 lore raw

Op 20 dec. 2011, om 19:16 heeft Christopher Larson het volgende geschreven:

Quoted 7 lines

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.

---

meta-ti$ git am -s /tmp/\[meta-ti\]\ \[PATCH\]\ linux.inc_\ don\'t\ choke\ on\ missing\ defconfig\ in\ lzop\ dep.eml
Applying: linux.inc: don't choke on missing defconfig in lzop dep
error: patch failed: recipes-kernel/linux/linux.inc:269
error: recipes-kernel/linux/linux.inc: patch does not apply
Patch failed at 0001 linux.inc: don't choke on missing defconfig in lzop dep
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".