Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2023-08-25 20:04:40 +09:00
parent 184dda0e00
commit fe5793f0ba
1 changed files with 18 additions and 5 deletions

View File

@ -8,6 +8,8 @@
* locations, based o the build base and architecture
"""
import os
import sys
from io import StringIO
import collections
from pathlib import Path
import shutil
@ -22,7 +24,16 @@ BINARYPTH = "/fusato/config/include.binary"
BOOTSTRAP = "/fusato/config/includes.bootstrap"
FUSATOCONFIG = "/fusato/config"
class Processing(list):
def __enter__(self):
self._stdout = sys.stdout
sys.stdout = self._stringio = StringIO()
return self
def __exit__(self, *args):
self.extend(self._stringio.getvalue().splitlines())
del self._stringio # free up some memory
sys.stdout = self._stdout
class ChrootFolders:
"""
@ -53,10 +64,12 @@ class ChrootFolders:
for size_length in range(chroot_size_q):
source = chroot_src_q.popleft()
des = chroot_des_q.popleft()
shutil.copytree(HOME_FOLDER + source,
HOME_FOLDER + WPCHROOT + des,
dirs_exist_ok = True
)
with Processing() as output:
shutil.copytree(HOME_FOLDER + source,
HOME_FOLDER + WPCHROOT + des,
dirs_exist_ok = True
)
class BinaryFolders: