merge_dtbs.py: Print only basenames of dtb* files

When debugging issues with the script, it helps to not have in the
script's output the fully qualified path names of the DTB and DTBO files
being merged as they are very lengthy. Retain only the relevant parts of
the filnames - the basenames for better readability.

Change-Id: Ia18584fcf9ff173c4b22d4543c83c4091e15b8f8
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
This commit is contained in:
Guru Das Srinagesh
2023-02-21 12:10:54 -08:00
committed by dianlujitao
parent 1c00116c6e
commit bd92c42017

View File

@@ -227,7 +227,7 @@ class DeviceTree(DeviceTreeInfo):
super().__init__(msm_id, board_id, pmic_id)
if not self.has_any_properties():
print('WARNING! {} has no properties and may match with any other devicetree'.format(self.filename))
print('WARNING! {} has no properties and may match with any other devicetree'.format(os.path.basename(self.filename)))
def get_prop(self, node, property, prop_type='i', check_output=True):
r = subprocess.run(["fdtget", "-t", prop_type, self.filename, node, property],
@@ -252,7 +252,7 @@ class DeviceTree(DeviceTreeInfo):
return out
def __str__(self):
return "{} [{}]".format(super().__str__(), self.filename)
return "{} [{}]".format(super().__str__(), os.path.basename(self.filename))
class InnerMergedDeviceTree(DeviceTreeInfo):
"""
@@ -332,7 +332,7 @@ class InnerMergedDeviceTree(DeviceTreeInfo):
return [part for part in parts if part not in ignored_parts]
def __str__(self):
return "{} [{} + {{{}}}]".format(super().__str__(), self.base, " ".join(t.filename for t in self.techpacks))
return "{} [{} + {{{}}}]".format(super().__str__(), os.path.basename(self.base), " ".join(os.path.basename(t.filename) for t in self.techpacks))
class MergedDeviceTree(object):
def __init__(self, other):