Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH 0/2] A couple more file checksum fixes
@ 2014-04-08 14:03 Paul Eggleton
  2014-04-08 14:03 ` [PATCH 1/2] fetch2: handle wildcards correctly when recording file checksums Paul Eggleton
  2014-04-08 14:03 ` [PATCH 2/2] fetch2: fix traceback when a wildcard matches a directory Paul Eggleton
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2014-04-08 14:03 UTC (permalink / raw)
  To: bitbake-devel

The following changes since commit 35c67281775b08925957c32663d587d486944e0e:

  hob: add "recipes/images/" to BBFILES when Hob is launched (2014-04-08 13:06:34 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib paule/checksumfix2
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=paule/checksumfix2

Paul Eggleton (2):
  fetch2: handle wildcards correctly when recording file checksums
  fetch2: fix traceback when a wildcard matches a directory

 lib/bb/fetch2/__init__.py | 31 +++++++++++++++++++++----------
 1 file changed, 21 insertions(+), 10 deletions(-)

-- 
1.9.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] fetch2: handle wildcards correctly when recording file checksums
  2014-04-08 14:03 [PATCH 0/2] A couple more file checksum fixes Paul Eggleton
@ 2014-04-08 14:03 ` Paul Eggleton
  2014-04-08 14:03 ` [PATCH 2/2] fetch2: fix traceback when a wildcard matches a directory Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2014-04-08 14:03 UTC (permalink / raw)
  To: bitbake-devel

The Local fetcher's localpath is returning the parent directory for a
wildcard match; we need to handle this and add the wildcard
specification so that we checksum the correct files.

Fixes [YOCTO #6127].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/fetch2/__init__.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 150f864..a9ab75e 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -932,6 +932,9 @@ def get_checksum_file_list(d):
         if ud and isinstance(ud.method, local.Local):
             ud.setup_localpath(d)
             f = ud.localpath
+            pth = ud.decodedurl
+            if '*' in pth:
+                f = os.path.join(os.path.abspath(f), pth)
             if f.startswith(dl_dir):
                 # The local fetcher's behaviour is to return a path under DL_DIR if it couldn't find the file anywhere else
                 if os.path.exists(f):
-- 
1.9.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] fetch2: fix traceback when a wildcard matches a directory
  2014-04-08 14:03 [PATCH 0/2] A couple more file checksum fixes Paul Eggleton
  2014-04-08 14:03 ` [PATCH 1/2] fetch2: handle wildcards correctly when recording file checksums Paul Eggleton
@ 2014-04-08 14:03 ` Paul Eggleton
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2014-04-08 14:03 UTC (permalink / raw)
  To: bitbake-devel

If there is a directory matching a wildcard in SRC_URI when getting file
checksums, we should recurse into that instead of producing an error.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 lib/bb/fetch2/__init__.py | 28 ++++++++++++++++++----------
 1 file changed, 18 insertions(+), 10 deletions(-)

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index a9ab75e..5a03a0e 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -962,24 +962,32 @@ def get_file_checksums(filelist, pn):
             return None
         return checksum
 
+    def checksum_dir(pth):
+        # Handle directories recursively
+        dirchecksums = []
+        for root, dirs, files in os.walk(pth):
+            for name in files:
+                fullpth = os.path.join(root, name)
+                checksum = checksum_file(fullpth)
+                if checksum:
+                    dirchecksums.append((fullpth, checksum))
+        return dirchecksums
+
     checksums = []
     for pth in filelist.split():
         checksum = None
         if '*' in pth:
             # Handle globs
             for f in glob.glob(pth):
-                checksum = checksum_file(f)
-                if checksum:
-                    checksums.append((f, checksum))
+                if os.path.isdir(f):
+                    checksums.extend(checksum_dir(f))
+                else:
+                    checksum = checksum_file(f)
+                    if checksum:
+                        checksums.append((f, checksum))
             continue
         elif os.path.isdir(pth):
-            # Handle directories
-            for root, dirs, files in os.walk(pth):
-                for name in files:
-                    fullpth = os.path.join(root, name)
-                    checksum = checksum_file(fullpth)
-                    if checksum:
-                        checksums.append((fullpth, checksum))
+            checksums.extend(checksum_dir(pth))
             continue
         else:
             checksum = checksum_file(pth)
-- 
1.9.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-08 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08 14:03 [PATCH 0/2] A couple more file checksum fixes Paul Eggleton
2014-04-08 14:03 ` [PATCH 1/2] fetch2: handle wildcards correctly when recording file checksums Paul Eggleton
2014-04-08 14:03 ` [PATCH 2/2] fetch2: fix traceback when a wildcard matches a directory Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox