Files
packages/andax/bump_extras.rhai
T
Raboneko 7d8314cf4e feat(kf6-kio): per branch update scripts (#3202) (#3203)
(cherry picked from commit d6980b84eb)

Co-authored-by: madomado <madonuko@outlook.com>
2025-02-04 21:52:02 -06:00

30 lines
949 B
Plaintext

fn as_bodhi_ver(branch) {
if branch.starts_with("el") {
branch.crop(2);
if branch == "10" {
return "EPEL-10.0";
}
return `EPEL-${release}`;
} else if branch == "frawhide" {
return "42";
} else if branch.starts_with("f") {
branch.crop(1);
return branch;
} else {
print(`E: unsupported branch: ${labels.branch}`);
terminate();
}
}
fn bodhi(pkg, branch) {
let url = `https://bodhi.fedoraproject.org/updates/?search=${pkg}&status=stable&releases=${branch}&rows_per_page=1&page=1`;
for entry in get(url).json().updates[0].title.split(' ') {
let matches = find_all(`${pkg}-([\d.]+)-(\d+)\.[\w\d]+$`, entry);
// ──────── ───── .fc??
// version release
if matches.len() != 0 {
return matches[0][1];
}
}
}