Testing: Module Mods

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2023-12-13 20:01:58 +09:00
parent 56c6adb4f6
commit 73d4e6fa12
1 changed files with 44 additions and 442 deletions

View File

@ -27,7 +27,7 @@ def make_check_sum():
""" Generate the check sum files """
os.chdir(HOME_FOLDER + FUSATO_ROOT)
current_working_directory = os.getcwd().replace('/', '/')
for root, dirs, files in os.walk(current_working_directory):
for _, _, files in os.walk(current_working_directory):
for fiso in files:
if fiso.endswith('.iso'):
sha = "sha512sum "
@ -35,6 +35,34 @@ def make_check_sum():
gen_sum = sha + fiso + ' >' + fiso + ext
os.system(gen_sum)
def process_iso(base, arch, desktop):
"""
Process the ISO for a given base, architecture, and desktop.
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = f"{BASE_NAME}-{base}_{arch}_{desktop.lower()}{today}.iso"
des_iso =(f"{BASE_DESTINATION}/{base.lower()}{arch}"
"/{desktop.lower()}")
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
elif files.endswith('.checksum'):
src_sum = files
rdes_sum = (
f"{BASE_NAME}{base.capitalize()}_{arch}_{desktop.lower()}"
"-sha512.checksum"
)
des_sum = (f"{BASE_DESTINATION}/{base.lower()}{arch}"
"/{desktop.lower()}"
)
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def check_build_type():
""" Decided which ISO needs to be moved for nightly """
@ -42,28 +70,28 @@ def check_build_type():
os.chdir(HOME_FOLDER + FUSATO_ROOT)
directory_path = HOME_FOLDER + FUSATO_ROOT
file_function_mapping = {
'deb.64xfc': process_deb_64_xfce,
'deb.32xfc': process_deb_32_xfce,
'deb.armxfc': process_deb_arm_xfce,
'dev.64xfc': process_dev_64_xfce,
'dev.32xfc': process_dev_32_xfce,
'dev.armxfc': process_dev_arm_xfce,
'deb.64gfb' : process_deb_64_gfb,
'deb.32gfb' : process_deb_32_gfb,
'deb.armgfb' : process_deb_arm_gfb,
'dev.64gfb' : process_dev_64_gfb,
'dev.32gfb' : process_dev_32_gfb,
'dev.armgfb' : process_dev_arm_gfb,
'deb.64xfc': ('deb', '64', 'XFCE'),
'deb.32xfc': ('deb', '32', 'XFCE'),
'deb.armxfc': ('deb', 'arm', 'XFCE'),
'dev.64xfc': ('dev', '64', 'XFCE'),
'dev.32xfc': ('dev', '32', 'XFCE'),
'dev.armxfc': ('dev', 'arm', 'XFCE'),
'deb.64gfb': ('deb', '64', 'GFB'),
'deb.32gfb': ('deb', '32', 'GFB'),
'deb.armgfb': ('deb', 'arm', 'GFB'),
'dev.64gfb': ('dev', '64', 'GFB'),
'dev.32gfb': ('dev', '32', 'GFB'),
'dev.armgfb': ('dev', 'arm', 'GFB'),
}
def check_build():
""" Check what build is there and call the correct process function """
for file_name, function_to_call in file_function_mapping.items():
for file_name, params in file_function_mapping.items():
file_path = os.path.join(directory_path, file_name)
if os.path.exists(file_path):
print(f"You are building a {file_name} ISO type")
function_to_call()
print(f"You are building a {params[0]} {params[1]} {params[2]} ISO type")
process_iso(*params)
else:
print(f"File {file_name} you're not building this ISO type!")
@ -71,432 +99,6 @@ def check_build_type():
check_build()
# Debian XFCE #
def process_deb_64_xfce():
"""
Copy the NEW 64 bit Debian base to its Nightly folder XFCE
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Debian_64_xfce'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'deb64/xfce'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Debian_64_xfce-sha512.checksum'
des_sum = BASE_DESTINATION + 'deb64/xfce'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def process_deb_32_xfce():
"""
Copy the NEW 32 bit Debian base to its Nightly folder XFCE
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Debian_32_xfce'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'deb32/xfce'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Debian_32_xfce-sha512.checksum'
des_sum = BASE_DESTINATION + 'deb32/xfce'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def process_deb_arm_xfce():
"""
Copy the NEW arm bit Debian base to its Nightly folder XFCE
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Debian_arm_xfce'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'debarm/xfce'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Debian_arm_xfce-sha512.checksum'
des_sum = BASE_DESTINATION + 'debarm/xfce'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
# Devuan XFCE #
def process_dev_64_xfce():
"""
Copy the NEW 64 bit Devuan base to its Nightly folder XFCE
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-devuan_64_xfce'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'dev64/xfce'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'devuan_64_xfce-sha512.checksum'
des_sum = BASE_DESTINATION + 'dev64/xfce'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def process_dev_32_xfce():
"""
Copy the NEW 32 bit Devuan base to its Nightly folder XFCE
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-devuan_32_xfce'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'dev32/xfce'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'devuan_32_xfce-sha512.checksum'
des_sum = BASE_DESTINATION + 'dev32/xfce'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def process_dev_arm_xfce():
"""
Copy the NEW arm bit Devuan base to its Nightly folder XFCE
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-devuan_arm_xfce'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'devarm/xfce'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'devuan_arm_xfce-sha512.checksum'
des_sum = BASE_DESTINATION + 'devarm/xfce'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
# Debian Gnome Flashback #
def process_deb_64_gfb():
"""
Copy the NEW 64 bit Debian base to its Nightly folder
GnomeFlashBack
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Debian_64_gfb'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'deb64/gnome-flashback'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Debian_64_gfb-sha512.checksum'
des_sum = BASE_DESTINATION + 'deb64/gnome-flashback'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def process_deb_32_gfb():
"""
Copy the NEW 32 bit Debian base to its Nightly folder
GnomeFlashBack
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Debian_32_gfb'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'deb32/gnome-flashback'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Debian_32_gfb-sha512.checksum'
des_sum = BASE_DESTINATION + 'deb32/gnome-flashback'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def process_deb_arm_gfb():
"""
Copy the NEW arm bit Debian base to its Nightly folder
GnomeFlashBack
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Debian_arm_gfb'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'debarm/gnome-flashback'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Debian_arm_gfb-sha512.checksum'
des_sum = BASE_DESTINATION + 'debarm/gnome-flashback'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
# Devuan Gnome Flashback
def process_dev_64_gfb():
"""
Copy the NEW 64 bit Devuan base to its Nightly folder
GnomeFlashBack
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Devuan_64_gfb'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'dev64/gnome-flashback'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Devuan_64_gfb-sha512.checksum'
des_sum = BASE_DESTINATION + 'dev64/gnome-flashback'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def process_dev_32_gfb():
"""
Copy the NEW 32 bit Devuan base to its Nightly folder
GnomeFlashBack
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Devuan_32_gfb'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'dev32/gnome-flashback'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Devuan_32_gfb-sha512.checksum'
des_sum = BASE_DESTINATION + 'dev32/gnome-flashback'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def process_dev_arm_gfb():
"""
Copy the NEW arm bit Devuan base to its Nightly folder
GnomeFlashBack
"""
current_working_directory = os.listdir(".")
today = str(date.today())
for files in current_working_directory:
if files.endswith('.iso'):
src_iso = files
rdes = (BASE_NAME + '-Devuan_arm_gfb'
+ today +
'.iso'
)
des_iso = BASE_DESTINATION + 'devarm/gnome-flashback'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if files.endswith('.checksum'):
src_sum = files
rdes_sum = BASE_NAME + 'Devuan_arm_gfb-sha512.checksum'
des_sum = BASE_DESTINATION + 'devarm/gnome-flashback'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
# Debian OpenBox
def copy_debian_opb_based():
""" Copy the new ISO debian base to its Nightly folder
OpenBox
"""
os.chdir(HOME_FOLDER + FUSATO_ROOT)
current_working_directory = os.listdir(".")
today = str(date.today())
look_for_file_64 = Path('deb.64opb')
look_for_file_32 = Path('deb.32opb')
look_for_file_arm = Path('deb.armopb')
if look_for_file_64.is_file():
for f_v in current_working_directory:
if f_v.endswith('.iso'):
src_iso = f_v
rdes = ('PeppermintOS-Debian_64_opb'
+ today +
'.iso'
)
des_iso = '/var/www/html/nightly/deb64/openbox'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if f_v.endswith('.checksum'):
src_sum = f_v
rdes_sum = 'PeppermintOS-Debian_64_opb-sha512.checksum'
des_sum = '/var/www/html/nightly/deb64/openbox'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
elif look_for_file_32.is_file():
for f_v in current_working_directory:
if f_v.endswith('.iso'):
src_iso = f_v
rdes = ('PeppermintOS-Debian_32_opb'
+ today +
'.iso'
)
des_iso = '/var/www/html/nightly/deb32/openbox'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if f_v.endswith('.checksum'):
src_sum = f_v
rdes_sum = 'PeppermintOS-Debian_32_opb-sha512.checksum'
des_sum = '/var/www/html/nightly/deb32/openbox'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
elif look_for_file_arm.is_file():
for f_v in current_working_directory:
if f_v.endswith('.iso'):
src_iso = f_v
rdes = ('PeppermintOS-Debian_arm_opb'
+ today +
'.iso'
)
des_iso = '/var/www/html/nightly/debarm/openbox'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if f_v.endswith('.checksum'):
src_sum = f_v
rdes_sum = 'PeppermintOS-Debian_arm_opb-sha512.checksum'
des_sum = '/var/www/html/nightly/debarm/openbox'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
# Devuan OpenBox
def copy_devuan_opb_based():
""" Copy the new ISO devuan base to its Nightly folder
OpenBox
"""
os.chdir(HOME_FOLDER + FUSATO_ROOT)
current_working_directory = os.listdir(".")
today = str(date.today())
look_for_file_64 = Path('dev.64opb')
look_for_file_32 = Path('dev.32opb')
look_for_file_arm = Path('dev.armopb')
if look_for_file_64.is_file():
for f_v in current_working_directory:
if f_v.endswith('.iso'):
src_iso = f_v
rdes = ('PeppermintOS-devuan_64_opb'
+ today +
'.iso'
)
des_iso = '/var/www/html/nightly/dev64/openbox'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if f_v.endswith('.checksum'):
src_sum = f_v
rdes_sum = 'PeppermintOS-devuan_64_opb-sha512.checksum'
des_sum = '/var/www/html/nightly/dev64/openbox'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
elif look_for_file_32.is_file():
for f_v in current_working_directory:
if f_v.endswith('.iso'):
src_iso = f_v
rdes = ('PeppermintOS-devuan_32_opb'
+ today +
'.iso'
)
des_iso = '/var/www/html/nightly/dev32/openbox'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if f_v.endswith('.checksum'):
src_sum = f_v
rdes_sum = 'PeppermintOS-devuan_32_opb-sha512.checksum'
des_sum = '/var/www/html/nightly/dev32/openbox'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
elif look_for_file_arm.is_file():
for f_v in current_working_directory:
if f_v.endswith('.iso'):
src_iso = f_v
rdes = ('PeppermintOS-devuan_arm_opb'
+ today +
'.iso'
)
des_iso = '/var/www/html/nightly/devarm/openbox'
os.rename(src_iso, rdes)
shutil.copy(rdes, des_iso)
if f_v.endswith('.checksum'):
src_sum = f_v
rdes_sum = 'PeppermintOS-devuan_arm_opb-sha512.checksum'
des_sum = '/var/www/html/nightly/devarm/openbox'
os.rename(src_sum, rdes_sum)
shutil.copy(rdes_sum, des_sum)
def kill_old_iso():
""" Delete older ISOs"""
base_path = BASE_DESTINATION