aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnrico Scholz <enrico.scholz@sigma-chemnitz.de>2010-05-27 02:41:11 +0000
committerChris Larson <chris_larson@mentor.com>2010-05-27 12:56:47 -0700
commit7cb990de933f22331cd701ecb45d1e30dd8f3c11 (patch)
tree74b9f46327cc956509597363d78f2ffb6c0f60d5
parenteb8ad2af3a59dc7b4c64814815fc13977efaec6b (diff)
downloadopenembedded-7cb990de933f22331cd701ecb45d1e30dd8f3c11.zip
openembedded-7cb990de933f22331cd701ecb45d1e30dd8f3c11.tar.gz
openembedded-7cb990de933f22331cd701ecb45d1e30dd8f3c11.tar.bz2
patch.bbclass: use param_bool()
This patch replaces a complicated if statement with a more simple code. Slightly altered to use oe.utils -kergoth Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Chris Larson <chris_larson@mentor.com>
-rw-r--r--classes/patch.bbclass13
1 files changed, 6 insertions, 7 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index 7b0c444..09ce781 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -6,6 +6,7 @@ QUILTRCFILE ?= "${STAGING_BINDIR_NATIVE}/quiltrc"
PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot"
python patch_do_patch() {
+ import oe.utils
import oe.patch
src_uri = (bb.data.getVar('SRC_URI', d, 1) or '').split()
@@ -46,15 +47,13 @@ python patch_do_patch() {
local = os.path.join(workdir, base)
ext = os.path.splitext(base)[1]
- if "apply" in parm:
- apply = parm["apply"]
- if apply != "yes":
- if apply != "no":
- bb.msg.warn(None, "Unsupported value '%s' for 'apply' url param in '%s', please use 'yes' or 'no'" % (apply, url))
- continue
+ is_patch = ext in (".diff", ".patch")
+
+ if not oe.utils.param_bool(parm, 'apply', is_patch):
+ continue
elif "patch" in parm:
bb.msg.warn(None, "Deprecated usage of 'patch' url param in '%s', please use 'apply={yes,no}'" % url)
- elif ext not in (".diff", ".patch"):
+ elif not is_patch:
continue
if not local: