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:
parent
f74e25467e
commit
709782bdc1
|
@ -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)
|
||||
|
|
|
@ -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))))
|
||||
|
|
Loading…
Reference in New Issue