diff options
| author | Philip Kaludercic | 2022-10-26 10:36:20 +0200 |
|---|---|---|
| committer | Philip Kaludercic | 2022-10-26 10:37:00 +0200 |
| commit | eaafc10f673960e1cb971ed0cddd6e366daa9b1d (patch) | |
| tree | 48dbcad96e9e8c5f500349b1055c37d6a19b958b | |
| parent | 222b863884f07b38c0e75ba77db3ba4191b1d668 (diff) | |
| download | emacs-eaafc10f673960e1cb971ed0cddd6e366daa9b1d.tar.gz emacs-eaafc10f673960e1cb971ed0cddd6e366daa9b1d.zip | |
Add support for :release-rev in 'package-vc-archive-spec-alist'
* lisp/emacs-lisp/package-vc.el (package-vc-archive-spec-alist):
Update docstring.
(package-vc-install): Use :release-rev if invoked with a prefix argument.
| -rw-r--r-- | lisp/emacs-lisp/package-vc.el | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 5dc9086eaee..8e4f2819db7 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el | |||
| @@ -136,6 +136,12 @@ The main file of the project, relevant to gather package | |||
| 136 | metadata. If not given, the assumed default is the package named | 136 | metadata. If not given, the assumed default is the package named |
| 137 | with \".el\" concatenated to the end. | 137 | with \".el\" concatenated to the end. |
| 138 | 138 | ||
| 139 | `:release-rev' (string) | ||
| 140 | |||
| 141 | A revision string indicating the revision used for the current | ||
| 142 | release in the package archive. If missing or nil, no release | ||
| 143 | was made. | ||
| 144 | |||
| 139 | All other values are ignored.") | 145 | All other values are ignored.") |
| 140 | 146 | ||
| 141 | (defun package-vc-desc->spec (pkg-desc &optional name) | 147 | (defun package-vc-desc->spec (pkg-desc &optional name) |
| @@ -414,7 +420,9 @@ guess the name of the package using `file-name-base'. This can | |||
| 414 | be overridden by manually passing the optional NAME. Otherwise | 420 | be overridden by manually passing the optional NAME. Otherwise |
| 415 | NAME-OR-URL is taken to be a package name, and the package | 421 | NAME-OR-URL is taken to be a package name, and the package |
| 416 | metadata will be consulted for the URL. An explicit revision can | 422 | metadata will be consulted for the URL. An explicit revision can |
| 417 | be requested using REV." | 423 | be requested using REV. If the command is invoked with a prefix |
| 424 | argument, the revision used for the last release in the package | ||
| 425 | archive is used." | ||
| 418 | (interactive | 426 | (interactive |
| 419 | (progn | 427 | (progn |
| 420 | ;; Initialize the package system to get the list of package | 428 | ;; Initialize the package system to get the list of package |
| @@ -424,7 +432,12 @@ be requested using REV." | |||
| 424 | (input (completing-read | 432 | (input (completing-read |
| 425 | "Fetch package source (name or URL): " packages)) | 433 | "Fetch package source (name or URL): " packages)) |
| 426 | (name (file-name-base input))) | 434 | (name (file-name-base input))) |
| 427 | (list input (intern (string-remove-prefix "emacs-" name)))))) | 435 | (list input (intern (string-remove-prefix "emacs-" name)) |
| 436 | (and current-prefix-arg | ||
| 437 | (or (package-vc-query-spec | ||
| 438 | (cadr (assoc input package-archive-contents #'string=)) | ||
| 439 | :release-rev) | ||
| 440 | (user-error "No release revision was found"))))))) | ||
| 428 | (package--archives-initialize) | 441 | (package--archives-initialize) |
| 429 | (cond | 442 | (cond |
| 430 | ((and-let* ((stringp name-or-url) | 443 | ((and-let* ((stringp name-or-url) |