mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-03-08 05:07:43 +00:00
Add support for the SUDO variable
This can be used to pick another tool to elevate privileges.
This commit is contained in:
parent
69fc8b8fc1
commit
d4c670bc44
@ -8,6 +8,7 @@
|
||||
|
||||
program_version=@VERSION@
|
||||
sharedir=${ABUILD_SHAREDIR:-@sharedir@}
|
||||
SUDO="${SUDO:-sudo}"
|
||||
|
||||
if ! [ -f "$sharedir/functions.sh" ]; then
|
||||
echo "$sharedir/functions.sh: not found" >&2
|
||||
@ -54,11 +55,10 @@ do_keygen() {
|
||||
)
|
||||
openssl rsa -in "$privkey" -pubout -out "$pubkey"
|
||||
|
||||
|
||||
if [ -n "$install_pubkey" ]; then
|
||||
msg "Installing $pubkey to /etc/apk/keys..."
|
||||
sudo mkdir -p /etc/apk/keys
|
||||
sudo cp -i "$pubkey" /etc/apk/keys/
|
||||
$SUDO mkdir -p /etc/apk/keys
|
||||
$SUDO cp -i "$pubkey" /etc/apk/keys/
|
||||
else
|
||||
|
||||
msg ""
|
||||
@ -101,6 +101,9 @@ usage() {
|
||||
-q, --quiet
|
||||
-h, --help Show this help
|
||||
|
||||
The SUDO variable can be set to pick which tool can be used to
|
||||
elevate privileges, if it is not set it defaults to sudo.
|
||||
|
||||
__EOF__
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user