alpine-sdk: abuild-keygen requires sudo (missing patch?)
Description
I was setting up a new Alpine build system, and when I went to generate a new set of keys, abuild-keygen errored out due to assuming sudo was installed.
Steps to Reproduce
- Install a fresh Alpine system
- install alpine-sdk
- run abuild-keygen
Console Output
/home/mcasadevall/src/aports/testing # abuild-keygen -a -i
>>> Generating public/private rsa key pair for abuild
Enter file in which to save the key [/root/.abuild/root-62f289e5.rsa]: Generating RSA private key, 2048 bit long modulus (2 primes)
..........................................+++++
.......+++++
e is 65537 (0x010001)
writing RSA key
>>> Installing /root/.abuild/root-62f289e5.rsa.pub to /etc/apk/keys...
/usr/bin/abuild-keygen: line 63: sudo: not found
/home/mcasadevall/src/aports/testing #
Steps To Fix
There's already a patch from 6-22 in abuild to fix this: https://git.alpinelinux.org/abuild/commit/abuild-keygen.in?id=4dbf8e3756188748d3fff9dce81f93b21085d123
Manually applying this patch to abuild-keygen
allows it to work as expected
alpine:~/src/aports/testing$ abuild-keygen -a -i
>>> Generating public/private rsa key pair for abuild
Enter file in which to save the key [/home/mcasadevall/.abuild/mcasadevall-62f28c13.rsa]:
Generating RSA private key, 2048 bit long modulus (2 primes)
..............+++++
............................................+++++
e is 65537 (0x010001)
writing RSA key
>>> Installing /home/mcasadevall/.abuild/mcasadevall-62f28c13.rsa.pub to /etc/apk/keys...
doas (mcasadevall@alpine.infinityway.lan) password:
>>>
>>> Please remember to make a safe backup of your private key:
>>> /home/mcasadevall/.abuild/mcasadevall-62f28c13.rsa
>>>
I think either this patch needs to be cherrypicked, or abuild needs to be updated in Alpine to resolve this.