Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change host rpms from koji to coreo-assembler #3498

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 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
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)