Skip to content

Commit 77688a3

Browse files
committed
fix(install-file): Accept all kind of tar files
1 parent 7106d97 commit 77688a3

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

lisp/core/install-file.el

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,30 @@
2727
(cond
2828
((not (file-exists-p path))
2929
(eask-error "File does not exist %s" path))
30-
((or (string-suffix-p ".tar" path)
31-
(string-suffix-p ".tar.gz" path))
32-
;; tar file
30+
;; TAR file
31+
((string-match-p "[.]+tar[.]*" path)
3332
;; Note this can throw strange errors if
33+
;;
3434
;; - there is no -pkg.el in the tar file
3535
;; - the tar file was built in a folder with a different name
36-
;; tar files created with eask package are fine
36+
;;
37+
;; TAR files created with eask package are fine.
3738
(require 'tar-mode)
3839
(let ((pkg-desc (with-current-buffer (find-file (expand-file-name path))
3940
(eask-ignore-errors-silent (package-tar-file-info)))))
4041
(unless pkg-desc
41-
;; package-dir-info will return nil if there is no -pkg.el and no .el files at path
42+
;; `package-dir-info' will return nil if there is no `-pkg.el'
43+
;; and no `.el' files at path
4244
(eask-error "No package in %s" path))
43-
(package-desc-name pkg-desc))
44-
)
45-
(t ;; .el file or directory
46-
;; Note package-dir-info doesn't work outside of dired mode!
45+
(package-desc-name pkg-desc)))
46+
;; .el file or directory
47+
(t
48+
;; Note `package-dir-info' doesn't work outside of dired mode!
4749
(let ((pkg-desc (with-current-buffer (dired (expand-file-name path))
4850
(eask-ignore-errors-silent (package-dir-info)))))
4951
(unless pkg-desc
50-
;; package-dir-info will return nil if there is no -pkg.el and no .el files at path
52+
;; `package-dir-info' will return nil if there is no `-pkg.el'
53+
;; and no `.el' files at path
5154
(eask-error "No package in %s" path))
5255
(package-desc-name pkg-desc)))))
5356

0 commit comments

Comments
 (0)