branch: elpa-admin commit 26579f86f12f46f60102d757a49c4f3e7747f826 Author: Stefan Monnier <monn...@iro.umontreal.ca> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
(elpaa--html-build-doc): Improve last change * elpa-admin.el (elpaa--html-build-doc): Don't call `make-symbolic-link` when it's not necessary. --- elpa-admin.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/elpa-admin.el b/elpa-admin.el index d4a9dcf7eb..30225a2c5f 100644 --- a/elpa-admin.el +++ b/elpa-admin.el @@ -2700,15 +2700,17 @@ directory; one of archive, archive-devel." ;; Create a symlink from elpa/archive[-devel]/doc/* to ;; the actual file, so html references work. - (with-demoted-errors "%S" ;; 'make-symbolic-link' doesn't work on Windows - (let ((target (file-name-concat (file-name-nondirectory html-dir) - destname)) - (current-target (file-attribute-type - (file-attributes html-xref-file)))) - (if (and (stringp current-target) - (not (equal target current-target))) - (error "Manual name %S conflicts with %S" destname current-target) - (make-symbolic-link target html-xref-file)))))) + (let ((target (file-name-concat (file-name-nondirectory html-dir) + destname)) + (current-target (file-attribute-type + (file-attributes html-xref-file)))) + (cond + ((not (stringp current-target)) + (with-demoted-errors "%S" ;; 'make-symbolic-link' fails on Windows. + (make-symbolic-link target html-xref-file))) + ((equal target current-target) nil) ;Nothing to do. + (t (error "Manual name %S conflicts with %S" + destname current-target)))))) (defun elpaa--build-Info-1 (pkg-spec docfile dir html-dir) "Build an info file from DOCFILE (a texinfo source file).