Skip to content

Commit

Permalink
make the chroot_to_dist method more generic
Browse files Browse the repository at this point in the history
this means we do not have to add entries for new versions, just for new
distributions or families
  • Loading branch information
evgeni committed May 23, 2024
1 parent 80f19f1 commit 59c1733
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions theforeman.org/pipelines/lib/copr.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ def copr_repos(package_name) {
}

def convert_to_dist(chroot) {
if(chroot == 'rhel-9-x86_64') {
return 'el9'
} else if(chroot == 'rhel-8-x86_64') {
return 'el8'
} else if(chroot == 'rhel-7-x86_64') {
return 'el7'
} else if(chroot == 'opensuse-leap-15.5-x86_64') {
return 'leap155'
} else {
return null
}
def family_map = ['rhel': 'el', 'centos-stream': 'el', 'opensuse-leap': 'leap']

chroot_parts = chroot.split('-')
os = chroot_parts[0..-3].join('-')
version = chroot_parts[-2].replace('.', '')

return "${family_map[os]}${version}"
}

0 comments on commit 59c1733

Please sign in to comment.