deviceinfo: resolve path for parser errors (!1732)

Display the resolved deviceinfo file path in exceptions from the
deviceinfo parser. Instead of messages like these:

RuntimeError: Please add 'deviceinfo_codename="lg-mako"' to: /home/user/.local/var/pmbootstrap/cache_git/pmaports/.gitlab-ci/testcases/../../device/device-lg-mako/deviceinfo

We get the more readable version:

RuntimeError: Please add 'deviceinfo_codename="lg-mako"' to: /home/user/.local/var/pmbootstrap/cache_git/pmaports/device/device-lg-mako/deviceinfo
This commit is contained in:
Oliver Smith 2018-12-26 21:33:33 +01:00
parent 747ccfdd75
commit 96d4f2e6be
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,9 @@ import pmb.config
def sanity_check(info, path):
# Resolve path for more readable error messages
path = os.path.realpath(path)
# "flash_methods" is legacy
if "flash_methods" in info:
raise RuntimeError("deviceinfo_flash_methods has been renamed to"