Commit Graph

10 Commits

Author SHA1 Message Date
Miro Hrončok e78c420523 Fix python(abi) requires generator, it picked files from almost good directories
The %__python_magic filter suddenly got actually working with file 5.39:

Before:

    file.cpython-38.opt-1.pyc: data

After:

    file.cpython-38.opt-1.pyc: python 3.8 byte-compiled

Hence, the filter started to pick all Python files regardless of their location.
Later, in the actual generator, paths like this were considered:

    /opt/usr/lib/python3.X/...

And generated requirements on python(abi).

We don't actually need to filter the files by file magic,
so we drop it to get the previously accidentally working behavior.

We could choose if the path and magic filters are applied as OR or AND.
However, we don't want either.

We actually want to mach any files in Python directories regardless of their magic.
We *could* filter by file type (and executable bit) for provides,
but that would require us to split the attr files into two.
2020-06-18 13:32:24 +02:00
Miro Hrončok c8249102ec Don't define global Lua variables from Python generator 2020-04-28 14:48:06 +02:00
Miro Hrončok 8eef42cbaa Use dynamic %_prefix value when matching files for python(abi) provides
See https://lists.fedoraproject.org/archives/list/packaging@lists.fedoraproject.org/thread/UFKUM5UKCTNGIT3KJVYEI5VXPI23QMBN/

Flatpak builds redefine %_prefix and the dependencies should remain present.

Also get rid of one useless ^ and prep the pattern for two digit Python major versions.

Add a test that tests that we match our default %_prefix (was the case even before this commit).
2020-04-07 16:25:11 +02:00
Miro Hrončok 486ca7e540 Drop tabs from python.attr 2020-04-01 15:57:00 +02:00
Miro Hrončok ff7b9b1ae0 Reimplement pythondeps.sh as parametric macro generators
pythondeps.sh was written in shell and unlike the Python dist generators,
it uses no Python, it plainly determines the provide / requires from the path.
As the script was run for every Python file, we were potentially doing hundreds
of shelling outs to execute a script that calls grep and sed.

In Lua, this is much more efficient.

Some timings:
    https://github.com/rpm-software-management/rpm/pull/1153#issuecomment-607146356

Parametric macro generators require RPM 4.16+:
    https://fedoraproject.org/wiki/Changes/RPM-4.16

Fixes https://github.com/rpm-software-management/rpm/issues/1152
Upstream PR: https://github.com/rpm-software-management/rpm/pull/1153

Since this is intended for Fedora 33+ only, clean some old cruft.
2020-04-01 15:53:15 +02:00
Igor Gnatenko 9f6f709036
Tighten regex for depgen
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-10-03 14:21:26 +02:00
Igor Gnatenko dc64d7b436
Split python to pythondist generator
Running this python script on all possible files is way too expensive.
Some of the packages timeout due to that.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-07-28 14:26:48 +02:00
Igor Gnatenko 6d7c3b291d
attr: match everything in python directories
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-11 00:50:56 +01:00
Igor Gnatenko 257dcc8865
attr: print provides in modern format
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-11 00:50:55 +01:00
Igor Gnatenko ad70cabb97
Fork upstream generators
This package is not being kept up to date, it's hard to maintain and we
will need to tune it from time to time which is painful.

Also removes whole layer of bootstrapping.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-11 00:50:54 +01:00