The configure hook for the `core’ snap is currently written n shell. This is not ideal as the code becomes harder and harder to maintain, the recent PR to add support for proxy settings to core config (https://github.com/snapcore/core/pull/48) highlighted the problem once more.
After the unsuccessful proposal to port the code to python (https://forum.snapcraft.io/t/use-python-for-the-core-snap-configure-hook) here is another proposal to port it to go (WIP branch: https://github.com/snapcore/snapd/compare/master...mvo5:configure-hook?expand=1)
The strawman proposal is:
- add new
/usr/lib/snapd/core-configure
- once that has landed, change the
core
snap configure hook to just exec the above command
Alternatively instead of making it a separate command we could make it a (hidden) command in snapctl.