Fix handling of windows paths of package archives

- the configuration-layer//resolve-package-archives function was adding
  extra `http://` for windows paths
This commit is contained in:
Igor Avdeev 2017-12-05 12:40:14 +03:00 committed by syl20bnr
parent f74e25467e
commit 709782bdc1
2 changed files with 10 additions and 0 deletions

View File

@ -451,6 +451,7 @@ cache folder.")
(let ((path (cdr archive)))
(or (string-match-p "http" path)
(string-prefix-p "~" path)
(eq (string-match-p "^[a-zA-Z]:" path) 0)
(string-prefix-p "/" path))))
(defun configuration-layer//package-archive-local-path-p (archive)
@ -458,6 +459,7 @@ cache folder.")
(let ((path (cdr archive)))
(or (string-prefix-p "~" path)
(string-prefix-p "/" path)
(eq (string-match-p "^[a-zA-Z]:" path) 0)
(string-prefix-p "\." path))))
(defun configuration-layer//resolve-package-archives (archives)

View File

@ -724,6 +724,10 @@
(let ((input '("spacelpa" . "/home/rms/.elpa/spacelpa")))
(should (configuration-layer//package-archive-absolute-path-p input))))
(ert-deftest test-package-archive-absolute-pathp--windows-absolute-path ()
(let ((input '("spacelpa" . "c:/Users/My User/.elpa/spacelpa")))
(should (configuration-layer//package-archive-absolute-path-p input))))
(ert-deftest test-package-archive-absolute-pathp--relative-path-local ()
(let ((input '("melpa" . "../.elpa/spacelpa")))
(should (not (configuration-layer//package-archive-absolute-path-p input)))))
@ -752,6 +756,10 @@
(let ((input '("spacelpa" . "/home/rms/.elpa/spacelpa")))
(should (configuration-layer//package-archive-local-path-p input))))
(ert-deftest test-package-archive-local-pathp--windows-local-path ()
(let ((input '("spacelpa" . "c:/Users/My User/.elpa/spacelpa")))
(should (configuration-layer//package-archive-local-path-p input))))
(ert-deftest test-package-archive-local-pathp--relative-local-path-local ()
(let ((input '("melpa" . "../.elpa/spacelpa")))
(should (configuration-layer//package-archive-local-path-p input))))