mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 09:01:55 +00:00
Co-authored-by: madomado <madonuko@outlook.com>
This commit is contained in:
+31
-2
@@ -6,10 +6,10 @@ fn as_bodhi_ver(branch) {
|
||||
}
|
||||
return `EPEL-${release}`;
|
||||
} else if branch == "frawhide" {
|
||||
return "42";
|
||||
return "F42";
|
||||
} else if branch.starts_with("f") {
|
||||
branch.crop(1);
|
||||
return branch;
|
||||
return `F${branch}`;
|
||||
} else {
|
||||
print(`E: unsupported branch: ${labels.branch}`);
|
||||
terminate();
|
||||
@@ -27,3 +27,32 @@ fn bodhi(pkg, branch) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn bodhi_vr(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);
|
||||
if matches.len() != 0 {
|
||||
return matches[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn follow_bodhi_vr(rpm, pkg, branch) {
|
||||
let vr = bodhi_vr(pkg, branch);
|
||||
rpm.version(vr[1]);
|
||||
rpm.release(vr[2]);
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user