Skip to content

Commit

Permalink
Filter patches that are put in description
Browse files Browse the repository at this point in the history
Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
  • Loading branch information
vivekrnv committed May 12, 2023
1 parent a898e8f commit d279997
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
25 changes: 21 additions & 4 deletions platform/mellanox/integration-scripts/hwmgmt_kernel_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ class Data:
new_up = list()
# list of new non-upstream patches
new_non_up = list()
# old upstream patches
old_up_patches = list()
# current series file raw data
old_series = list()
# current non-upstream patch list
Expand Down Expand Up @@ -369,6 +371,13 @@ def handle_exclusions(self):
FileHandler.write_lines(os.path.join(self.args.build_root, SLK_KCONFIG_EXCLUDE), new_lines, True)
print("-> INFO: updated kconfig-exclusion: \n{}".format("".join(FileHandler.read_raw(os.path.join(self.args.build_root, SLK_KCONFIG_EXCLUDE)))))

def list_patches(self):
old_up_patches = []
for i in range(Data.i_mlnx_start, Data.i_mlnx_end):
old_up_patches.append(Data.old_series[i].strip())
old_non_up_patches = [ptch.strip() for ptch in Data.old_non_up]
return old_up_patches, old_non_up_patches

def parse_id(self, id_):
if id_:
id_ = "https://github.com/gregkh/linux/commit/" + id_
Expand All @@ -377,14 +386,22 @@ def parse_id(self, id_):
def create_commit_msg(self, table):
title = COMMIT_TITLE.format(self.args.hw_mgmt_ver)
changes_slk, changes_sb = {}, {}
old_up_patches, old_non_up_patches = self.list_patches()
for patch in table:
id_ = self.parse_id(patch.get(COMMIT_ID, ""))
if patch.get(PATCH_NAME) in Data.new_up:
changes_slk[patch.get(PATCH_NAME)] = id_
elif patch.get(PATCH_NAME) in Data.new_non_up:
changes_sb[patch.get(PATCH_NAME)] = id_
patch_ = patch.get(PATCH_NAME)
if patch_ in Data.new_up and patch_ not in old_up_patches:
changes_slk[patch_] = id_
print(f"-> INFO: Patch: {patch_}, Commit: {id_}, added to linux-kernel description")
elif patch_ in Data.new_non_up and patch_ not in old_non_up_patches:
changes_sb[patch_] = id_
print(f"-> INFO: Patch: {patch_}, Commit: {id_}, added to buildimage description")
else:
print(f"-> INFO: Patch: {patch_}, Commit: {id_}, is not added")
slk_commit_msg = title + "\n" + build_commit_description(changes_slk)
sb_commit_msg = title + "\n" + build_commit_description(changes_sb)
print(f"-> INFO: SLK Commit Message: \n {slk_commit_msg}")
print(f"-> INFO: SB Commit Message: \n {sb_commit_msg}")
return sb_commit_msg, slk_commit_msg

def perform(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@
TEST_SLK_COMMIT = """\
Intgerate HW-MGMT 7.0030.0937 Changes
## Patch List
* 0001-i2c-mlxcpld-Update-module-license.patch : https://github.com/gregkh/linux/commit/f069291bd5fc
* 0002-i2c-mlxcpld-Decrease-polling-time-for-performance-im.patch : https://github.com/gregkh/linux/commit/cb9744178f33
* 0003-i2c-mlxcpld-Add-support-for-I2C-bus-frequency-settin.patch : https://github.com/gregkh/linux/commit/66b0c2846ba8
* 0004-i2c-mux-mlxcpld-Update-module-license.patch : https://github.com/gregkh/linux/commit/337bc68c294d
* 0005-i2c-mux-mlxcpld-Move-header-file-out-of-x86-realm.patch : https://github.com/gregkh/linux/commit/98d29c410475
* 0006-i2c-mux-mlxcpld-Convert-driver-to-platform-driver.patch : https://github.com/gregkh/linux/commit/84af1b168c50
* 0007-i2c-mux-mlxcpld-Prepare-mux-selection-infrastructure.patch : https://github.com/gregkh/linux/commit/81566938083a
Expand Down

0 comments on commit d279997

Please sign in to comment.