pmb.deviceinfo: fix sanity check when "device-" is present in codename (!1834)

Fixes #1842
This commit is contained in:
Alexey Min 2019-11-22 00:28:06 +03:00 committed by Oliver Smith
parent 8806a464b2
commit 64aa7443e5
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,9 @@ def sanity_check(info, path):
" let us know in the postmarketOS issues!)")
# "codename" is required
codename = os.path.basename(os.path.dirname(path)).replace("device-", "")
codename = os.path.basename(os.path.dirname(path))
if codename.startswith("device-"):
codename = codename[7:]
if "codename" not in info or info["codename"] != codename:
raise RuntimeError("Please add 'deviceinfo_codename=\"" + codename +
"\"' to: " + path)