Browse Source

Fix error message in automatic versions

Assign variable before checking and print a more useful error message if
none of the files in `list_for_cpio` can be found in group.

Signed-off-by: Thomas Haemmerle <thomas.haemmerle@leica-geosystems.com>
Thomas Haemmerle 4 years ago
parent
commit
4bd902826b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      classes/swupdate-common.bbclass

+ 3 - 1
classes/swupdate-common.bbclass

@@ -98,6 +98,8 @@ def swupdate_expand_auto_versions(d, s, list_for_cpio):
         data = f.read()
 
     def get_package_name(group, file_list):
+        package = None
+
         m = re.search(r"%s:(?P<package>.+?(?=\"))" % (AUTOVERSION_REGEXP), group)
         if m:
             package = m.group('package')
@@ -108,7 +110,7 @@ def swupdate_expand_auto_versions(d, s, list_for_cpio):
                 package = filename
 
         if not package:
-            bb.fatal("Failed to find %s in group with \"%s\"" % (filename, AUTO_VERSION_TAG))
+            bb.fatal("Failed to find file in group %s" % (group))
 
         return (package, False)