mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 11:08:54 +00:00
Extract code for single and multi-file package builds into helper fns
This commit is contained in:
parent
80e99703d3
commit
2ffb028ccd
1 changed files with 76 additions and 73 deletions
|
@ -1029,7 +1029,13 @@ Returns the archive entry for the package."
|
|||
((not version)
|
||||
(error "Unable to check out repository for %s" package-name))
|
||||
((= 1 (length files))
|
||||
(let* ((pkg-source (expand-file-name (caar files) source-dir))
|
||||
(pb/build-single-file-package package-name version (caar files) source-dir target-dir))
|
||||
((< 1 (length files))
|
||||
(pb/build-multi-file-package package-name version files source-dir target-dir))
|
||||
(t (error "Unable to find files matching recipe patterns")))))
|
||||
|
||||
(defun pb/build-single-file-package (package-name version file source-dir target-dir)
|
||||
(let* ((pkg-source (expand-file-name file source-dir))
|
||||
(pkg-target (expand-file-name
|
||||
(concat package-name "-" version ".el")
|
||||
target-dir))
|
||||
|
@ -1060,7 +1066,8 @@ Returns the archive entry for the package."
|
|||
(pb/find-package-commentary pkg-source)
|
||||
package-name)
|
||||
(pb/archive-entry pkg-info 'single)))
|
||||
((< 1 (length files))
|
||||
|
||||
(defun pb/build-multi-file-package (package-name version files source-dir target-dir)
|
||||
(let* ((tmp-dir (file-name-as-directory (make-temp-file package-name t)))
|
||||
(pkg-dir-name (concat package-name "-" version))
|
||||
(pkg-tmp-dir (expand-file-name pkg-dir-name tmp-dir))
|
||||
|
@ -1080,8 +1087,6 @@ Returns the archive entry for the package."
|
|||
(pb/get-package-info pkg-source)))
|
||||
package-name
|
||||
version)))
|
||||
|
||||
|
||||
(pb/copy-package-files files source-dir pkg-tmp-dir)
|
||||
(pb/write-pkg-file (expand-file-name pkg-file
|
||||
(file-name-as-directory pkg-tmp-dir))
|
||||
|
@ -1103,8 +1108,6 @@ Returns the archive entry for the package."
|
|||
(delete-directory pkg-tmp-dir t nil)
|
||||
(pb/archive-entry pkg-info 'tar)))
|
||||
|
||||
(t (error "Unable to find files matching recipe patterns")))))
|
||||
|
||||
|
||||
;; In future we should provide a hook, and perform this step in a separate package.
|
||||
;; Note also that it would be straightforward to generate the SVG ourselves, which would
|
||||
|
|
Loading…
Reference in a new issue