1
Fork 0
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:
Philip Kaludercic 2022-08-02 17:12:45 +02:00
parent 168929cf0d
commit ffb06d9100

View file

@ -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)))))