canonical / core18

The core18 base snap
14 stars 26 forks source link

hooks: use relative symlinks when unwinding #71

Closed mvo5 closed 6 years ago

mvo5 commented 6 years ago

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 """