Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko committed Dec 23, 2024
1 parent d2f6bfa commit f718ee7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
2 changes: 1 addition & 1 deletion anda/fusion/ffmpeg/VERSION_tesseract.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.5.0
5.5.0
24 changes: 6 additions & 18 deletions anda/fusion/ffmpeg/update.rhai
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
rpm.version(find(`<small>ffmpeg-([\d.]+?)\.tar\.xz</small>`, get("https://ffmpeg.org/download.html"), 1));
import "andax/bump_extras.rhai" as bump;

//rpm.version(find(`<small>ffmpeg-([\d.]+?)\.tar\.xz</small>`, get("https://ffmpeg.org/download.html"), 1));

let ffmpeg_ver = get(`https://madoguchi.fyralabs.com/v4/terra${labels.branch}/packages/x265`).json().ver;
open_file("anda/fusion/ffmpeg/VERSION_x265.txt").write(ffmpeg_ver);
open_file("anda/fusion/ffmpeg/VERSION_x265.txt", "w").write(ffmpeg_ver);

let release = labels.branch;
if release.starts_with("el") {
release.crop(2);
if release == "10" {
release = "EPEL-10.0"
} else {
release = `EPEL-${release}`;
}
} else if release.starts_with("f") {
release = labels.nbranch;
} else {
print(`ffmpeg: unsupported branch: ${labels.branch}`);
terminate();
}
let tesseract_ver = get(`https://bodhi.fedoraproject.org/updates/?search=tesseract&status=stable&releases=${release}&rows_per_page=1&page=1`).json().updates[0].title;
open_file("anda/fusion/ffmpeg/VERSION_tesseract.txt").write(tesseract_ver);
let tesseract_ver = bump::bodhi("tesseract", 42);
open_file("anda/fusion/ffmpeg/VERSION_tesseract.txt", "w").write(tesseract_ver);
22 changes: 22 additions & 0 deletions andax/bump_extras.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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`;
return find(`^${pkg}-([\d.]+)-\d+\.[\w\d]+$`, get(url).json().updates[0].title, 1);
}

0 comments on commit f718ee7

Please sign in to comment.