[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/crux f258bef9bb 3/6: Fix `sudo` not found error in OpenBSD
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/crux f258bef9bb 3/6: Fix `sudo` not found error in OpenBSD and Alpine Linux (#93) |
Date: |
Mon, 21 Nov 2022 03:58:59 -0500 (EST) |
branch: elpa/crux
commit f258bef9bb09d93087b910868d3af3277f223205
Author: Kasim <oneness@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Fix `sudo` not found error in OpenBSD and Alpine Linux (#93)
This comes handy for OpenBSD or Alpine linux users where doas is the
replacement of sudo.
---
CHANGELOG.md | 2 +-
crux.el | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 518ed8a3c4..2d98ae2d78 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -30,5 +30,5 @@
* Fixed extra line issue when duplicating region.
* Various small fixes that we were too lazy to document properly.
-
+* Fixed `sudo` not found in OpenBSD and Alpine Linux
## 0.3.0 (2016-05-31)
diff --git a/crux.el b/crux.el
index f39cc581fc..526b611b02 100644
--- a/crux.el
+++ b/crux.el
@@ -554,7 +554,9 @@ See `file-attributes' for more info."
(remote-host (file-remote-p default-directory 'host))
(remote-localname (file-remote-p filename 'localname)))
(find-alternate-file (format "/%s:root@%s:%s"
- (or remote-method "sudo")
+ (or remote-method (if (executable-find "doas")
+ "doas"
+ "sudo"))
(or remote-host "localhost")
(or remote-localname filename)))))
@@ -571,7 +573,9 @@ buffer is not visiting a file."
(remote-host (file-remote-p default-directory 'host))
(remote-localname (file-remote-p default-directory 'localname)))
(find-file (format "/%s:root@%s:%s"
- (or remote-method "sudo")
+ (or remote-method (if (executable-find "doas")
+ "doas"
+ "sudo"))
(or remote-host "localhost")
(or remote-localname
(read-file-name "Find file (as root): ")))))
- [nongnu] elpa/crux updated (6bfd212a7f -> b70649b91c), ELPA Syncer, 2022/11/21
- [nongnu] elpa/crux bc859e4d6a 1/6: Add crux-with-region-or-sexp-or-line, ELPA Syncer, 2022/11/21
- [nongnu] elpa/crux f258bef9bb 3/6: Fix `sudo` not found error in OpenBSD and Alpine Linux (#93),
ELPA Syncer <=
- [nongnu] elpa/crux 2c7143de47 5/6: More robust `crux-rename-file-and-buffer`., ELPA Syncer, 2022/11/21
- [nongnu] elpa/crux 6ef681d853 4/6: Ensure `vc-rename-file` gets the local file paths (#91), ELPA Syncer, 2022/11/21
- [nongnu] elpa/crux 6ee63c7c2b 2/6: Use `derived-mode-p` for functions to also work for derived modes (#92), ELPA Syncer, 2022/11/21
- [nongnu] elpa/crux b70649b91c 6/6: Tweak the changelog, ELPA Syncer, 2022/11/21