Testing: Updated Modules

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2023-12-12 21:11:09 +09:00
parent 39cca49267
commit 8da69b3d8f
1 changed files with 58 additions and 97 deletions

View File

@ -132,10 +132,14 @@ class BuildGflashback:
Determine what base to use and then build the ISO
"""
def __init__(self, sbase, sarch):
""" init the build process"""
self.sbase = sbase
self.sarch = sarch
# Change to the root of Fusato
# then run the buils
self.change_to_fusato_root_and_build()
def change_to_fusato_root_and_build(self):
""" change to the correct folder for the build """
os.chdir(HOME_FOLDER + FUSATO_ROOT)
self.build_system()
@ -144,75 +148,46 @@ class BuildGflashback:
"""
Helper for the lb setup this is shared for all builds
"""
if self.sbase == "deb":
if self.sarch[1:] == "64":
lbsetup = conf.LBSET_DEB64
lbsetup = None
if self.sbase in ["deb", "dev"]:
arch_suffix = self.sarch[1:]
if arch_suffix in ["64", "32", "arm"]:
lbsetup = getattr(conf,
f"LBSET_{self.sbase.upper()}{arch_suffix}"
)
os.system(lbsetup)
elif self.sarch[1:] == "32":
lbsetup = conf.LBSET_DEB32
os.system(lbsetup)
elif self.sarch[1:] == "arm":
lbsetup = conf.LBSET_DEBARM
os.system(lbsetup)
else:
lbsetup = None
elif self.sbase == "dev":
if self.sarch[1:] == "64":
lbsetup = conf.LBSET_DEV64
os.system(lbsetup)
elif self.sarch[1:] == "32":
lbsetup = conf.LBSET_DEV32
os.system(lbsetup)
elif self.sarch[1:] == "arm":
lbsetup = conf.LBSET_DEVARM
os.system(lbsetup)
else:
lbsetup = None
return lbsetup
def infra_helper(self):
"""
Helper for the infra classes this is shared for all builds
"""
infra.ChrootFolders(self.sbase, self.sarch)
infra.BinaryFolders(self.sbase, self.sarch)
infra.ArchitectureFiles(self.sbase, self.sarch)
infra.Archive(self.sbase, self.sarch)
infra_methods = [infra.ChrootFolders, infra.BinaryFolders,
infra.ArchitectureFiles, infra.Archive
]
for method in infra_methods:
method(self.sbase, self.sarch)
def gfb_helper(self):
"""
Helper for the gfb desktop shared for all builds
"""
if self.sarch[1:] == "64":
cmd_list = collections.deque(conf.build64_gfb_build)
list_size = len(cmd_list)
for _ in range(list_size):
i = cmd_list.popleft()
execute = i + '()'
arch_suffix = self.sarch[1:]
cmd_list = None
if arch_suffix in ["64", "32", "arm"]:
cmd_list = getattr(conf, f"build{arch_suffix}_gfb_build", [])
for command in cmd_list:
execute = command + '()'
exec(execute)
elif self.sarch[1:] == "32":
cmd_list = collections.deque(conf.build32_gfb_build)
list_size = len(cmd_list)
for _ in range(list_size):
i = cmd_list.popleft()
execute = i + '()'
exec(execute)
elif self.sarch[1:] == "arm":
cmd_list = collections.deque(conf.buildarm_gfb_build)
list_size = len(cmd_list)
for _ in range(list_size):
i = cmd_list.popleft()
execute = i + '()'
exec(execute)
else:
cmd_list = None
return cmd_list
def cleanup_helper(self):
""" Clean up Helper to move the ISOs to the nightly location """
finish_cleanup.make_check_sum()
finish_cleanup.check_build_type_xfce()
finish_cleanup.check_build_type_gfb()
finish_cleanup.kill_old_iso()
@ -302,55 +277,41 @@ class Decsions:
def dgnomefb(self):
""" Arguments for the gnomefb """
if self.arguments.e == 'e-gnomefb':
if self.arguments.b == 'b-deb64':
readybuild()
BuildGflashback("deb", "_64")
elif self.arguments.b == 'b-deb32':
readybuild()
BuildGflashback("deb", "_32")
elif self.arguments.b == 'b-debarm':
readybuild()
BuildGflashback("deb", "_arm")
elif self.arguments.b == 'b-dev32':
readybuild()
BuildGflashback("dev", "_32")
elif self.arguments.b == 'b-dev64':
readybuild()
BuildGflashback("dev", "_64")
elif self.arguments.b == 'b-devarm':
readybuild()
BuildGflashback("dev", "_arm")
else:
logger.critical("You have not specified a build to process!")
build_type_mapping = {
'b-deb64': ("deb", "_64"),
'b-deb32': ("deb", "_32"),
'b-dev64': ("dev", "_64"),
'b-dev32': ("dev", "_32"),
'b-debarm': ("deb", "_arm"),
'b-devarm': ("dev", "_arm"),
}
build_argument = self.arguments.b
if build_argument in build_type_mapping:
readybuild()
BuildGflashback(*build_type_mapping[build_argument])
else:
logger.critical("You have not specified a build to process!")
def dopenbox(self):
""" Arguments for the openbox """
if self.arguments.e == 'e-openbox':
if self.arguments.b == 'b-deb64':
readybuild()
print('run openbox builds deb64')
elif self.arguments.b == 'b-deb32':
readybuild()
print('run openbox builds deb32')
elif self.arguments.b == 'b-dev64':
readybuild()
print('run openbox builds dev64')
elif self.arguments.b == 'b-dev32':
readybuild()
print('run openbox builds dev32')
elif self.arguments.b == 'b-debarm':
readybuild()
print('run openbox builds debarm')
elif self.arguments.b == 'b-devarm':
readybuild()
print('run openbox builds devarm')
else:
print('You have not specified a valid '
'build architecture!!')
build_type_mapping = {
'b-deb64': ("deb", "_64"),
'b-deb32': ("deb", "_32"),
'b-dev64': ("dev", "_64"),
'b-dev32': ("dev", "_32"),
'b-debarm': ("deb", "_arm"),
'b-devarm': ("dev", "_arm"),
}
build_argument = self.arguments.b
if build_argument in build_type_mapping:
pass
#readybuild()
#BuildGflashback(*build_type_mapping[build_argument])
else:
logger.critical("You have not specified a valid "
"desktop environment!!")
logger.critical("You have not specified a build to process!")
Decsions()