Skip to content

Commit

Permalink
[#456] Use actual pluses for Emacsmirror mirror
Browse files Browse the repository at this point in the history
  • Loading branch information
raxod502 committed Jan 13, 2020
1 parent baaa8d8 commit 0d48441
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions straight.el
Original file line number Diff line number Diff line change
Expand Up @@ -2737,24 +2737,37 @@ much faster than cloning the official Emacsmirror."
PACKAGE should be a symbol. If the package is available from
Emacsmirror, return a MELPA-style recipe; otherwise return nil."
(cl-block nil
(dolist (org '("mirror" "attic"))
(with-temp-buffer
(insert-file-contents-literally org)
(when (re-search-forward (format "^%S\r?$" package) nil 'noerror)
(cl-return
`(,package :type git :host github
:repo ,(format "emacs%s/%S" org package))))))))
(let ((mirror-package (intern
(replace-regexp-in-string
"\\+" "-plus" (symbol-name package)
'fixedcase 'literal))))
(dolist (org '("mirror" "attic"))
(with-temp-buffer
(insert-file-contents-literally org)
(when (re-search-forward
(format "^%S\r?$" mirror-package) nil 'noerror)
(cl-return
`(,package :type git :host github
:repo ,(format "emacs%s/%S" org mirror-package)))))))))

(defun straight-recipes-emacsmirror-mirror-list ()
"Return a list of recipes available in Emacsmirror, as a list of strings."
(let ((packages nil))
(dolist (org '("mirror" "attic"))
(with-temp-buffer
(insert-file-contents-literally org)
(setq packages (nconc (split-string (buffer-string) "\n" 'omit-nulls)
(setq packages (nconc (mapcar
(lambda (package)
(replace-regexp-in-string
"-plus\\b" "+" package 'fixedcase 'literal))
(split-string (buffer-string) "\n" 'omit-nulls))
packages))))
packages))

(defun straight-recipes-emacsmirror-mirror-version ()
"Return the current version of the Emacsmirror mirror retriever."
2)

;;;;;;; Emacsmirror source

(defun straight-recipes-emacsmirror-retrieve (package)
Expand Down Expand Up @@ -2791,7 +2804,7 @@ Emacsmirror, return a MELPA-style recipe; otherwise return nil."

(defun straight-recipes-emacsmirror-version ()
"Return the current version of the Emacsmirror retriever."
1)
2)

;;;;; Recipe conversion

Expand Down

0 comments on commit 0d48441

Please sign in to comment.