@@ -30,6 +30,7 @@ def os_cmd(cmd, cwd=None, shell=False):
30
30
Args:
31
31
cmd: string command to execute.
32
32
cwd: directory where to run command
33
+ shell: boolean to enable command interpretation by the shell
33
34
34
35
Returns:
35
36
return the returncode of the command after execution.
@@ -147,7 +148,8 @@ def clone_cube_repo(self):
147
148
# with the most recent one created being the last entry.
148
149
os_cmd (("git" , "checkout" , branch ), cwd = self .stm32cube_serie_path )
149
150
self .version_tag = subprocess .check_output (
150
- "git tag -l" , cwd = self .stm32cube_serie_path
151
+ ("git" , "tag" , "-l" ),
152
+ cwd = self .stm32cube_serie_path
151
153
).splitlines ()
152
154
self .version_tag = [x .decode ("utf-8" ) for x in self .version_tag ]
153
155
# Set latest version
@@ -275,11 +277,12 @@ def extract_source(self):
275
277
)
276
278
os_cmd (
277
279
(
278
- "cp" ,
279
- "-r" ,
280
- str (stm32cube_drivers_src_path ) + "/*.*" ,
281
- str (temp_drivers_src_path ),
282
- )
280
+ "cp " +
281
+ "-r " +
282
+ str (stm32cube_drivers_src_path ) + "/*.* " +
283
+ str (temp_drivers_src_path )
284
+ ),
285
+ shell = True ,
283
286
)
284
287
285
288
def build_from_current_cube_version (self ):
@@ -342,18 +345,10 @@ def build_patch_from_current_zephyr_version(self):
342
345
"Building patch from " + self .current_version + " to current module"
343
346
)
344
347
os_cmd (
345
- (
346
- "git" ,
347
- "diff" ,
348
- "--ignore-space-at-eol" ,
349
- "HEAD~1" ,
350
- ">>" ,
351
- "module.patch" ,
352
- ),
348
+ "git diff --ignore-space-at-eol HEAD~1 >> module.patch" ,
353
349
shell = True ,
354
350
cwd = self .stm32cube_temp ,
355
351
)
356
-
357
352
os_cmd (("dos2unix" , "module.patch" ), cwd = self .stm32cube_temp )
358
353
359
354
hal_conf = (
@@ -366,13 +361,13 @@ def build_patch_from_current_zephyr_version(self):
366
361
if hal_conf .exists ():
367
362
os_cmd (
368
363
(
369
- "git" ,
370
- "diff" ,
371
- "HEAD@{1}" ,
372
- "--" ,
373
- str (hal_conf ),
374
- ">>" ,
375
- str (hal_conf_patch ),
364
+ "git " +
365
+ "diff " +
366
+ "HEAD@{1} " +
367
+ "-- " +
368
+ str (hal_conf ) +
369
+ " >> " +
370
+ str (hal_conf_patch )
376
371
),
377
372
shell = True ,
378
373
cwd = self .stm32cube_temp ,
@@ -542,7 +537,8 @@ def build_from_latest_version(self):
542
537
543
538
# Get the commit id of this latest version
544
539
self .latest_commit = subprocess .check_output (
545
- "git rev-parse HEAD" , cwd = self .stm32cube_serie_path
540
+ ("git" , "rev-parse" , "HEAD" ),
541
+ cwd = self .stm32cube_serie_path
546
542
).decode ("utf-8" )
547
543
548
544
# clear previous version content before populating with latest version
@@ -605,7 +601,7 @@ def apply_zephyr_patch(self):
605
601
# Generate a patch for each file in the module
606
602
607
603
os_cmd (
608
- ( "git" , " diff" , " HEAD~1" , ">>" , " new_version.patch") ,
604
+ "git diff HEAD~1 >> new_version.patch" ,
609
605
shell = True ,
610
606
cwd = self .stm32cube_temp ,
611
607
)
0 commit comments