Use component from XML to re-name metadata file

When re-naming the metadata file inside the pre-patched ISO, we should
use the value of the "component" element together with the "sw_version"
value.

Test plan:
    PASS: Build pre-patched ISO with one patch
    PASS: Build pre-patched ISO with more than one patch

Partial-Bug: 2090871

Change-Id: Ic3f190748dddeff380bc3a236f03ebd200c350a3
Signed-off-by: Dostoievski Batista <dostoievski.albinobatista@windriver.com>
This commit is contained in:
Dostoievski Batista 2024-11-29 15:21:22 -03:00 committed by Dostoievski Albino Batista
parent c533a42eda
commit baeeb12e05

View File

@ -386,8 +386,9 @@ def main():
# Get sw_version value and save metadata.xml using sw_version as sufix
xml_root = ET.parse(f"{extract_folder}/metadata.xml").getroot()
sw_version = xml_root.find('sw_version').text
component = xml_root.find('component').text
os.makedirs(f"{ptc_folder}/{sw_version}/metadata")
metadata_path = (f"{ptc_folder}/{sw_version}/metadata/starlingx-{sw_version}"
metadata_path = (f"{ptc_folder}/{sw_version}/metadata/{component}-{sw_version}"
"-metadata.xml")
shutil.copy(f"{extract_folder}/metadata.xml", metadata_path)
# From inside software.tar we extract every .deb file