Update: Refractored xfce builder
Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
parent
42ceebf094
commit
e851a2fb16
|
@ -211,17 +211,17 @@ cmbomenu = ttk.Combobox(pwin)
|
|||
cmbomenu.place(x=10, y=135)
|
||||
cmbomenu['values'] = list(categories.values())
|
||||
icon_default_text = 'Set the icon with the "Icon" button'
|
||||
icon_value = tk.Text(pwin, height=1, width=36)
|
||||
icon_value = tk.Text(pwin, height=1, width=32)
|
||||
icon_value.insert(tk.END, icon_default_text)
|
||||
icon_value.place(x=10, y=280)
|
||||
icon_button = ttk.Button(pwin, text="Icon", width=7, cursor="hand2",
|
||||
bootstyle="light-outline", command=select_icon
|
||||
)
|
||||
icon_button.place(x=232, y=324)
|
||||
icon_button.place(x=90, y=324)
|
||||
url_default_text = "example: https://www.example.com"
|
||||
urladdr_label = ttk.Label(pwin, text="Enter the Url:")
|
||||
urladdr_label.place(x=10, y=172)
|
||||
urladdr_value = tk.Text(pwin, height=3, width=36)
|
||||
urladdr_value = tk.Text(pwin, height=3, width=32)
|
||||
urladdr_value.insert(tk.END, url_default_text)
|
||||
urladdr_value.place(x=10, y=200)
|
||||
|
||||
|
@ -250,7 +250,7 @@ cmbo.place(x=330, y=80)
|
|||
cmbo['values'] = fill_dropdown()
|
||||
runaddr_label = ttk.Label(pwin, text="Url Address:")
|
||||
runaddr_label.place(x=330, y=125)
|
||||
runaddr_value = tk.Text(pwin, height=4, width=36)
|
||||
runaddr_value = tk.Text(pwin, height=4, width=32)
|
||||
runaddr_value.place(x=330, y=150)
|
||||
btnrun = ttk.Button(
|
||||
pwin,
|
||||
|
|
|
@ -6,10 +6,11 @@
|
|||
* Build the ISOs for the system to be deployed
|
||||
"""
|
||||
import os
|
||||
import logging
|
||||
from pathlib import Path
|
||||
import argparse
|
||||
import collections
|
||||
import logging
|
||||
|
||||
import conf
|
||||
import infra
|
||||
import inflate_bubble
|
||||
|
@ -57,31 +58,19 @@ class BuildXfce:
|
|||
"""
|
||||
Helper for the lb setup this is shared for all builds
|
||||
"""
|
||||
if self.sbase == "deb":
|
||||
if self.sarch[1:] == "64":
|
||||
lbsetup = conf.LBSET_DEB64
|
||||
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
|
||||
|
||||
lbset_dict = {
|
||||
"deb": {"64": conf.LBSET_DEB64, "32": conf.LBSET_DEB32,
|
||||
"arm": conf.LBSET_DEBARM},
|
||||
"dev": {"64": conf.LBSET_DEV64, "32": conf.LBSET_DEV32,
|
||||
"arm": conf.LBSET_DEVARM},
|
||||
}
|
||||
lbsetup = lbset_dict.get(self.sbase, {}).get(self.sarch[1:])
|
||||
if lbsetup:
|
||||
os.system(lbsetup)
|
||||
else:
|
||||
raise ValueError(f"Unsupported combination: {self.sbase},
|
||||
{self.sarch}"
|
||||
)
|
||||
|
||||
def infra_helper(self):
|
||||
"""
|
||||
|
@ -97,29 +86,15 @@ class BuildXfce:
|
|||
"""
|
||||
Helper for the xfce desktop shared for all builds
|
||||
"""
|
||||
if self.sarch[1:] == "64":
|
||||
cmd_list = collections.deque(conf.build64_xfce_build)
|
||||
list_size = len(cmd_list)
|
||||
for _ in range(list_size):
|
||||
i = cmd_list.popleft()
|
||||
execute = i + '()'
|
||||
exec(execute)
|
||||
elif self.sarch[1:] == "32":
|
||||
cmd_list = collections.deque(conf.build32_xfce_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_xfce_build)
|
||||
list_size = len(cmd_list)
|
||||
for _ in range(list_size):
|
||||
i = cmd_list.popleft()
|
||||
execute = i + '()'
|
||||
exec(execute)
|
||||
else:
|
||||
cmd_list = None
|
||||
cmd_list = {
|
||||
"64": conf.build64_xfce_build,
|
||||
"32": conf.build32_xfce_build,
|
||||
"arm": conf.buildarm_xfce_build,
|
||||
}
|
||||
arch_cmds = cmd_list.get(self.sarch[1:])
|
||||
if arch_cmds:
|
||||
for command in arch_cmds:
|
||||
getattr(conf, command)()
|
||||
|
||||
|
||||
def cleanup_helper(self):
|
||||
|
@ -127,37 +102,48 @@ class BuildXfce:
|
|||
finish_cleanup.make_check_sum()
|
||||
finish_cleanup.check_build_type_xfce()
|
||||
finish_cleanup.kill_old_iso()
|
||||
|
||||
|
||||
|
||||
def build_system(self):
|
||||
""" Builds the ISO XFCE Depedning on the Arch """
|
||||
"""Builds the ISO XFCE Depending on the Arch"""
|
||||
current_working_directory = os.getcwd()
|
||||
dir_current = WRKING_DIR + current_working_directory
|
||||
logger.info("Building a " + self.sbase + self.sarch[1:] + " bit ISO")
|
||||
logger.info(f"Building a {self.sbase}{self.sarch[1:]} bit ISO")
|
||||
logger.info(dir_current)
|
||||
|
||||
# Set the config tree
|
||||
self.lb_helper()
|
||||
|
||||
# Start with the XFCE stuff
|
||||
self.xfce_helper()
|
||||
|
||||
# Run the specific classes
|
||||
self.infra_helper()
|
||||
|
||||
# Run the Build
|
||||
logger.info(CFG_READY)
|
||||
logger.info(START_LIVEBUILD)
|
||||
logger.info(dir_current)
|
||||
self.lb_helper()
|
||||
|
||||
run_cmd = 'sudo lb build'
|
||||
current_working_directory = os.getcwd()
|
||||
os.chdir(HOME_FOLDER + FUSATO_ROOT)
|
||||
# Set the build inidcator
|
||||
|
||||
# Set the build indicator
|
||||
inflate_bubble.make_bld_xfce(self.sbase, self.sarch[1:])
|
||||
logger.info(dir_current)
|
||||
|
||||
os.chdir(HOME_FOLDER + FUSATO_ROOT)
|
||||
current_working_directory = os.getcwd()
|
||||
|
||||
# Execute the build command
|
||||
os.system(run_cmd)
|
||||
|
||||
logger.info(BUILD_COMPLETED)
|
||||
logger.info(dir_current)
|
||||
self.cleanup_helper()
|
||||
logger.info(BUILD_COMPLETED)
|
||||
|
||||
# Perform cleanup
|
||||
self.cleanup_helper()
|
||||
|
||||
logger.info(BUILD_COMPLETED)
|
||||
|
||||
|
||||
class BuildGflashback:
|
||||
|
|
Loading…
Reference in New Issue