From efabe943193d129dd52483b21488d65069e364e6 Mon Sep 17 00:00:00 2001 From: debianpepper Date: Fri, 25 Aug 2023 11:52:30 +0900 Subject: [PATCH] Updated build_iso Signed-off-by: debianpepper --- python_modules/build_iso.py | 37 ++++++++++++++++++++++++++++++++----- python_modules/conf.py | 2 +- python_modules/infra.py | 15 +++++++-------- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/python_modules/build_iso.py b/python_modules/build_iso.py index 78ccce2d..8770fcbf 100644 --- a/python_modules/build_iso.py +++ b/python_modules/build_iso.py @@ -6,6 +6,7 @@ * Move and copy files as needed """ import os +import subprocess import shutil from pathlib import Path import argparse @@ -45,6 +46,7 @@ class BuildXfce: run_cmd = 'sudo lb build' os.chdir(HOME_FOLDER + FUSATO_ROOT) os.system(run_cmd) + def debian_build(self): """ @@ -60,13 +62,38 @@ class BuildXfce: for _ in range(list_size_64): i = cmd_list_64.popleft() execute = i + '()' - exec(execute) + running = exec(execute) + 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 the specific classes - infra.ChrootFolders("deb", "_64") - infra.BinaryFolders("deb", "_64") - infra.ArchitectureFiles("deb", "_64") + chroot_class = infra.ChrootFolders("deb", "_64") + with subprocess.Popen(chroot_class, shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) as sp: + for line in iter(sp.stdout.readline, b''): + print(line.rstrip()) + binary_class = infra.BinaryFolders("deb", "_64") + with subprocess.Popen(binary_class, shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) as sp: + for line in iter(sp.stdout.readline, b''): + print(line.rstrip()) + arch_class = infra.ArchitectureFiles("deb", "_64") + with subprocess.Popen(arch_class, shell=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) as sp: + for line in iter(sp.stdout.readline, b''): + print(line.rstrip()) # Run the Build - self.run_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) elif self.sarch == '_32': lbsetup = conf.lbset_deb32 os.system(lbsetup) diff --git a/python_modules/conf.py b/python_modules/conf.py index 4b2fbdbe..37bec2f2 100644 --- a/python_modules/conf.py +++ b/python_modules/conf.py @@ -62,7 +62,7 @@ buildarm_xfce_build = (shared_setup_cmds + setup_xfce_cmds + ) ## These run the actual build process. -shared_run_build = ('run_build', +shared_run_build = ('self.run_build', 'finish_cleanup.make_check_sum', 'finish_cleanup.copy_iso_file_nightly_deb64', 'finish_cleanup.copy_iso_file_prod_deb64', diff --git a/python_modules/infra.py b/python_modules/infra.py index 7a6ee028..b81af2d5 100644 --- a/python_modules/infra.py +++ b/python_modules/infra.py @@ -109,8 +109,6 @@ class ArchitectureFiles: '/sources-final', calamares_path + self.sbase + self.sarch + '/bootloader-config', - calamares_path + self.sbase + self.sarch + - '/netinstall-packages', calamares_path + 'adddesktopicon/add-calamares-desktop-icon', sources_path + self.sbase + self.sarch + @@ -121,7 +119,6 @@ class ArchitectureFiles: '/usr/bin/install-peppermint', '/usr/sbin/sources-final', '/usr/sbin/bootloader-config', - '/etc/calamares/netinstall-packages', '/usr/bin/add-calamares-desktop-icon', '/opt/pepconf/sources.list', '/usr/share/peppermint/pep_id' @@ -244,11 +241,13 @@ def icons_themes(): for size_length in range(size_q): source = src_q.popleft() des = des_q.popleft() - shutil.copytree(HOME_FOLDER + source, + print('----' + HOME_FOLDER + source) + print('----' + HOME_FOLDER + WPCHROOT + des) - HOME_FOLDER + WPCHROOT + des, - dirs_exist_ok = True - ) + #shutil.copytree(HOME_FOLDER + source, + # HOME_FOLDER + WPCHROOT + des, + # dirs_exist_ok = True + # ) def shared_files(): @@ -356,4 +355,4 @@ def gnome_flahsbak_configs(): ) - +icons_themes()