File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
platform/mellanox/integration-scripts Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,18 @@ def get_new_patches(self):
137
137
Data .new_patches = FileHandler .read_dir (patches_path , "*.patch" )
138
138
Data .new_patches .sort ()
139
139
140
+ def cleanup_old_patches (self ):
141
+ patches_del = copy .deepcopy (Data .old_patches )
142
+ for patch in Data .new_patches :
143
+ if patch in Data .old_patches :
144
+ patches_del .remove (patch )
145
+ print (f" -> Patches to be removed are : { patches_del } " )
146
+ for patch in patches_del :
147
+ file_n = os .path .join (self .args .build_root , os .path .join (SLK_PATCH_LOC , patch ))
148
+ if os .path .exists (file_n ):
149
+ print (f"{ file_n } is deleted" )
150
+ os .remove (file_n )
151
+
140
152
def refresh_markers (self ):
141
153
print ("-> INFO Refreshing Markers " )
142
154
(Data .i_sdk_start , Data .i_sdk_end ) = FileHandler .find_marker_indices (Data .old_series , SDK_MARKER )
@@ -187,6 +199,7 @@ def perform(self):
187
199
self .refresh_markers ()
188
200
self .add_new_patch_series ()
189
201
self .process_update ()
202
+ self .cleanup_old_patches ()
190
203
patch_table = self .fetch_patch_table (os .path .join (self .args .patches , Data .k_dir ))
191
204
slk_msg = self .create_commit_msg (patch_table )
192
205
if self .args .slk_msg :
You can’t perform that action at this time.
0 commit comments