Skip to content

Commit 838e072

Browse files
authored
Refactor string formatting to be whitespace safe in path
1 parent ada05db commit 838e072

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

builder/frameworks/espidf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,13 +1435,13 @@ def preprocess_linker_file(src_ld_script, target_ld_script):
14351435
" ".join(
14361436
[
14371437
f'"{CMAKE_DIR}"',
1438-
"-DCC=%s" % str(Path(TOOLCHAIN_DIR) / "bin" / "$CC"),
1438+
f'-DCC="{str(Path(TOOLCHAIN_DIR) / "bin" / "$CC")}"',
14391439
"-DSOURCE=$SOURCE",
14401440
"-DTARGET=$TARGET",
1441-
"-DCONFIG_DIR=%s" % str(Path(BUILD_DIR) / "config"),
1442-
"-DLD_DIR=%s" % str(Path(FRAMEWORK_DIR) / "components" / "esp_system" / "ld"),
1441+
f'-DCONFIG_DIR="{str(Path(BUILD_DIR) / "config")}"',
1442+
f'-DLD_DIR="{str(Path(FRAMEWORK_DIR) / "components" / "esp_system" / "ld")}"',
14431443
"-P",
1444-
str(Path("$BUILD_DIR") / "esp-idf" / "esp_system" / "ld" / "linker_script_generator.cmake"),
1444+
f'"{str(Path("$BUILD_DIR") / "esp-idf" / "esp_system" / "ld" / "linker_script_generator.cmake")}"',
14451445
]
14461446
),
14471447
"Generating LD script $TARGET",
@@ -1485,11 +1485,11 @@ def generate_mbedtls_bundle(sdk_config):
14851485
" ".join(
14861486
[
14871487
f'"{CMAKE_DIR}"',
1488-
"-DDATA_FILE=" + bundle_path,
1489-
"-DSOURCE_FILE=%s.S" % bundle_path,
1488+
f'-DDATA_FILE="{bundle_path}"',
1489+
f'-DSOURCE_FILE="{bundle_path}.S"',
14901490
"-DFILE_TYPE=BINARY",
14911491
"-P",
1492-
str(Path(FRAMEWORK_DIR) / "tools" / "cmake" / "scripts" / "data_file_embed_asm.cmake"),
1492+
f'"{str(Path(FRAMEWORK_DIR) / "tools" / "cmake" / "scripts" / "data_file_embed_asm.cmake")}"',
14931493
]
14941494
),
14951495
"Generating assembly for certificate bundle...",

0 commit comments

Comments
 (0)