diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2021-01-15 00:37:48 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2021-01-28 00:57:38 +0300 |
commit | 49054bcb324c0bdd5916ad360bf500db9d9be508 (patch) | |
tree | ec4f1d8c1273ccb2d618641e801e467831c1627c /meta-ibm/recipes-phosphor/ipmi | |
parent | 8c5ef9e353ea6ee86772fd6839dc3c907f191d8a (diff) | |
download | openbmc-49054bcb324c0bdd5916ad360bf500db9d9be508.tar.xz |
phosphor-ipmi-config: Handle an empty commit number
The VERSION_ID may not have a commit number for the cases a tag
is created, ex: 2.10.1. Since the code is expecting a commit
number of 1-4 digits, use a '0' if no commit number exists.
Tested: Created a tag 2.10.99 which sets VERSION_ID=2.10.99.
Without this change, build fails with:
"Exception: IndexError: list index out of range"
With this change there are no build errors.
Change-Id: I3b56ebc1844ec6748b92cca3484f9aa1f4d983f8
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'meta-ibm/recipes-phosphor/ipmi')
-rw-r--r-- | meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend index e3e5002bb..7898a1039 100644 --- a/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend +++ b/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend @@ -22,14 +22,18 @@ python do_patch_ibm-ac-server() { from shutil import copyfile version_id = do_get_version(d) - # count from the commit version + # count from the commit version, minimum of one digit count = re.findall("-(\d{1,4})-", version_id) + if count: + commit = count[0] + else: + commit = "0" release = re.findall("-r(\d{1,4})", version_id) if release: - auxVer = count[0] + "{0:0>4}".format(release[0]) + auxVer = commit + "{0:0>4}".format(release[0]) else: - auxVer = count[0] + "0000" + auxVer = commit + "0000" workdir = d.getVar('WORKDIR', True) file = os.path.join(workdir, 'dev_id.json') |