Patchwork [bitbake-devel] fetch2: Cleanup file checksum generation, v2

login
register
mail settings
Submitter Jacob Kroon
Date April 28, 2014, 5:14 p.m.
Message ID <1398705296-14237-1-git-send-email-jacob.kroon@mikrodidakt.se>
Download mbox | patch
Permalink /patch/71165/
State New
Headers show

Comments

Jacob Kroon - April 28, 2014, 5:14 p.m.
The initial version of this patch was reverted in

0a94e568152de550dedc8135a766beb18bf064ab

However, it was later agreed upon that it was reverted due to
a misunderstanding during code review; the patch is ok.

This version of the patch also removes an unneeded initialization of
the 'checksum' variable outside the scopes it is being used in.

Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
---
 lib/bb/fetch2/__init__.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Patch

diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 5a03a0e..5a9c72f 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -975,7 +975,6 @@  def get_file_checksums(filelist, pn):
 
     checksums = []
     for pth in filelist.split():
-        checksum = None
         if '*' in pth:
             # Handle globs
             for f in glob.glob(pth):
@@ -985,15 +984,12 @@  def get_file_checksums(filelist, pn):
                     checksum = checksum_file(f)
                     if checksum:
                         checksums.append((f, checksum))
-            continue
         elif os.path.isdir(pth):
             checksums.extend(checksum_dir(pth))
-            continue
         else:
             checksum = checksum_file(pth)
-
-        if checksum:
-            checksums.append((pth, checksum))
+            if checksum:
+                checksums.append((pth, checksum))
 
     checksums.sort(key=operator.itemgetter(1))
     return checksums