mirror of
https://github.com/correl/melpa.git
synced 2024-11-25 03:00:10 +00:00
Search files for "-pkg.el" file.
This will fix problems when the "-pkg.el" file is located in a subdirectory as long as that file is included in the ":files" list specified by the recipe, which *should* be the case anyways because you would want that file installed as part of the package.
This commit is contained in:
parent
0a70991695
commit
605b7a0ac7
1 changed files with 8 additions and 2 deletions
|
@ -522,6 +522,11 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
|||
"Prompt for a package name, returning a symbol."
|
||||
(intern (completing-read "Package: " package-build-alist)))
|
||||
|
||||
(defun pb/find-source-file (target files)
|
||||
"Search for source of TARGET in FILES."
|
||||
(let* ((entry (rassoc target files)))
|
||||
(when entry (car entry))))
|
||||
|
||||
;;; Public interface
|
||||
(defun package-build-archive (name)
|
||||
"Build a package archive for package NAME."
|
||||
|
@ -556,12 +561,13 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
|||
(pb/add-to-archive-contents pkg-info 'single)))
|
||||
((< 1 (length files))
|
||||
(let* ((pkg-dir (concat file-name "-" version))
|
||||
;; TODO: What if the upstream "-pkg.el" file is in a subdir?
|
||||
(pkg-file (concat file-name "-pkg.el"))
|
||||
(pkg-file-source (or (pb/find-source-file pkg-file files)
|
||||
pkg-file))
|
||||
(pkg-info
|
||||
(pb/merge-package-info
|
||||
(let ((default-directory pkg-cwd))
|
||||
(or (pb/get-pkg-file-info pkg-file)
|
||||
(or (pb/get-pkg-file-info pkg-file-source)
|
||||
;; some packages (like magit) provide name-pkg.el.in
|
||||
(pb/get-pkg-file-info (concat pkg-file ".in"))
|
||||
(pb/get-package-info (concat file-name ".el"))))
|
||||
|
|
Loading…
Reference in a new issue