| |
@@ -22,6 +22,8 @@
|
| |
POLICY = [
|
| |
# Go SIG: https://pagure.io/fesco/fesco-docs/pull-request/68
|
| |
("go-sig", "commit", lambda x: x in go_packages()),
|
| |
+ # R SIG: https://pagure.io/fesco/fesco-docs/pull-request/69
|
| |
+ ("r-maint-sig", "commit", lambda x: x.startswith("R-") or x in r_packages()),
|
| |
# Rust SIG: https://pagure.io/fesco/fesco-docs/pull-request/66
|
| |
("rust-sig", "commit", lambda x: x.startswith("rust-")),
|
| |
]
|
| |
@@ -73,6 +75,49 @@
|
| |
return packages
|
| |
|
| |
|
| |
+ @functools.cache
|
| |
+ def r_packages() -> set[str]:
|
| |
+ INSTALLROOT = "/tmp/dnf-sig-policy"
|
| |
+
|
| |
+ cmd = [
|
| |
+ "dnf", "--quiet",
|
| |
+ "--installroot", INSTALLROOT,
|
| |
+ "--repo", "rawhide",
|
| |
+ "--repo", "rawhide-source",
|
| |
+ "--releasever", "rawhide",
|
| |
+ "repoquery",
|
| |
+ # query source package and binary package names,
|
| |
+ # so BuildRequires and Requires can be differentiated
|
| |
+ "--qf", "%{source_name} %{name}",
|
| |
+ "--whatrequires", "libR.so",
|
| |
+ ]
|
| |
+
|
| |
+ ret = subprocess.run(cmd, stdout=subprocess.PIPE)
|
| |
+ ret.check_returncode()
|
| |
+
|
| |
+ # remove temporary dnf cache
|
| |
+ shutil.rmtree(INSTALLROOT)
|
| |
+
|
| |
+ # use a set for fast membership checks
|
| |
+ packages = set()
|
| |
+ for line in ret.stdout.decode().splitlines():
|
| |
+ source_name, name = line.split(" ")
|
| |
+
|
| |
+ if source_name == "(none)":
|
| |
+ # package is a source package:
|
| |
+ # skip, only Requires are covered by the policy
|
| |
+ continue
|
| |
+ else:
|
| |
+ # package is a binary package:
|
| |
+ # collect "%{source_name}"
|
| |
+ packages.add(source_name)
|
| |
+
|
| |
+ # add "R" which does not link with "libR.so" itself
|
| |
+ packages.add("R")
|
| |
+
|
| |
+ return packages
|
| |
+
|
| |
+
|
| |
def get_package_data() -> dict[str, list[str]]:
|
| |
"""
|
| |
Download the latest cached mapping from source package name -> list of
|
| |
Add rule for the R SIG which was recently approved by FESCo here:
https://pagure.io/fesco/fesco-docs/pull-request/69
The new rule for the r-maint-sig group which covers:
Requires: libR.so
(yes, this is an unversioned soname)This is my attempt to make this match the text of the policy:
https://docs.fedoraproject.org/en-US/fesco/SIG_policy/#_r_sig
The new helper function for
r_packages
is similar to the one forgo_packages
which was added here:https://pagure.io/releng/pull-request/11002
However, it only considers runtime requirements (depending on
libR.so
at build time doesn't make much sense, I think, so this is not covered by the script.)Similar limitations mentioned in the ticket for the Go SIG policy apply here as well (i.e. it only queries rawhide repository data, so it doesn't cover eeeeverything, but it's pretty close, and it will even get better over time).