mirror of
https://github.com/terrapkg/packages.git
synced 2026-06-23 20:10:40 +00:00
43 lines
1.2 KiB
Plaintext
43 lines
1.2 KiB
Plaintext
fn codeberg_commit(repo) {
|
|
return get(`https://codeberg.org/api/v1/repos/${repo}/commits?stat=false&verification=false&files=false&limit=1`).json_arr()[0].sha;
|
|
}
|
|
|
|
fn codeberg(repo) {
|
|
return get(`https://codeberg.org/api/v1/repos/${repo}/releases/latest`).json().tag_name;
|
|
}
|
|
|
|
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 "F43";
|
|
} 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`;
|
|
return find(`^${pkg}-([\d.]+)-\d+\.[\w\d]+$`, get(url).json().updates[0].title, 1);
|
|
}
|
|
|
|
|
|
fn madoguchi_json(pkg, branch) {
|
|
if branch.starts_with("f") {
|
|
branch.crop(1);
|
|
}
|
|
return get(`https://madoguchi.fyralabs.com/v4/terra${branch}/packages/${pkg}`).json();
|
|
}
|
|
|
|
fn madoguchi(pkg, branch) {
|
|
return madoguchi_json(pkg, branch).ver;
|
|
}
|