mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Assume VC data is directly usable in 'package-archive-contents'
* package-vc.el (package-vc-fetch): Remove string parsing and translation code.
This commit is contained in:
parent
168929cf0d
commit
ffb06d9100
1 changed files with 3 additions and 15 deletions
|
|
@ -184,26 +184,14 @@ be requested using REV."
|
|||
(:rev . ,rev))))
|
||||
((when-let* ((desc (cadr (assoc name-or-url package-archive-contents
|
||||
#'string=)))
|
||||
(spec (or (alist-get :vc (package-desc-extras desc))
|
||||
(user-error "Package has no VC header"))))
|
||||
(unless (string-match
|
||||
(rx bos
|
||||
(group (+ alnum))
|
||||
(+ blank) (group (+ (not blank)))
|
||||
(? (+ blank) (group (+ (not blank)))
|
||||
(? (+ blank) (group (+ (not blank)))))
|
||||
eos)
|
||||
spec)
|
||||
(user-error "Invalid repository specification %S" spec))
|
||||
(upstream (or (alist-get :vc (package-desc-extras desc))
|
||||
(user-error "Package has no VC data"))))
|
||||
(package-desc-create
|
||||
:name (if (stringp name-or-url)
|
||||
(intern name-or-url)
|
||||
name-or-url)
|
||||
:kind 'vc
|
||||
:extras `((:upstream . ,(list (intern (match-string 1 spec))
|
||||
(match-string 2 spec)
|
||||
(match-string 3 spec)
|
||||
(match-string 4 spec)))
|
||||
:extras `((:upstream . ,upstream)
|
||||
(:rev . ,rev)))))
|
||||
((user-error "Unknown package to fetch: %s" name-or-url)))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue