Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2023-08-25 12:52:52 +09:00
parent 879d9a6009
commit 8f77122f43
2 changed files with 33 additions and 31 deletions

View File

@ -41,20 +41,12 @@ class BuildXfce:
else:
print("No base has been found")
def run_build(self):
#def run_build(self):
""" Run and start the build process"""
run_cmd = 'sudo lb build'
os.chdir(HOME_FOLDER + FUSATO_ROOT)
running = os.system(run_cmd)
with subprocess.Popen(running,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT) as sp:
for line in iter(sp.stdout.readline, b''):
print(line.rstrip())
# run_cmd = 'sudo lb build'
# os.chdir(HOME_FOLDER + FUSATO_ROOT)
# os.system(run_cmd)
def debian_build(self):
"""
@ -62,9 +54,11 @@ class BuildXfce:
"""
if self.sarch == '_64':
# livebuild init
print("Begin Live Build init")
lbsetup = conf.lbset_deb64
os.system(lbsetup)
# Loop though commands
print("Run the 64 bit Debian commands"
cmd_list_64 = collections.deque(conf.build64_xfce_build)
list_size_64 = len(cmd_list_64)
for _ in range(list_size_64):
@ -72,16 +66,18 @@ class BuildXfce:
execute = i + '()'
exec(execute)
# Run the specific classes
print("Run the CHROOT, Binary and Arch Classes")
infra.ChrootFolders("deb", "_64")
infra.BinaryFolders("deb", "_64")
infra.ArchitectureFiles("deb", "_64")
# Run the Build
bld_list = collections.deque(conf.shared_run_build)
list_size = len(bld_list)
for _ in range(list_size):
i = bld_list.popleft()
execute = i + '()'
exec(execute)
print("Run the build commands forthe ISO")
#bld_list = collections.deque(conf.shared_run_build)
#list_size = len(bld_list)
#for _ in range(list_size):
# i = bld_list.popleft()
# execute = i + '()'
# exec(execute)
elif self.sarch == '_32':
lbsetup = conf.lbset_deb32
os.system(lbsetup)

View File

@ -30,14 +30,15 @@ class ChrootFolders:
the architecture it will, copy folders as needed
"""
def __init__(self,sbase,sarch):
print("Copy Chroot")
self.sbase = sbase
self.sarch = sarch
src_chroot = ('/osrelease/' + self.sbase + self.sarch,
'/osrelease/' + self.sbase + self.sarch,
'/grub/'+ self.sbase + self.sarch + '/grub',
'/grub/'+ self.sbase + self.sarch,
'/calamares_settings/' + self.sbase + self.sarch +
'/calamares/modules',
'/boot/grub/' + self.sbase + '_themes'
'/grub/' + self.sbase + '_themes'
)
des_chroot =('/usr/lib',
'/opt/pepconf',
@ -64,6 +65,7 @@ class BinaryFolders:
the architecture it will, copy folders as needed
"""
def __init__(self, sbase, sarch):
print("Copy Binary")
self.sbase = sbase
self.sarch = sarch
src_binary = ('/splash/' + self.sbase + self.sarch + '/boot',
@ -97,6 +99,7 @@ class ArchitectureFiles:
architecture it will, copy files as needed
"""
def __init__(self, sbase, sarch):
print("Copy Architecture")
self.sbase = sbase
self.sarch = sarch
calamares_path = '/calamares_settings/'
@ -139,6 +142,7 @@ def set_symlinks():
"""
Set the symliknks that are used for all builds.
"""
print("Copy symlinks")
pep_info = '/usr/share/python-apt/templates/Peppermint.info'
pep_mirror = '/usr/share/python-apt/templates/Peppermint.mirrors'
pep_csv = '/usr/share/distro-info/peppermint.csv'
@ -152,6 +156,7 @@ def shared_folders():
This function will get the files that are shared commonly amongst
all the builds,
"""
print("Copy Shared folders")
src_paths = ('/plymouth/lines',
'/application',
'/font',
@ -213,6 +218,7 @@ def icons_themes():
This function will get the icons and themse that are
for all the builds
"""
print("Copy icons and themes")
src_paths =('/theme/Marwaita Dark Debian/',
'/theme/Marwaita Dark Manjaro/',
'/theme/Marwaita Dark Peppermint/',
@ -240,14 +246,11 @@ def icons_themes():
size_q = len(src_q)
for size_length in range(size_q):
source = src_q.popleft()
des = des_q.popleft()
print('----' + HOME_FOLDER + source)
print('----' + HOME_FOLDER + WPCHROOT + des)
#shutil.copytree(HOME_FOLDER + source,
# HOME_FOLDER + WPCHROOT + des,
# dirs_exist_ok = True
# )
des = des_q.popleft()
shutil.copytree(HOME_FOLDER + source,
HOME_FOLDER + WPCHROOT + des,
dirs_exist_ok = True
)
def shared_files():
@ -255,6 +258,7 @@ def shared_files():
This silll copy all specific files that a used for all
builds.
"""
print("Copy Shared Files")
src_paths = ('/aliases/bash_aliases',
'/PepProTools/xDaily',
'/PepProTools/hub',
@ -291,6 +295,7 @@ def fusato_configs():
"""
Copy specific folders in the root of fusato configs
"""
print("Copy Shared Files")
src_paths = ('/hooks/normal',)
des_paths = ('/hooks/normal',)
src_q = collections.deque(src_paths)
@ -299,8 +304,6 @@ def fusato_configs():
for size_length in range(size_q):
source = src_q.popleft()
des = des_q.popleft()
print("----" + HOME_FOLDER + source )
print("----" + HOME_FOLDER + FUSATOCONFIG + des )
shutil.copytree(HOME_FOLDER + source,
HOME_FOLDER + FUSATOCONFIG + des,
dirs_exist_ok = True
@ -311,6 +314,7 @@ def boostrap_shared():
"""
Copy specific folders in the boostrap location
"""
print("Copy Shared BootStrap")
src_paths = ('/issue',)
des_paths = ('/etc',)
src_q = collections.deque(src_paths)
@ -329,6 +333,7 @@ def xfce_configs():
"""
Copy the xfce files.
"""
print("Copy xfce4 configs")
src_xfce = '/xfce/xfce4'
des_xfce = '/etc/skel/.config/xfce4'
shutil.copytree(HOME_FOLDER + src_xfce,
@ -347,6 +352,7 @@ def gnome_flahsbak_configs():
"""
Copy the gnome flashback files
"""
print("Copy Gnome Flashback configs")
src_gnomef = '/gnome-flashback'
des_gnomef = '/etc/skel/.config/gnome-flashback'
shutil.copytree(HOME_FOLDER + src_gnomef,
@ -355,4 +361,4 @@ def gnome_flahsbak_configs():
)
icons_themes()