From 6aa1bfe1f18da72a2d0d26346195cf6722c8968c Mon Sep 17 00:00:00 2001 From: Jean Jonethal Date: Fri, 27 Dec 2024 19:47:23 +0100 Subject: [PATCH 1/2] convert windows path delimiter to posix (#2149) --- src/rp2_common/pico_lwip/tools/makefsdata.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rp2_common/pico_lwip/tools/makefsdata.py b/src/rp2_common/pico_lwip/tools/makefsdata.py index 88fca43a6..44a162518 100755 --- a/src/rp2_common/pico_lwip/tools/makefsdata.py +++ b/src/rp2_common/pico_lwip/tools/makefsdata.py @@ -24,8 +24,8 @@ def process_file(input_dir, file): content_type = "application/octet-stream" # file name - data = f"/{file.relative_to(input_dir)}\x00" - comment = f"\"/{file.relative_to(input_dir)}\" ({len(data)} chars)" + data = f"/{file.relative_to(input_dir).as_posix()}\x00" + comment = f"\"/{file.relative_to(input_dir).as_posix()}\" ({len(data)} chars)" while(len(data) % PAYLOAD_ALIGNMENT != 0): data += "\x00" results.append({'data': bytes(data, "utf-8"), 'comment': comment}); From 3a7f95dfff7339344d0173c9b8e90f2bee8eba05 Mon Sep 17 00:00:00 2001 From: Jean Jonethal Date: Sat, 28 Dec 2024 15:00:54 +0100 Subject: [PATCH 2/2] add explicite variable assignment for intermediate resource name conversion result (#2149) --- src/rp2_common/pico_lwip/tools/makefsdata.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rp2_common/pico_lwip/tools/makefsdata.py b/src/rp2_common/pico_lwip/tools/makefsdata.py index 44a162518..61312b5b8 100755 --- a/src/rp2_common/pico_lwip/tools/makefsdata.py +++ b/src/rp2_common/pico_lwip/tools/makefsdata.py @@ -23,9 +23,10 @@ def process_file(input_dir, file): if content_type is None: content_type = "application/octet-stream" - # file name - data = f"/{file.relative_to(input_dir).as_posix()}\x00" - comment = f"\"/{file.relative_to(input_dir).as_posix()}\" ({len(data)} chars)" + # file name with posix directory separators + file_path_posix = file.relative_to(input_dir).as_posix() + data = f"/{file_path_posix}\x00" + comment = f"\"/{file_path_posix}\" ({len(data)} chars)" while(len(data) % PAYLOAD_ALIGNMENT != 0): data += "\x00" results.append({'data': bytes(data, "utf-8"), 'comment': comment});