-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document possible paths for user config #17
Comments
No, you can't override the path in ENV variable, but maybe that could be a feature. The user config is System-wide overrides is |
I found So what is the syntax for libalternatives.conf? Because calling Here is my use case:
%pytest expands to a loop callong of Now sometimes the test suite of a package calls subprocesses and naturally does not know about the flavors. With u-a, I can override this with symlinks like here: https://build.opensuse.org/package/view_file/devel:languages:python:jupyter/python-jupyter-server/python-jupyter-server.spec?expand=1 But somehow this starts to fail here: https://build.opensuse.org/package/show/home:bnavigator:branches:devel:languages:python:jupyter/python-jupyter-server |
Correct,
|
Thanks, it took me some time to realize that For the record here is what I end up with: %if %{with test}
%check
export XDG_CONFIG_HOME=$PWD/build/config
%{python_expand # provide libalternatives and u-a links in the correct flavor version
mkdir -p build/config
%if %{with libalternatives}
for b in /usr/share/libalternatives/*; do
if [ -e "${b}/%{$python_version_nodots}.conf" ]; then
alts -n $(basename ${b}) -p %{$python_version_nodots}
fi
done
%endif
mkdir -p build/testbin
for bin in %{_bindir}/*-%{$python_bin_suffix} %{buildroot}%{_bindir}/*-%{$python_bin_suffix}; do
# four percent into 1 by rpm/python expansions
mainbin=${bin%%%%-%{$python_bin_suffix}}
basemain=$(basename ${mainbin})
if [ "$(readlink ${mainbin})" = "/etc/alternatives/${basemain}" ]; then
ln -s ${bin} build/testbin/${basemain}
fi
done
}
export PATH=$PWD/build/testbin:$PATH
%pytest
%endif |
Looks correct, though I'm not sure you need to specify the Yes, the priority refers to the priority a given config (or alternative) is assigned by the RPM developer. Then you can override the default if the highest priority is not what you want. This is similar concept to the priorities in the update-alternatives. |
Pointing |
Where do I put the user config?
Can I override the paths to the config with an environment variable?
The text was updated successfully, but these errors were encountered: