Skip to content

Commit

Permalink
feat(kf6-kio): per branch update scripts (#3202)
Browse files Browse the repository at this point in the history
  • Loading branch information
madonuko authored Feb 5, 2025
1 parent 7367aa5 commit d6980b8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions anda/desktops/kde/kf6-kio/anda.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ project pkg {
}
labels {
subrepo = "extras"
updbranch = 1
}
}
16 changes: 16 additions & 0 deletions anda/desktops/kde/kf6-kio/update.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import "andax/bump_extras.rhai" as bump;

let pkg = "kf6-kio";
let branch = bump::as_bodhi_ver(labels.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 { continue; }
if matches[0][1].ends_with(".0") {
rpm.global("majmin_ver_kf6", matches[0][1][0..matches[0][1].len()-2]);
rpm.f = sub(`Release: (.+?)\n`, "Release: " + matches[0][2] + "%{?dist}.switcheroo\n", rpm.f);
}
break;
}
9 changes: 8 additions & 1 deletion andax/bump_extras.rhai
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,12 @@ fn as_bodhi_ver(branch) {

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);
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];
}
}
}

0 comments on commit d6980b8

Please sign in to comment.