fix(lightly-qt*): make update.rhai scripts actually function (#3430) (#3434)

* fix(lightly-qt*): make update.rhai scripts actually function

* the funny anda.hcls

(cherry picked from commit 103aa5dfa3)

Co-authored-by: madomado <madonuko@outlook.com>
This commit is contained in:
Raboneko
2025-02-19 10:22:03 -08:00
committed by GitHub
parent 60602fecf5
commit 9de4d8bdd0
4 changed files with 30 additions and 14 deletions
+3
View File
@@ -3,4 +3,7 @@ project "pkg" {
rpm {
spec = "lightly-qt5.spec"
}
labels {
updbranch = 1
}
}
+12 -7
View File
@@ -1,7 +1,12 @@
let repos = get("https://repology.org/api/v1/project/qt").json_arr();
let branch = sh("git rev-parse --abbrev-ref HEAD", #{"stdout": "piped"}).ctx.stdout;
branch.crop(1);
branch.trim();
let vers = repos.filter(|r| r.repo == `fedora_${branch}`).map(|r| [find("^(\\d+)\\.(\\d+)\\..+$", r.version, 1), find("^(\\d+)\\.(\\d+)\\..+$", r.version, 2)]);
let ver = vers.find(|v| v[0] == "5")[1]; // assume there is only 1 package for v5.x
open_file("anda/themes/lightly-qt5/VER5.txt").write(`${ver}`); // will trig rebuild when changed
fn main() {
let branch = bump::as_bodhi_ver(labels.branch);
let url = `https://bodhi.fedoraproject.org/updates/?search=qt5-5.&status=stable&releases=${branch}&rows_per_page=1&page=1`;
for entry in get(url).json().updates[0].title.split(' ') {
let matches = find_all(`qt5-([\d.]+)-(\d+)\.[\w\d]+$`, entry);
if matches.len() != 0 {
return matches[0][1].split(".")[1];
}
}
}
open_file("anda/themes/lightly-qt5/VER5.txt").write(`${main()}`); // will trig rebuild when changed
+3
View File
@@ -3,4 +3,7 @@ project "pkg" {
rpm {
spec = "lightly-qt6.spec"
}
labels {
updbranch = 1
}
}
+12 -7
View File
@@ -1,7 +1,12 @@
let repos = get("https://repology.org/api/v1/project/qt").json_arr();
let branch = sh("git rev-parse --abbrev-ref HEAD", #{"stdout": "piped"}).ctx.stdout;
branch.crop(1);
branch.trim();
let vers = repos.filter(|r| r.repo == `fedora_${branch}`).map(|r| [find("^(\\d+)\\.(\\d+)\\..+$", r.version, 1), find("^(\\d+)\\.(\\d+)\\..+$", r.version, 2)]);
let ver = vers.find(|v| v[0] == "6")[1]; // assume there is only 1 package for v6.x
open_file("anda/themes/lightly-qt6/VER6.txt").write(`${ver}`); // will trig rebuild when changed
fn main() {
let branch = bump::as_bodhi_ver(labels.branch);
let url = `https://bodhi.fedoraproject.org/updates/?search=qt6-6.&status=stable&releases=${branch}&rows_per_page=1&page=1`;
for entry in get(url).json().updates[0].title.split(' ') {
let matches = find_all(`qt6-([\d.]+)-(\d+)\.[\w\d]+$`, entry);
if matches.len() != 0 {
return matches[0][1].split(".")[1];
}
}
}
open_file("anda/themes/lightly-qt6/VER6.txt").write(`${main()}`); // will trig rebuild when changed