diff options
author | Fathi Boudra <fathi.boudra@linaro.org> | 2016-05-11 00:15:25 +0300 |
---|---|---|
committer | Fathi Boudra <fathi.boudra@linaro.org> | 2016-05-11 00:15:25 +0300 |
commit | 3bbce609714a3ddcb692daaa27f440cee9d68ce7 (patch) | |
tree | cd4ef93a094bf315242b76f5082ccb34c2145f38 | |
parent | 4af65698c1028a9e5b64963b073b15c93d18d96f (diff) |
Filter out symlinks in _get_file_matching()
Due to the rootfs changes, kernel/initrd are shipped with unversioned symlinks now.
The number of files is now 2 at minimum (symlink and real file).
Fix the following error:
ValueError: Too many files matching '/tmp/tmpq2xWZQ/rootfs/binary/boot/Image*' found.
Regression introduced in:
https://git.linaro.org/ci/ubuntu-build-service.git/commitdiff/9d07c7b60f18c207b9b446e1f3bb2eedf8ad4876
Change-Id: I0235dcd1e0faa9c6159345b1f35987f7fa8fe4fb
Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
Reported-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r-- | linaro_image_tools/media_create/boards.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/linaro_image_tools/media_create/boards.py b/linaro_image_tools/media_create/boards.py index f6f03f8..f00e740 100644 --- a/linaro_image_tools/media_create/boards.py +++ b/linaro_image_tools/media_create/boards.py @@ -2083,7 +2083,8 @@ def _get_file_matching(regex): If zero or more than one files match, raise a ValueError. """ - files = glob.glob(regex) + files = [fn for fn in glob.glob(regex) + if not os.path.islink(fn)] if len(files) == 1: return files[0] elif len(files) == 0: |