[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/emacsql e7b932a5c9 378/427: Handle read-only emacsql insta
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/emacsql e7b932a5c9 378/427: Handle read-only emacsql install diretory |
Date: |
Tue, 13 Dec 2022 03:00:13 -0500 (EST) |
branch: elpa/emacsql
commit e7b932a5c9ce3406492121561fd4191e406e1a21
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Handle read-only emacsql install diretory
Some systems will have set installs to read-only. This means that we
cannot comopile emacsql-sqlite directly in that directory. Luckily, it
is very easy to make emacsql-sqlite compile to an arbitrary directory.
This patch uses ~/.emacs.d/sqlite/emacsql-sqlite as a backup when the
install directory is read only.
---
emacsql-sqlite.el | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/emacsql-sqlite.el b/emacsql-sqlite.el
index c4703a29ae..9a614f0b60 100644
--- a/emacsql-sqlite.el
+++ b/emacsql-sqlite.el
@@ -27,11 +27,19 @@
(file-name-directory (or load-file-name buffer-file-name))
"Directory where EmacSQL is installed.")
+(defvar emacsql-sqlite-executable-path
+ (if (memq system-type '(windows-nt cygwin ms-dos))
+ "sqlite/emacsql-sqlite.exe"
+ "sqlite/emacsql-sqlite")
+ "Relative path to emacsql executable.")
+
(defvar emacsql-sqlite-executable
- (expand-file-name (if (memq system-type '(windows-nt cygwin ms-dos))
- "sqlite/emacsql-sqlite.exe"
- "sqlite/emacsql-sqlite")
- emacsql-sqlite-data-root)
+ (expand-file-name emacsql-sqlite-executable-path
+ (if (or (file-writable-p emacsql-sqlite-data-root)
+ (file-exists-p (expand-file-name
+ emacsql-sqlite-executable-path
+ emacsql-sqlite-data-root)))
+ emacsql-sqlite-data-root user-emacs-directory))
"Path to the EmacSQL backend (this is not the sqlite3 shell).")
(defvar emacsql-sqlite-reserved
@@ -164,6 +172,7 @@ If called with non-nil ASYNC the return value is
meaningless."
(prog1 nil
(message "Could not find C compiler, skipping SQLite build")))
(t (message "Compiling EmacSQL SQLite binary ...")
+ (mkdir (file-name-directory emacsql-sqlite-executable) t)
(let ((log (get-buffer-create byte-compile-log-buffer)))
(with-current-buffer log
(let ((inhibit-read-only t))
- [nongnu] elpa/emacsql 2bc599d856 327/427: Add separate package headers for each backend., (continued)
- [nongnu] elpa/emacsql 2bc599d856 327/427: Add separate package headers for each backend., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e498dd1dea 336/427: Drop emacsql-escape-format's KIND argument., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 3042597a72 343/427: Add note about lack of Windows support., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5ad4d2da9a 355/427: fix ldlibs for berkeley-unix systems, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a96b2587c4 365/427: Update README to mention FTS5 (#40), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 5ebd12b6ff 377/427: Add some support for the ESCAPE operator, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql c82a0e6b4d 384/427: Add public domain statement to remaining files, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 97ccd7d9e6 398/427: Update library commentaries of package libraries, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6728a8649a 396/427: No longer try to clear a buffer that isn't live anymore, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql a118b6c95a 381/427: Don't use -lm flag on Windows (#55), ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql e7b932a5c9 378/427: Handle read-only emacsql install diretory,
ELPA Syncer <=
- [nongnu] elpa/emacsql 9e48d12e42 402/427: Fix typos in README.md, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 6d8cd93662 382/427: README: Remove a duplicate word, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b6a0336d62 405/427: make: Compile SQLite binary before Elisp, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql b9d848fa9c 407/427: make: Don't warn about implicit fallthroughs, ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql dbf0598731 087/427: Add "-interactive" argument (fixes #1)., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 79fb8cb223 230/427: Heavy compiler rework., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql dcb9a903c7 284/427: Put emacsql-thread inside a transaction., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 4a570e3016 301/427: Predict new location when compiling binary., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql 57fa0e1d3e 306/427: Use just BEGIN for transactions., ELPA Syncer, 2022/12/13
- [nongnu] elpa/emacsql ef10c33355 317/427: Only create the executable when compiling emacsql-sqlite, ELPA Syncer, 2022/12/13