mirror of
https://github.com/correl/melpa.git
synced 2024-11-22 19:18:39 +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)
|
||||
"Return the path of the file in which the package for ARCHIVE-ENTRY is stored."
|
||||
(expand-file-name (format "%s-%s.%s"
|
||||
(car archive-entry)
|
||||
(car (aref (cdr archive-entry) 0))
|
||||
(if (eq 'single (aref (cdr archive-entry) 3))
|
||||
"el"
|
||||
"tar"))
|
||||
package-build-archive-dir))
|
||||
(let* ((name (car archive-entry))
|
||||
(pkg-info (cdr archive-entry))
|
||||
(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)))
|
||||
|
||||
(defun pb/remove-archive (archive-entry)
|
||||
"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)
|
||||
"Return the filename of the most recently built package of NAME."
|
||||
(let* ((pkg-info (cdr (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)))
|
||||
(pb/archive-file-name (assoc name (package-build-archive-alist))))
|
||||
|
||||
|
||||
;;; Public interface
|
||||
|
|
Loading…
Reference in a new issue