]> code.ossystems Code Review - openembedded-core.git/commitdiff
lib/oe/patch.py: Fix applying a directory as a patch
authorTomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Fri, 25 Jan 2019 19:55:33 +0000 (20:55 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 26 Jan 2019 13:38:59 +0000 (13:38 +0000)
If a SRC_URI content ends with '.patch' bitbake is
trying to apply it as it's a patch file.

It causes that if we use git repository for 'patch' package
the bare clone is extracted to a directory
(i.e. build/downloads/git2/git.mirror.org.patch/) which is considered
to be a patch file, so patch.py tries to apply that directory as a patch
which ends up with a failure.

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/patch.py

index 8c8e96a2dcac8c188de920131cd9b0a41fd420a8..7dd31d9d4633b19b573add862b5862010c11aca2 100644 (file)
@@ -793,6 +793,8 @@ def patch_path(url, fetch, workdir, expand=True):
     """Return the local path of a patch, or return nothing if this isn't a patch"""
 
     local = fetch.localpath(url)
+    if os.path.isdir(local):
+        return
     base, ext = os.path.splitext(os.path.basename(local))
     if ext in ('.gz', '.bz2', '.xz', '.Z'):
         if expand: