diff options
| -rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index a9ab75ee41..5a03a0e46e 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
| @@ -962,24 +962,32 @@ def get_file_checksums(filelist, pn): | |||
| 962 | return None | 962 | return None |
| 963 | return checksum | 963 | return checksum |
| 964 | 964 | ||
| 965 | def checksum_dir(pth): | ||
| 966 | # Handle directories recursively | ||
| 967 | dirchecksums = [] | ||
| 968 | for root, dirs, files in os.walk(pth): | ||
| 969 | for name in files: | ||
| 970 | fullpth = os.path.join(root, name) | ||
| 971 | checksum = checksum_file(fullpth) | ||
| 972 | if checksum: | ||
| 973 | dirchecksums.append((fullpth, checksum)) | ||
| 974 | return dirchecksums | ||
| 975 | |||
| 965 | checksums = [] | 976 | checksums = [] |
| 966 | for pth in filelist.split(): | 977 | for pth in filelist.split(): |
| 967 | checksum = None | 978 | checksum = None |
| 968 | if '*' in pth: | 979 | if '*' in pth: |
| 969 | # Handle globs | 980 | # Handle globs |
| 970 | for f in glob.glob(pth): | 981 | for f in glob.glob(pth): |
| 971 | checksum = checksum_file(f) | 982 | if os.path.isdir(f): |
| 972 | if checksum: | 983 | checksums.extend(checksum_dir(f)) |
| 973 | checksums.append((f, checksum)) | 984 | else: |
| 985 | checksum = checksum_file(f) | ||
| 986 | if checksum: | ||
| 987 | checksums.append((f, checksum)) | ||
| 974 | continue | 988 | continue |
| 975 | elif os.path.isdir(pth): | 989 | elif os.path.isdir(pth): |
| 976 | # Handle directories | 990 | checksums.extend(checksum_dir(pth)) |
| 977 | for root, dirs, files in os.walk(pth): | ||
| 978 | for name in files: | ||
| 979 | fullpth = os.path.join(root, name) | ||
| 980 | checksum = checksum_file(fullpth) | ||
| 981 | if checksum: | ||
| 982 | checksums.append((fullpth, checksum)) | ||
| 983 | continue | 991 | continue |
| 984 | else: | 992 | else: |
| 985 | checksum = checksum_file(pth) | 993 | checksum = checksum_file(pth) |
