aboutsummaryrefslogtreecommitdiff
path: root/src/cpt-lib.in
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-02-07 10:03:56 +0000
committermerakor <cem@ckyln.com>2021-02-07 10:03:56 +0000
commit86f797b7ff488954655f1dde44c3cb14a6eefe0e (patch)
tree13a3ee947904844a4b1dad0ad87b0d79b1c6d077 /src/cpt-lib.in
parent08b2a230703d55f331458d3bedaba715948426a8 (diff)
downloadcpt-86f797b7ff488954655f1dde44c3cb14a6eefe0e.tar.gz
as_root(): reflect rename: sls -> ssu
See https://github.com/illiliti/ssu/issues/2 sls is moved to the end of preference order, and will be removed at the end of May. A deprecation notice is printed every time as_root is called with sls. FossilOrigin-Name: aedab01c988ac2f25014c27e776075288f97b2083b5b06d500673cc2ae62a193
Diffstat (limited to 'src/cpt-lib.in')
-rw-r--r--src/cpt-lib.in11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cpt-lib.in b/src/cpt-lib.in
index 4176d93..0578d8b 100644
--- a/src/cpt-lib.in
+++ b/src/cpt-lib.in
@@ -423,7 +423,11 @@ as_root() {
"$@"
case ${su##*/} in
- sls|sudo|doas) "$su" -u "$user" -- env "$@" ;;
+ sls)
+ warn "'sls' is deprecated, use 'ssu' instead."
+ "$su" -u "$user" -- env "$@"
+ ;;
+ ssu|sudo|doas) "$su" -u "$user" -- env "$@" ;;
su) su -c "env $* <&3" "$user" 3<&0 </dev/tty ;;
*) die "Invalid CPT_SU value: $su" ;;
esac
@@ -1979,9 +1983,10 @@ create_cache() {
# Figure out which 'sudo' command to use based on the user's choice or
# what is available on the system.
- su=${CPT_SU:-$(command -v sls ||
+ su=${CPT_SU:-$(command -v ssu ||
+ command -v doas ||
command -v sudo ||
- command -v doas)} || su=su
+ command -v sls)} || su=su
# Store the date and time of script invocation to be used as the name
# of the log files the package manager creates uring builds.