-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopr-rebuild-arrow.r
More file actions
executable file
·34 lines (27 loc) · 1006 Bytes
/
copr-rebuild-arrow.r
File metadata and controls
executable file
·34 lines (27 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env Rscript
source("config.r")
source("common.r")
check_copr()
cmd.rq <- "dnf --releasever=CHROOT rq libarrow --queryformat '%{version}' -q"
cmd.gs <- "git show HEAD~NREV:specs/R-CRAN-arrow.spec"
chroots <- rev(getOption("copr.chroots"))
versions <- sapply(strsplit(chroots, "-"), "[", 2) |>
sapply(function(x) system(sub("CHROOT", x, cmd.rq), intern=TRUE))
nrev <- 0
for (i in seq_along(versions)) while (TRUE) {
remove_patch <- function(x)
paste(head(unlist(strsplit(x, "[.]")), 2), collapse=".")
spec <- system(sub("NREV", nrev, cmd.gs), intern=TRUE)
ver <- strsplit(grep("Version", spec, value=TRUE), " +")[[1]][2]
cmp <- compareVersion(remove_patch(ver), remove_patch(versions[i]))
if (cmp > 0) {
nrev <- nrev + 1
next
} else if (cmp == 0) {
message("Building v", ver, " for libarrow-", versions[i], " in ", chroots[i])
tmp <- file.path(tempdir(), "R-CRAN-arrow.spec")
writeLines(spec, tmp)
build_spec(tmp, chroots=chroots[i])
}
break
}