Skip to content

Commit

Permalink
Change host rpms from koji to coreo-assembler
Browse files Browse the repository at this point in the history
Signed-off-by: Renata Ravanelli <[email protected]>
  • Loading branch information
ravanelli committed Jun 1, 2023
1 parent e92b5fe commit 54f61cc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/cmd-koji-upload
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -912,7 +910,7 @@ Environment variables are supported:
args = parser.parse_args(namespace=args)

build = Build(buildroot=args.buildroot, build=args.build, arch=args.arch)

build.get_rpm_list('host'),
if args.auth:
kinit(args.keytab, args.owner)

Expand Down
9 changes: 8 additions & 1 deletion src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}" <<EOC
{
Expand All @@ -951,7 +957,8 @@ prepare_git_artifacts() {
"origin": "${head_url}",
"branch": "${branch}",
"dirty": "${is_dirty}"
}
},
"pkglist": $pkglist
}
EOC

Expand Down
11 changes: 11 additions & 0 deletions src/cosalib/cmdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,14 @@ def ensure_glob(pathname, **kwargs):
def ncpu():
'''Return the number of usable CPUs we have for parallelism.'''
return int(subprocess.check_output(['kola', 'ncpu']))

def create_cosa_rpm_list():

host_rpms = subprocess.check_output('rpm -qa --qf="%{NAME}:%{EPOCH}:%{VERSION}:%{RELEASE}:%{ARCH}:%{SIGMD5}:%{SIGPGP} \n"', shell=True).strip()
rpms = (host_rpms.decode('utf-8')).split("\n")
components = []
for rpm in rpms:
name, epoch, version, release, arch, sigmd5, sigpgp = rpm.split(':')
entry = [name, epoch, version, release, arch, sigmd5, sigpgp]
components.append(entry)
return json.dumps(components)

0 comments on commit 54f61cc

Please sign in to comment.