From 613e913836f6a966b97f57fdad2c61aa20b067ca Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Fri, 21 Jul 2023 22:08:07 +0200 Subject: home: services: ssh: Fix compilation warning with 'serialize-match-criteria'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/home/services/ssh.scm (serialize-match-criteria): New procedure. (serialize-openssh-host): Use it. Signed-off-by: Ludovic Courtès --- gnu/home/services/ssh.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gnu/home') diff --git a/gnu/home/services/ssh.scm b/gnu/home/services/ssh.scm index ac72129b6c..34b1fe4658 100644 --- a/gnu/home/services/ssh.scm +++ b/gnu/home/services/ssh.scm @@ -203,6 +203,9 @@ (define (match-criteria? str) first)))) (memq keyword ssh-match-keywords)))) +(define (serialize-match-criteria _ value) + (string-append "Match " value "\n")) + (define-maybe match-criteria) (define-configuration openssh-host @@ -214,7 +217,7 @@ (define-configuration openssh-host (host-name maybe-string "Host name---e.g., @code{\"foo.example.org\"} or @code{\"192.168.1.2\"}.") - (match-criteria ;TODO implement stricter match-criteria rules + (match-criteria maybe-match-criteria "When specified, this string denotes the set of hosts to which the entry applies, superseding the @code{host-name} field. Its first element must be @@ -288,8 +291,7 @@ (define (openssh-host-name-or-match-field? field) (G_ "define either 'name' or 'match-criteria', not both"))) (string-append "Host " (openssh-host-name config) "\n")) (if (maybe-value-set? (openssh-host-match-criteria config)) - (string-append - "Match " (string-join (openssh-host-match-criteria config) " ") "\n") + (serialize-match-criteria #t (openssh-host-match-criteria config)) (raise (formatted-message (G_ "define either 'name' or 'match-criteria' once"))))) -- cgit v1.2.3