Fix repositories for upgrade to edge
While reading through the code again, I noticed a bug.
Prior to this patch, etc-apk-repositories would only have the alpine
testing repository, instead of having testing added to the others
(postmarketos, alpine main and community).
If somebody is curious how this bug got introduced, originally I had:
grep '/alpine/edge/community' "$new" \
| sed 's#/alpine/edge/community#/alpine/edge/testing#' \
>> "$new"
^-- SC2094 (info): Make sure not to read and write the same file in the same pipeline.
Then changed it to "${new}.2" + mv to avoid the bad practice that
shellcheck pointed out.
Besides that, measures to not have this go unnoticed in the future:
- Verify channel after upgrade
- Add more verbosity during upgrade, print /etc/apk/repositories before and after changing it
Fix another bug where exit_err was used instead of err_exit.
And a patch to add the version of the script to the script itself, so we have it in the log. Details in the commit messages.
I'll merge this after CI passes and tag a release.
Edited by Administrator