mirror of
https://github.com/terrapkg/packages.git
synced 2026-06-23 20:10:40 +00:00
7d8314cf4e
(cherry picked from commit d6980b84eb)
Co-authored-by: madomado <madonuko@outlook.com>
30 lines
949 B
Plaintext
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];
|
|
}
|
|
}
|
|
}
|