From f46d8764dd04dc8e7d9bd51afec04889de2a9308 Mon Sep 17 00:00:00 2001 From: manuel Date: Sun, 22 Sep 2024 17:01:07 +0000 Subject: [PATCH] updating def make_check_sum --- python_modules/finish_cleanup.py | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/python_modules/finish_cleanup.py b/python_modules/finish_cleanup.py index ae233346..ee5ff529 100644 --- a/python_modules/finish_cleanup.py +++ b/python_modules/finish_cleanup.py @@ -33,19 +33,35 @@ string_home = str(home_folder) def make_check_sum(): - """ Generate the check sum files """ + """ Generate the checksum files """ os.chdir(HOME_FOLDER + FUSATO_ROOT) - current_working_directory = os.getcwd().replace('/', '/') - for _, _, files in os.walk(current_working_directory): - current_dir = os.getcwd().replace('/', '/') - for root, dirs, files in os.walk(current_dir): + current_working_directory = os.getcwd().replace('\\', '/') + + # Using only one os.walk loop + for root, dirs, files in os.walk(current_working_directory): for fiso in files: if fiso.endswith('.iso'): sha = "sha512sum " - ext = "-sha512.checksum" - gen_sum = sha + fiso + ' >' + fiso + ext + ext = ".sha512.checksum" + gen_sum = sha + os.path.join(root, fiso) + ' > ' + os.path.join(root, fiso) + ext os.system(gen_sum) +#def make_check_sum(): +# """ Generate the check sum files """ +# os.chdir(HOME_FOLDER + FUSATO_ROOT) +# current_working_directory = os.getcwd().replace('/', '/') +# +# for _, _, files in os.walk(current_working_directory): +# current_dir = os.getcwd().replace('/', '/') +# +# # Second os.walk() loop properly indented +# for root, dirs, files in os.walk(current_dir): +# for fiso in files: +# if fiso.endswith('.iso'): +# sha = "sha512sum " +# ext = "-sha512.checksum" +# gen_sum = sha + fiso + ' >' + fiso + ext +# os.system(gen_sum) def process_iso(base, arch, desktop): """