[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/systemd bd94a2c 094/131: shim in support for nspawn settin
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/systemd bd94a2c 094/131: shim in support for nspawn settings files |
Date: |
Sun, 29 Aug 2021 11:35:21 -0400 (EDT) |
branch: elpa/systemd
commit bd94a2cb97ba66f06f564679eecdacb9c3c7456f
Author: Mark Oteiza <mvoteiza@udel.edu>
Commit: Mark Oteiza <mvoteiza@udel.edu>
shim in support for nspawn settings files
---
Makefile | 2 +-
nspawn-directives.txt | 28 ++++++++++++++++++++++++++++
systemd.el | 37 ++++++++++++++++++++++++++++++-------
3 files changed, 59 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index ae96023..eee3e77 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
SRC = systemd.el
-DATA = unit-directives.txt network-directives.txt
+DATA = unit-directives.txt network-directives.txt nspawn-directives.txt
DISTFILES := Makefile $(SRC) $(DATA) LICENSE README systemd-pkg.el tests
VERSION := $(shell awk '/^;; Version:/ {print $$3}' $(SRC))
diff --git a/nspawn-directives.txt b/nspawn-directives.txt
new file mode 100644
index 0000000..3c43003
--- /dev/null
+++ b/nspawn-directives.txt
@@ -0,0 +1,28 @@
+Boot
+ProcessTwo
+Parameters
+Environment
+User
+WorkingDirectory
+Capability
+DropCapability
+KillSignal
+Personality
+MachineID
+PrivateUsers
+NotifyReady
+ReadOnly
+Volatile
+Bind
+BindReadOnly
+TemporaryFileSystem
+PrivateUsersChown
+Private
+VirtualEthernet
+VirtualEthernetExtra
+Interface
+MACVLAN
+IPVLAN
+Bridge
+Zone
+Port
diff --git a/systemd.el b/systemd.el
index 6cfe9c3..b0e8039 100644
--- a/systemd.el
+++ b/systemd.el
@@ -106,6 +106,20 @@
(split-string (buffer-string))))
"Network configuration directives for systemd.")
+(defconst systemd-nspawn-sections
+ '("Exec" "Files" "Network")
+ "Namespace container configuration sections for systemd 232.")
+
+(defconst systemd-nspawn-directives
+ (eval-when-compile
+ (with-temp-buffer
+ (insert-file-contents
+ (let ((f "nspawn-directives.txt"))
+ (if (null load-file-name) f
+ (expand-file-name f (file-name-directory load-file-name)))))
+ (split-string (buffer-string))))
+ "Namespace container configuration directives for systemd.")
+
;;;###autoload
(defconst systemd-autoload-regexp
(eval-when-compile
@@ -196,18 +210,26 @@ file, defaulting to the link under point, if any."
(beginning-of-line)
(= (following-char) ?\[)))
-(defun systemd-buffer-network-p ()
- "Return non-nil if `buffer-name' has a network-type extension, otherwise
nil."
+(defun systemd-file-network-p (filename)
+ "Return non-nil if FILENAME has a network-type extension, otherwise nil."
(string-match-p (eval-when-compile
(rx "." (or "link" "netdev" "network") string-end))
- (buffer-name)))
+ filename))
+
+(defun systemd-file-nspawn-p (filename)
+ "Return non-nil if FILENAME has an nspawn extension, otherwise nil."
+ (string-match-p (eval-when-compile (rx ".nspawn" string-end)) filename))
(defun systemd-completion-table (&rest _ignore)
"Return a list of completion candidates."
- (let ((sectionp (systemd-buffer-section-p)))
- (if (systemd-buffer-network-p)
- (if sectionp systemd-network-sections systemd-network-directives)
- (if sectionp systemd-unit-sections systemd-unit-directives))))
+ (let ((sectionp (systemd-buffer-section-p))
+ (name (buffer-name)))
+ (cond
+ ((systemd-file-nspawn-p name)
+ (if sectionp systemd-nspawn-sections systemd-nspawn-directives))
+ ((systemd-file-network-p name)
+ (if sectionp systemd-network-sections systemd-network-directives))
+ (t (if sectionp systemd-unit-sections systemd-unit-directives)))))
(defun systemd-complete-at-point ()
"Complete the symbol at point."
@@ -269,6 +291,7 @@ See systemd.unit(5) for details on unit file syntax.")
["Open systemd.directives(7)" systemd-doc-directives
:help "Index of configuration directives"]))
+;;;###autoload (add-to-list 'auto-mode-alist '("\\.nspawn\\'" . systemd-mode))
;;;###autoload (add-to-list 'auto-mode-alist `(,systemd-autoload-regexp .
systemd-mode))
;;;###autoload (add-to-list 'auto-mode-alist `(,systemd-tempfn-autoload-regexp
. systemd-mode))
;;;###autoload (add-to-list 'auto-mode-alist `(,systemd-dropin-autoload-regexp
. systemd-mode))
- [nongnu] elpa/systemd a86323e 059/131: v229, (continued)
- [nongnu] elpa/systemd a86323e 059/131: v229, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 9fc0545 061/131: move systemd-font-lock-keywords, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd f306614 066/131: dang spaces, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd b004b37 068/131: autoload sorcery, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd de5da7f 073/131: update Makefile, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 63d64ad 076/131: generate directive lists from files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd fe443ac 078/131: use font-lock-defaults to disable syntax highlighting, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 2e1f739 081/131: update readme, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 4c073b0 091/131: missed one, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 4c1b2be 097/131: bump, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd bd94a2c 094/131: shim in support for nspawn settings files,
ELPA Syncer <=
- [nongnu] elpa/systemd 28601d8 101/131: woops, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 2c71ec5 103/131: systemd 234.11, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 16ba942 113/131: rename tests directory, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 839094d 114/131: use rx here, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 23c0caf 115/131: extend anchored matches past the current line if \ broken, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 228f0b9 119/131: happy new year, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd e97f78e 120/131: Add %S, %C, %L specifiers, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd eaaf16f 033/131: fix indentation, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd cf435f4 034/131: convolute sexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 2b70f83 035/131: these groups need not be nested, ELPA Syncer, 2021/08/29