On 4/8/21 3:15 PM, Ben Greiner wrote:
Hmm, the %python_alternative script tries to be too clever and fails in finding the correct file pattern in the %files section [1]:
[ 47s] RPM build errors: [ 47s] File not found: /home/abuild/rpmbuild/BUILDROOT/python-aliyun-img-utils-1.1.0-2.1.x86_64/usr/share/man/man1/*-3.6
Any idea?
The macro is actually not clever enough. You have to expand the filelist before the macro sees it. python_alternative must create several directives per file: foo, foo-3.6 and the ghost entry. And the results are different for manpages, so the lua cannot just mangle the still unexpanded shell glob pattern.
The same is true for %python_install_alternative, which would just write the glob into the scriptlet. I suspect rpmlint will give you an error there, because it cannot expand the glob and compare with the filelist.
So, it works without using globs but I'm getting warnings on the use of absolute symlinks that I don't know how to fix [1]. I used the Python alternative mechanism as described in the documentation but it seems I'm missing something. Adrian
[1] https://build.opensuse.org/package/live_build_log/home:glaubitz:branches:Clo...