farpatch / frogfs

Frogfs support, supporting compressed files
Mozilla Public License 2.0
0 stars 0 forks source link

2 minor issues with preprocess.py and functions.cmake #1

Closed taliesin closed 2 months ago

taliesin commented 2 months ago

First things first ... Thanks for the simplification work done on jkent/frogfs, it made it quite easy to incorporate this into my ESP32 project.

I got actually 2 minor issues with the code. Usually I do pull requests, but this is just 3 lines as a whole, so the diffs should work sufficiently enough.

  1. in tools/preprocess.py, the bug prevents unknown filter entries.
    
    diff --git a/tools/preprocess.py b/tools/preprocess.py
    index 6f8ea7f..90ce202 100755
    --- a/tools/preprocess.py
    +++ b/tools/preprocess.py
    @@ -40,7 +40,8 @@ def load_config(user_config_file=None):
                 else:
                     if sec_name == "filters":
                         if subsec_name not in config[sec_name]:
    -                            config[sec_name] = []
    +                            config[sec_name][subsec_name] = []
                         if isinstance(config[sec_name][subsec_name], str):
                             config[sec_name][subsec_name] = [
                                 config[sec_name][subsec_name]

2. in cmake/functions.cmake, this left-over prevents the multiple generation of frogfs 'partitions'

diff --git a/cmake/functions.cmake b/cmake/functions.cmake index 6edceb4..9a16d3b 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -41,7 +41,7 @@ function(target_add_frogfs target path) COMMAND ${CMAKE_COMMAND} -E make_directory ${output} COMMAND ${Python3_VENV} ${frogfs_DIR}/tools/preprocess.py ${config_json} --root ${PROJECT_BINARY_DIR}/CMakeFiles ${CMAKE_CURRENT_SOURCE_DIR}/${path} ${output} DEPENDS ${PROJECT_BINARY_DIR}/CMakeFiles/venv ${PROJECT_BINARY_DIR}/CMakeFiles/venv_requirements.stamp ${ARG_CONFIG}

xobs commented 2 months ago

Thanks for the patch suggestions! I've incorporated them wholesale.