Intersection of 2 arches macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello packaging folks.
I was in need of computing an intersection of 2 arches today.

Consider this:

  %java_arches: aarch64 ppc64le s390x x86_64
  %my_arches: i686 x86_64

Plan:

  ExclusiveArch: <intersection of %java_arches and %my_arches>

Is there some idiomatic way of doing this? I came up with:

  ExclusiveArch:  %(comm -12 <(echo %{java_arches} | tr ' ' '\n' | sort) \
                    <(echo %{my_arches} | tr ' ' '\n' | sort) | tr '\n' ' ')

Which I consider quite horrible.

I was considering Lua to avid shelling out to nested Shell, but Lua has no easy sets, so the code would be much longer.

Is there some easier way? Should there be? Something like:

  ExclusiveArch: %{arch_intersect %java_arches & %my_arches}

Note the & that serves as a separator, otherwise the arches would be mixed and would need to be put in some kind of quotes. Alternatively, the macro names could be passed instead to avoid a need of a separator

  ExclusiveArch: %{arch_intersect java_arches my_arches}

(Both approaches allow to intersect arbitrary number of sets.)
--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok
_______________________________________________
packaging mailing list -- packaging@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to packaging-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/packaging@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux