From: Michael Albinus Date: Sat, 21 Jul 2018 10:29:06 +0000 (+0200) Subject: Fix Bug#32226 X-Git-Tag: emacs-26.1.90~254 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e0f33ea394c636ab1aa2412b4f35b7dfc1ca768a;p=emacs.git Fix Bug#32226 * lisp/shadowfile.el (shadow-site-name, shadow-name-site): Use "[-.[:word:]]+" as hostname regexp. (Bug#32226) * test/lisp/shadowfile-tests.el (shadow-test06-literal-groups) (shadow-test07-regexp-groups, shadow-test08-shadow-todo) (shadow-test09-shadow-copy-files): Skip if needed. --- diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index e1a9b8e1d98..27d934d9fce 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -231,12 +231,12 @@ information defining the cluster. For interactive use, call (defun shadow-site-name (site) "Return name if SITE has the form \"/name:\", otherwise SITE." - (if (string-match "\\`/\\(\\w+\\):\\'" site) + (if (string-match "\\`/\\([-.[:word:]]+\\):\\'" site) (match-string 1 site) site)) (defun shadow-name-site (name) "Return \"/name:\" if NAME has word syntax, otherwise NAME." - (if (string-match "\\`\\w+\\'" name) + (if (string-match "\\`[-.[:word:]]+\\'" name) (format "/%s:"name) name)) (defun shadow-site-primary (site) diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index 5ded94480ec..200fb4c58c6 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el @@ -556,6 +556,8 @@ guaranteed by the originator of a cluster definition." (ert-deftest shadow-test06-literal-groups () "Check literal group definitions." + (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) + (let ((shadow-info-file shadow-test-info-file) (shadow-todo-file shadow-test-todo-file) shadow-clusters shadow-literal-groups @@ -618,6 +620,8 @@ guaranteed by the originator of a cluster definition." (ert-deftest shadow-test07-regexp-groups () "Check regexp group definitions." + (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) + (let ((shadow-info-file shadow-test-info-file) (shadow-todo-file shadow-test-todo-file) shadow-clusters shadow-regexp-groups @@ -682,6 +686,8 @@ guaranteed by the originator of a cluster definition." (ert-deftest shadow-test08-shadow-todo () "Check that needed shadows are added to todo." + (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) + (let ((backup-inhibited t) (shadow-info-file shadow-test-info-file) (shadow-todo-file shadow-test-todo-file) @@ -780,6 +786,8 @@ guaranteed by the originator of a cluster definition." (ert-deftest shadow-test09-shadow-copy-files () "Check that needed shadow files are copied." + (skip-unless (file-remote-p shadow-test-remote-temporary-file-directory)) + (let ((backup-inhibited t) (shadow-info-file shadow-test-info-file) (shadow-todo-file shadow-test-todo-file)