mirror of
https://github.com/correl/melpa.git
synced 2024-11-15 03:00:14 +00:00
use archive-file-name for find-package-file
removes some duplicated functionality
This commit is contained in:
parent
27a8d21c6f
commit
d2de69278e
1 changed files with 8 additions and 13 deletions
|
@ -582,13 +582,13 @@ If PKG-INFO is nil, an empty one is created."
|
||||||
|
|
||||||
(defun pb/archive-file-name (archive-entry)
|
(defun pb/archive-file-name (archive-entry)
|
||||||
"Return the path of the file in which the package for ARCHIVE-ENTRY is stored."
|
"Return the path of the file in which the package for ARCHIVE-ENTRY is stored."
|
||||||
(expand-file-name (format "%s-%s.%s"
|
(let* ((name (car archive-entry))
|
||||||
(car archive-entry)
|
(pkg-info (cdr archive-entry))
|
||||||
(car (aref (cdr archive-entry) 0))
|
(version (package-version-join (aref pkg-info 0)))
|
||||||
(if (eq 'single (aref (cdr archive-entry) 3))
|
(flavour (aref pkg-info 3)))
|
||||||
"el"
|
(expand-file-name
|
||||||
"tar"))
|
(format "%s-%s.%s" name version (if (eq flavour 'single) "el" "tar"))
|
||||||
package-build-archive-dir))
|
package-build-archive-dir)))
|
||||||
|
|
||||||
(defun pb/remove-archive (archive-entry)
|
(defun pb/remove-archive (archive-entry)
|
||||||
"Remove ARCHIVE-ENTRY from archive-contents, and delete associated file.
|
"Remove ARCHIVE-ENTRY from archive-contents, and delete associated file.
|
||||||
|
@ -690,12 +690,7 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
||||||
|
|
||||||
(defun pb/find-package-file (name)
|
(defun pb/find-package-file (name)
|
||||||
"Return the filename of the most recently built package of NAME."
|
"Return the filename of the most recently built package of NAME."
|
||||||
(let* ((pkg-info (cdr (assoc name (package-build-archive-alist))))
|
(pb/archive-file-name (assoc name (package-build-archive-alist))))
|
||||||
(version (package-version-join (aref pkg-info 0)))
|
|
||||||
(flavour (aref pkg-info 3)))
|
|
||||||
(expand-file-name
|
|
||||||
(format "%s-%s.%s" name version (if (eq flavour 'single) "el" "tar"))
|
|
||||||
package-build-archive-dir)))
|
|
||||||
|
|
||||||
|
|
||||||
;;; Public interface
|
;;; Public interface
|
||||||
|
|
Loading…
Reference in a new issue