From 56bbe9a97ab97d2162b7fb3058376167611727c4 Mon Sep 17 00:00:00 2001 From: Renata Ravanelli Date: Tue, 30 May 2023 21:05:29 -0300 Subject: [PATCH] Change host rpms from cmd-koji-upload to cmd-build - Now that we decided to split the Brew part from the main build job, we need to store the host rpm list in S3 in order to use it after. - Add the rpm list from the host used to build the image in coreos-assembler-config-git.json Signed-off-by: Renata Ravanelli --- src/cmd-koji-upload | 8 +++----- src/cmdlib.sh | 9 ++++++++- src/cosalib/cmdlib.py | 11 +++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/cmd-koji-upload b/src/cmd-koji-upload index 495af86fa1..0543d45c7f 100755 --- a/src/cmd-koji-upload +++ b/src/cmd-koji-upload @@ -202,15 +202,13 @@ class Build(_Build): if host is None: rpms = self.commit["rpmostree.rpmdb.pkglist"] else: - host_rpms = subprocess.check_output('rpm -qa --qf="%{NAME}:%{EPOCH}:%{RELEASE}:%{VERSION}:%{ARCH}:%{SIGMD5}:%{SIGPGP} \n"', shell=True).strip() - rpms = (host_rpms.decode('utf-8')).split("\n") - + rpms = self.config["pkglist"] for rpm in rpms: if host is None: name, epoch, version, release, arch = rpm - sigmd5, sigpgp, epoch = None, None, None + sigmd5, sigpgp = None, None else: - name, epoch, release, version, arch, sigmd5, sigpgp = rpm.split(':') + name, epoch, version, release, arch, sigmd5, sigpgp = rpm entry = { "type": "rpm", "name": name, diff --git a/src/cmdlib.sh b/src/cmdlib.sh index f3c6acc0df..c8a0880ccb 100755 --- a/src/cmdlib.sh +++ b/src/cmdlib.sh @@ -942,6 +942,12 @@ prepare_git_artifacts() { info "Directory ${gitd}, is from branch ${branch}, commit ${rev}" + pkglist=$(python3 -c " +import sys +sys.path.insert(0, '${DIR}') +from cosalib import cmdlib +print(cmdlib.create_cosa_rpm_list())") + # shellcheck disable=SC2046 disable=SC2086 cat > "${json}" <