[Rpm-maint] [rpm-software-management/rpm] Reimplement pythondeps.sh as parametric macro generators (#1153)
Panu Matilainen
notifications at github.com
Tue Apr 14 10:21:07 UTC 2020
@pmatilai 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
I don't see any problems with that.
BTW as for the %{buildroot} part: the classifier regex (`%__python_path` here) is applied on a path without %{buildroot} so the ^ is fine. However the %{1} argument *does* include the %{buildroot} - the situation is the same with "traditional" generators. This point probably deserves a clear note in the generator docs.
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.
--
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_r408027905
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200414/249b0010/attachment.html>
More information about the Rpm-maint
mailing list