Thanks for your patience, Dan! On 13.01.23 at 10:22 Dan Čermák wrote:
Johannes Kastl
writes: On 13.01.23 at 09:19 Dan Čermák wrote:
and this is how it looks after the ln:
[ 11s] lrwxrwxrwx. 1 abuild abuild 16 Jan 13 09:14 pycodestyle -> pycodestyle-3.10 [ 11s] -rwxr-xr-x. 1 abuild abuild 984 Jan 13 09:14 pycodestyle-3.10 [ 11s] -rwxr-xr-x. 1 abuild abuild 983 Jan 13 09:14 pycodestyle-3.8 [ 11s] -rwxr-xr-x. 1 abuild abuild 983 Jan 13 09:14 pycodestyle-3.9
which, is more or less what I'd expect, is it not?
Yes, but only if I call the ln command **inside this folder**.
Nope: --8<---------------cut here---------------start------------->8--- ❯ mkdir -p /tmp/foo && touch /tmp/foo/bar && ln -sf bar /tmp/foo/baz
❯ ll /tmp/foo/ total 0 -rw-r--r--. 1 dan dan 0 Jan 13 10:18 bar lrwxrwxrwx. 1 dan dan 3 Jan 13 10:18 baz -> bar --8<---------------cut here---------------end--------------->8---
As stated at the end of my last mail, that is a behaviour I did not know ln had (and that is not obvious in the manpages).
So, that part seems solved. I still do not understand the packaging error for /usr/bin/_current_flavor if I create the link manually inside the directory:
%python_clone %{buildroot}%{_bindir}/pycodestyle cd %{buildroot}%{_bindir}/ln -sf pycodestyle-%{python3_bin_suffix} pycodestyle
This is due to the python flavor switching magic which is performed by writing the current python flavor into the file _current_flavor. The macros assume that the switching code is never executed inside %buildroot and so littering pwd with additional files is not an issue. It becomes one if you cd into %{buildroot} of course.
Ah, that explains it. If I switch the working directory back from %{buildroot}%{_bindir} before the %python_expand macro call at the end of the %build section, then the file does not appear. Thanks, Dan! Have a nice day, Johannes -- Johannes Kastl Linux Consultant & Trainer Tel.: +49 (0) 151 2372 5802 Mail: kastl@b1-systems.de B1 Systems GmbH Osterfeldstraße 7 / 85088 Vohburg http://www.b1-systems.de GF: Ralph Dehner Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537