TRY: testing if all_modules issue is fixed

This commit is contained in:
2023-08-22 15:53:36 +02:00
parent a9877b98e5
commit 25deba629f

View File

@ -93,15 +93,28 @@ def db_check_diff(current_pmodule_state, Pmodules_db_path, Pmodules_states):
) )
no_current_db = True no_current_db = True
# There is a database and we have to check the differences between the pmodule states. # Make sure the whitespaces in between the module descriptions are always one space only.
if not no_current_db and compare_states_sha( # There is a database
current_pmodule_state, old_pmodule_state, current_sha if not no_current_db:
): current_db = set(
print_pmodules_differences( " ".join(i.split()) for i in current_pmodule_state.splitlines()
current_pmodule_state, old_pmodule_state, Pmodules_states, Pmodules_db_path
) )
else: old_db = set(" ".join(i.split()) for i in old_pmodule_state.splitlines())
print_to_asciidoc([], [], [], [], Pmodules_db_path) all_module_list = list(current_db)
# We have to check the differences between the pmodule states.
if compare_states_sha(current_pmodule_state, old_pmodule_state, current_sha):
new_module_list = list(current_db - old_db)
deleted_module_list = list(old_db - current_db)
print_pmodules_differences(
all_module_list,
new_module_list,
deleted_module_list,
Pmodules_states,
Pmodules_db_path,
)
else:
print_to_asciidoc(all_module_list, [], [], [], Pmodules_db_path)
# There is no database available or there are differences with the old pmodule state, writing current state. # There is no database available or there are differences with the old pmodule state, writing current state.
if no_current_db or compare_states_sha( if no_current_db or compare_states_sha(
@ -124,15 +137,12 @@ def print_to_asciidoc(
def print_pmodules_differences( def print_pmodules_differences(
current_pmodule_state, old_pmodule_state, Pmodules_states, Pmodules_db_path all_module_list,
new_module_list,
deleted_module_list,
Pmodules_states,
Pmodules_db_path,
): ):
# Make sure the whitespaces in between the module descriptions are always one space only.
current_db = set(" ".join(i.split()) for i in current_pmodule_state.splitlines())
old_db = set(" ".join(i.split()) for i in old_pmodule_state.splitlines())
all_module_list = list(current_db)
new_module_list = list(current_db - old_db)
deleted_module_list = list(old_db - current_db)
changed_module_list = [] changed_module_list = []
# Replace the state of the modules with * for Regex comparison # Replace the state of the modules with * for Regex comparison