[Rpm-maint] [rpm-software-management/rpm] Reimplement pythondeps.sh as parametric macro generators (#1153)
Miro Hrončok
notifications at github.com
Tue Apr 14 10:25:45 UTC 2020
@hroncok commented on this pull request.
> @@ -1,4 +1,28 @@
-%__python_provides %{_rpmconfigdir}/pythondeps.sh --provides
-%__python_requires %{_rpmconfigdir}/pythondeps.sh --requires
+%__python_provides() %{lua:
+ -- Match buildroot/payload paths of the form
+ -- /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR
+ -- generating a line of the form
+ -- python(abi) = MAJOR.MINOR
+ -- (Don't match against -config tools e.g. /usr/bin/python2.6-config)
+ local path = rpm.expand('%1')
+ if path:match('/usr/bin/python%d+%.%d+$') then
Will open another PR.
> the classifier regex is applied on a path without %{buildroot} so the ^ is fine
I've verified this (as the `^` wuold obviously brek it otherwise).
>However the %{1} argument does include the %{buildroot}
That's why the `^` is only applied here and not in the generator code. I think it works well like this.
> This point probably deserves a clear note in the generator docs.
Indeed, it would be helpful if this is a documented behavior and not just implementation detail.
> It also does make me wonder if this should be configurable somehow: many/most generators will look at the file contents, in which case they do need the buildroot prepended, but there are generators operate on the path alone, and in those cases it'd be somewhat easier to have the path as packaged without the buildroot. Such as here.
The current behavior is fine. You can safely ignore the beginning of the path if you don't need it - as does this generator.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1153#discussion_r408030639
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200414/c8b1b2a2/attachment.html>
More information about the Rpm-maint
mailing list