Commit a3b5ef0 1 parent 976455a commit a3b5ef0 Copy full SHA for a3b5ef0
File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 76
76
77
77
## Release scripts
78
78
79
+ ## Install script
80
+ * Add support for doas as an alternative to sudo [ #5820 @kit-ty-kate - fix #5792 ]
81
+
79
82
## Admin
80
83
81
84
## Opam installer
Original file line number Diff line number Diff line change @@ -390,12 +390,21 @@ xsudo() {
390
390
391
391
local DSTDIR=$( dirname " $DST " )
392
392
if [ ! -w " $DSTDIR " ]; then
393
- echo " Write access to $DSTDIR required, using 'sudo'."
393
+ if command -v sudo > /dev/null ; then
394
+ SUDO=sudo
395
+ elif command -v doas > /dev/null ; then
396
+ SUDO=doas
397
+ else
398
+ echo " Write access to '$DSTDIR ' required, but neither sudo or doas is installed."
399
+ echo " Aborting..."
400
+ exit 1
401
+ fi
402
+ echo " Write access to '$DSTDIR ' required, using '$SUDO '."
394
403
echo " Command: $CMD $@ "
395
404
if [ " $CMD " = " install" ]; then
396
- sudo " $CMD " -g 0 -o root " $@ "
405
+ " $SUDO " " $CMD " -g 0 -o root " $@ "
397
406
else
398
- sudo " $CMD " " $@ "
407
+ " $SUDO " " $CMD " " $@ "
399
408
fi
400
409
else
401
410
" $CMD " " $@ "
You can’t perform that action at this time.
0 commit comments