summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/shadowfile.el9
-rw-r--r--test/lisp/shadowfile-tests.el22
2 files changed, 15 insertions, 16 deletions
diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el
index 27d934d9fce..180d5026b6e 100644
--- a/lisp/shadowfile.el
+++ b/lisp/shadowfile.el
@@ -307,14 +307,7 @@ Replace HOST, and NAME when non-nil."
(if (null (tramp-file-name-method hup))
(format
"/%s:%s" (tramp-file-name-host hup) (tramp-file-name-localname hup))
- (tramp-make-tramp-file-name
- (tramp-file-name-method hup)
- (tramp-file-name-user hup)
- (tramp-file-name-domain hup)
- (tramp-file-name-host hup)
- (tramp-file-name-port hup)
- (tramp-file-name-localname hup)
- (tramp-file-name-hop hup)))))
+ (tramp-make-tramp-file-name hup))))
(defun shadow-replace-name-component (fullname newname)
"Return FULLNAME with the name component changed to NEWNAME."
diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el
index 200fb4c58c6..c38d49e61f2 100644
--- a/test/lisp/shadowfile-tests.el
+++ b/test/lisp/shadowfile-tests.el
@@ -696,6 +696,7 @@ guaranteed by the originator of a cluster definition."
shadow-files-to-copy
cluster1 cluster2 primary regexp file)
(unwind-protect
+ (condition-case err
(progn
;; Cleanup.
(when (file-exists-p shadow-info-file)
@@ -773,16 +774,19 @@ guaranteed by the originator of a cluster definition."
(concat (shadow-site-primary cluster2) file)
(shadow-contract-file-name (concat "/cluster1:" file)))
shadow-files-to-copy)))
+ (error (message "Error: %s" err) (signal (car err) (cdr err))))
;; Cleanup.
(when (file-exists-p shadow-info-file)
(delete-file shadow-info-file))
(when (file-exists-p shadow-todo-file)
(delete-file shadow-todo-file))
- (when (file-exists-p file)
- (delete-file file))
- (when (file-exists-p (concat (shadow-site-primary cluster2) file))
- (delete-file (concat (shadow-site-primary cluster2) file))))))
+ (ignore-errors
+ (when (file-exists-p file)
+ (delete-file file)))
+ (ignore-errors
+ (when (file-exists-p (concat (shadow-site-primary cluster2) file))
+ (delete-file (concat (shadow-site-primary cluster2) file)))))))
(ert-deftest shadow-test09-shadow-copy-files ()
"Check that needed shadow files are copied."
@@ -864,10 +868,12 @@ guaranteed by the originator of a cluster definition."
(delete-file shadow-info-file))
(when (file-exists-p shadow-todo-file)
(delete-file shadow-todo-file))
- (when (file-exists-p file)
- (delete-file file))
- (when (file-exists-p (concat (shadow-site-primary cluster2) file))
- (delete-file (concat (shadow-site-primary cluster2) file))))))
+ (ignore-errors
+ (when (file-exists-p file)
+ (delete-file file)))
+ (ignore-errors
+ (when (file-exists-p (concat (shadow-site-primary cluster2) file))
+ (delete-file (concat (shadow-site-primary cluster2) file)))))))
(defun shadowfile-test-all (&optional interactive)
"Run all tests for \\[shadowfile]."