updating def make_check_sum

This commit is contained in:
manuel 2024-09-22 17:01:07 +00:00
parent d0699dae25
commit f46d8764dd
1 changed files with 23 additions and 7 deletions

View File

@ -35,17 +35,33 @@ string_home = str(home_folder)
def make_check_sum(): def make_check_sum():
""" Generate the checksum files """ """ Generate the checksum files """
os.chdir(HOME_FOLDER + FUSATO_ROOT) os.chdir(HOME_FOLDER + FUSATO_ROOT)
current_working_directory = os.getcwd().replace('/', '/') current_working_directory = os.getcwd().replace('\\', '/')
for _, _, files in os.walk(current_working_directory):
current_dir = os.getcwd().replace('/', '/') # Using only one os.walk loop
for root, dirs, files in os.walk(current_dir): for root, dirs, files in os.walk(current_working_directory):
for fiso in files: for fiso in files:
if fiso.endswith('.iso'): if fiso.endswith('.iso'):
sha = "sha512sum " sha = "sha512sum "
ext = "-sha512.checksum" ext = ".sha512.checksum"
gen_sum = sha + fiso + ' >' + fiso + ext gen_sum = sha + os.path.join(root, fiso) + ' > ' + os.path.join(root, fiso) + ext
os.system(gen_sum) 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): def process_iso(base, arch, desktop):
""" """