"""
The /etc/alternatives unwinding is currently creating absolute
paths. This can cause problems for classic snaps. The issue is
that on a classic snap /snap/core/current/usr/bin/awk will point
to /usr/bin/gawk - however this awk version may not be installed
on the host machine. Ironically this worked before because the
/snap/core/current/usr/bin/awk points to /etc/alternatives of
the host which may point to e.g. mawk (but potentially everyone
using the snap would see a different awk version).
This PR fixes this by using relative symlinks when unwinding the
alternatives. So it will /usr/bin/awk -> ./gawk
"""
This is the core18 version of: https://github.com/snapcore/core/pull/96
""" The /etc/alternatives unwinding is currently creating absolute paths. This can cause problems for classic snaps. The issue is that on a classic snap /snap/core/current/usr/bin/awk will point to /usr/bin/gawk - however this awk version may not be installed on the host machine. Ironically this worked before because the /snap/core/current/usr/bin/awk points to /etc/alternatives of the host which may point to e.g. mawk (but potentially everyone using the snap would see a different awk version).
This PR fixes this by using relative symlinks when unwinding the alternatives. So it will /usr/bin/awk -> ./gawk """