Attempt to resolve RLBT#0000133

This commit is contained in:
Louis Abel 2022-06-30 13:14:27 -07:00
parent 2c3409de51
commit 7f6f7babf5
Signed by: label
GPG Key ID: B37E62D143879B36
3 changed files with 67 additions and 1 deletions

View File

@ -8,6 +8,7 @@ from empanadas.util.check import (
from empanadas.util.shared import (
Shared,
ArchCheck,
)
from empanadas.util.dnf_utils import (

View File

@ -35,7 +35,7 @@ import productmd.treeinfo
from jinja2 import Environment, FileSystemLoader
from empanadas.common import Color, _rootdir
from empanadas.util import Shared
from empanadas.util import Shared, ArchCheck
class IsoBuild:
"""
@ -710,6 +710,48 @@ class IsoBuild:
Syncs data from a non-disc set of images to the appropriate repo. Repo
and image MUST match names for this to work.
"""
pathway = os.path.join(
self.compose_latest_sync,
repo,
arch,
'os'
)
src_to_image = os.path.join(
self.lorax_work_dir,
arch,
repo
)
if not force_unpack:
found_files = []
for y in ArchCheck.archfile[arch]:
imgpath = os.path.join(
pathway,
y
)
if os.path.exists(imgpath):
found_files.append(y)
if os.path.exists(pathway + '/images/boot.iso'):
found_files.append('/images/boot.iso')
if len(found_files) > 0:
self.log.warn(
'[' + Color.BOLD + Color.YELLOW + 'WARN' + Color.END + '] ' +
'Images and data for ' + repo + ' and ' + arch + ' already exists.'
)
return
self.log.info(
'[' + Color.BOLD + Color.GREEN + 'INFO' + Color.END + '] ' +
'Copying images and data for ' + repo + ' ' + arch
)
try:
shutil.copytree(src_to_image, pathway, copy_function=shutil.copy2, dirs_exist_ok=True)
except:
self.log.error('%s already exists??' % repo)
def run_boot_sync(self):
"""

View File

@ -4,6 +4,29 @@ import os
import hashlib
import productmd.treeinfo
class ArchCheck:
"""
Arches and their files
"""
archfile = {
'x86_64': [
'isolinux/vmlinuz',
'images/grub.conf',
'EFI/BOOT/BOOTX64.EFI'
],
'aarch64': [
'EFI/BOOT/BOOTAA64.EFI'
],
'ppc64le': [
'ppc/bootinfo.txt',
'ppc/ppc64/vmlinuz'
],
's390x': [
'generic.ins',
'images/generic.prm'
]
}
class Shared:
"""
Quick utilities that may be commonly used