summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-05-24 13:01:00 -0700
committerChris Larson <chris_larson@mentor.com>2010-05-25 12:54:52 -0700
commit6fe7cef27069415f2eba36bc640cf59013d4979b (patch)
treeb0cb8845ddc6b8bcffc50e08a2eeae98e049be98 /classes
parentbf7d0467a0788a7fcc1c96e0dc35a25ae09278a0 (diff)
Make the do_patch apply=yes param implicit if extension is .diff/.patch
For .diff/.patch you need to apply manually, you can specify apply=no. Signed-off-by: Chris Larson <chris_larson@mentor.com> Acked-by: Denys Dmytriyenko <denis@denix.org> Acked-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/patch.bbclass24
1 files changed, 15 insertions, 9 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index 4767a3b7dc..73395e3c45 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -39,21 +39,27 @@ python patch_do_patch() {
workdir = bb.data.getVar('WORKDIR', d, 1)
for url in src_uri:
(type, host, path, user, pswd, parm) = bb.decodeurl(url)
+
+ local = None
+ base, ext = os.path.splitext(os.path.basename(path))
+ if ext in ('.gz', '.bz2', '.Z'):
+ local = os.path.join(workdir, base)
+ ext = os.path.splitext(base)[1]
+
apply = parm.get("apply")
- if apply != "yes" and not "patch" in parm:
- if apply and apply != "no":
+ if apply is not None and apply != "yes" and not "patch" in parm:
+ if apply != "no":
bb.msg.warn(None, "Unsupported value '%s' for 'apply' url param in '%s', please use 'yes' or 'no'" % (apply, url))
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"):
+ continue
- bb.fetch.init([url],d)
- url = bb.encodeurl((type, host, path, user, pswd, []))
- local = os.path.join('/', bb.fetch.localpath(url, d))
-
- base, ext = os.path.splitext(os.path.basename(local))
- if ext in ('.gz', '.bz2', '.Z'):
- local = os.path.join(workdir, base)
+ if not local:
+ bb.fetch.init([url],d)
+ url = bb.encodeurl((type, host, path, user, pswd, []))
+ local = os.path.join('/', bb.fetch.localpath(url, d))
local = bb.data.expand(local, d)
if "striplevel" in parm: