[oe-commits] [bitbake] 01/02: FileChecksumCache: don't follow directory symlinks

git at git.openembedded.org git at git.openembedded.org
Tue Mar 29 12:01:49 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit e6634e98dbc43c41118026db4b00abbda3a1ae7c
Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
AuthorDate: Tue Mar 22 16:59:54 2016 +0200

    FileChecksumCache: don't follow directory symlinks
    
    Before this patch, directory symlinks mathcing filename pattern (either
    a file name or a glob pattern) were followed. However, directory
    symlinks deeper in the search chain were omitted by os.walk(). Now
    directory traversal behaves consistently, ignoring syminks on all
    levels.
    
    One reason for choosing not to "walk into" directory symlinks is that
    dir symlinks in externalsrc.bbclass in oe-core are causing problems in
    source tree checksumming.
    
    [YOCTO #8853]
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/checksum.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/checksum.py b/lib/bb/checksum.py
index 7fb46d8..2369db3 100644
--- a/lib/bb/checksum.py
+++ b/lib/bb/checksum.py
@@ -123,11 +123,14 @@ class FileChecksumCache(MultiProcessCache):
                 # Handle globs
                 for f in glob.glob(pth):
                     if os.path.isdir(f):
-                        checksums.extend(checksum_dir(f))
+                        if os.path.islink(f):
+                            continue
+                        else:
+                            checksums.extend(checksum_dir(f))
                     else:
                         checksum = checksum_file(f)
                         checksums.append((f, checksum))
-            elif os.path.isdir(pth):
+            elif os.path.isdir(pth) and not os.path.islink(f):
                 checksums.extend(checksum_dir(pth))
             else:
                 checksum = checksum_file(pth)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list