From ffb06d910043bcbfad939e43442f81fe3421f0d5 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 2 Aug 2022 17:12:45 +0200 Subject: [PATCH] Assume VC data is directly usable in 'package-archive-contents' * package-vc.el (package-vc-fetch): Remove string parsing and translation code. --- lisp/emacs-lisp/package-vc.el | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 7e76725a05c..f5263d08b96 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -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))))) -- 2.39.5