summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Remmet <j.remmet@phytec.de>2019-08-09 12:45:38 (GMT)
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2019-08-23 09:52:42 (GMT)
commit81d35ad9922367d370c03961d7a44ecfb0ac4bf5 (patch)
tree62e5713d7d21fb84082ced46dabf97237b3d5d55
parent25e02d9bcf50eaf0f07641d8bf574cd2b91432f5 (diff)
downloadmeta-phytec-81d35ad9922367d370c03961d7a44ecfb0ac4bf5.zip
meta-phytec-81d35ad9922367d370c03961d7a44ecfb0ac4bf5.tar.bz2
scripts: copy_file_by_priority: handle layer without priority
Layers without BBFILE_PRIORITY_ leads to "UnboundLocalError: local variable 'priority' referenced before assignment" Ignore layers without priority if looking for files. Signed-off-by: Jan Remmet <j.remmet@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
-rwxr-xr-xscripts/copy_file_by_priority.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/copy_file_by_priority.py b/scripts/copy_file_by_priority.py
index 4bb9daf..3a8396e 100755
--- a/scripts/copy_file_by_priority.py
+++ b/scripts/copy_file_by_priority.py
@@ -34,8 +34,10 @@ class BSP_BBLayerFile(BoardSupportPackage):
name, val = line.partition("=")[::2]
if 'BBFILE_PRIORITY_' in name:
priority = int(val.strip('" \n'))
+ lcfile.close
+ return priority
lcfile.close
- return priority
+ return None
def copy_file(self, search_file, destination):
for _, ppath in self.project_paths_priority: