#27 allow task scheduling based on RPM contents (having or not having certain files)
Opened 7 years ago by kparal. Modified 6 years ago

This came up in discussion about task-abicheck, but I expect this to be more common in the future and something we should offer. The tasks should be able to decide whether they want to run not only based on package name, but also based on package contents. I imagine the task would specify a whitelist and/or a blacklist of file names and we would compare that against the list of all files in all RPMs for a particular build, and decide whether to run the task or not.

For example, task-abicheck wants to run only on packages containing shared libraries (files ending with .so, .so.1, .so.1.0.25 etc). The task would specify (probably in the formula, but for the time being probably in the trigger) something like this:

required_files:
  - regexp: '\.so[0-9.]*$'

In the trigger, we would then retrieve a file list for all RPMs in that build and compare. Now, how do we retrieve that file list?

  • First, I thought we would use [[ https://apps.fedoraproject.org/mdapi | mdapi ]]. Unfortunately that only works on repositories, and we need to work with koji builds (which are not yet in any repository).
  • Koji API is probably the best option here, we can use listRPMFiles() to retrieve a list of files for an RPM.
  • And of course we can also use the approach from D223 or D232 to parse the RPM headers remotely, but koji seems like a safer option here.

If we implement this, I imagine this could be very useful in general. Python checks could only run on packages containing python files (even though in this case we could also look at "require" deps), man page linters can only run on packages containing man pages, etc.


This ticket had assigned some Differential requests:
D223
D232

@sinnykumari told me yesterday that there are certain packages which contain shared libraries, but their files do not end with .so. This is something that would complicate our detection. Sinny, can you provide some examples of such packages? Thanks.

! In #811#11543, @kparal wrote:
@sinnykumari told me yesterday that there are certain packages which contain shared libraries, but their files do not end with .so. This is something that would complicate our detection. Sinny, can you provide some examples of such packages? Thanks.

I tried to find out shared libraries which may not end with .so but so far didn't find any. I think, I might have some wrong memory about it. We can go ahead with using regexp: '.so[0-9.]$' to find out whether an rpm content has shared library or not.

Login to comment on this ticket.

Metadata