1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

Rename all functions called package-*-update-* to package-*-upgrade-*

* lisp/emacs-lisp/package-vc.el (package-vc-upgrade-all):
Rename from 'package-vc-update-all'.
(package-vc-upgrade): Rename from 'package-vc-update'.

* lisp/emacs-lisp/package.el (package-upgrade):
Rename from 'package-update' (bug#62750).
(package--upgradeable-packages):
Rename from 'package--updateable-packages'.
(package-upgrade-all): Rename from 'package-update-all'.
This commit is contained in:
Dmitry Gutov 2023-04-24 02:00:54 +03:00
parent 31b58161bb
commit f965f35b33
4 changed files with 36 additions and 36 deletions

View File

@ -329,15 +329,15 @@ version of the package, a newer version is also installed.
@section Package Installation
@findex package-install
@findex package-update
@findex package-update-all
@findex package-upgrade
@findex package-upgrade-all
Packages are most conveniently installed using the package menu
(@pxref{Package Menu}), but you can also use the command @kbd{M-x
package-install}. This prompts for the name of a package with the
@samp{available} status, then downloads and installs it. Similarly,
if you want to update a package, you can use the @kbd{M-x
package-update} command, and if you just want to update all the
packages, you can use the @kbd{M-x package-update-all} command.
if you want to upgrade a package, you can use the @kbd{M-x
package-upgrade} command, and if you want to upgrade all the packages,
you can use the @kbd{M-x package-upgrade-all} command.
@cindex package requirements
A package may @dfn{require} certain other packages to be installed,
@ -551,8 +551,8 @@ bugs.
source code for a package directly from source. The command will also
automatically ensure that all files are byte-compiled and auto-loaded,
just like with a regular package. Packages installed this way behave
just like any other package. You can update them using
@code{package-update} or @code{package-update-all} and delete them
just like any other package. You can upgrade them using
@code{package-upgrade} or @code{package-upgrade-all} and delete them
again using @code{package-delete}. They are even displayed in the
regular package listing. If you just wish to clone the source of a
package, without adding it to the package list, use

View File

@ -1843,13 +1843,13 @@ this includes "binary" buffers like 'archive-mode' and 'image-mode'.
** Package
+++
*** New command 'package-update'.
*** New command 'package-upgrade'.
This command allows you to upgrade packages without using 'M-x
list-packages'.
+++
*** New command 'package-update-all'.
This command allows updating all packages without any queries.
*** New command 'package-upgrade-all'.
This command allows upgrading all packages without any queries.
+++
*** New commands 'package-recompile' and 'package-recompile-all'.

View File

@ -24,7 +24,7 @@
;; While packages managed by package.el use tarballs for distributing
;; the source code, this extension allows for packages to be fetched
;; and updated directly from a version control system.
;; and upgraded directly from a version control system.
;;
;; To install a package from source use `package-vc-install'. If you
;; aren't interested in activating a package, you can use
@ -660,19 +660,19 @@ installed package."
#'string=)))
;;;###autoload
(defun package-vc-update-all ()
"Attempt to update all installed VC packages."
(defun package-vc-upgrade-all ()
"Attempt to upgrade all installed VC packages."
(interactive)
(dolist (package package-alist)
(dolist (pkg-desc (cdr package))
(when (package-vc-p pkg-desc)
(package-vc-update pkg-desc))))
(message "Done updating packages."))
(package-vc-upgrade pkg-desc))))
(message "Done upgrading packages."))
;;;###autoload
(defun package-vc-update (pkg-desc)
"Attempt to update the package PKG-DESC."
(interactive (list (package-vc--read-package-desc "Update VC package: " t)))
(defun package-vc-upgrade (pkg-desc)
"Attempt to upgrade the package PKG-DESC."
(interactive (list (package-vc--read-package-desc "Upgrade VC package: " t)))
;; HACK: To run `package-vc--unpack-1' after checking out the new
;; revision, we insert a hook into `vc-post-command-functions', and
;; remove it right after it ran. To avoid running the hook multiple
@ -870,7 +870,7 @@ Rebuilding an installation means scraping for new autoload
cookies, re-compiling Emacs Lisp files, building and installing
any documentation, downloading any missing dependencies. This
command does not fetch new revisions from a remote server. That
is the responsibility of `package-vc-update'. Interactively,
is the responsibility of `package-vc-upgrade'. Interactively,
prompt for the name of the package to rebuild."
(interactive (list (package-vc--read-package-desc "Rebuild package: " t)))
(package-vc--unpack-1 pkg-desc (package-desc-dir pkg-desc)))

View File

@ -2263,24 +2263,24 @@ had been enabled."
(message "Package `%s' installed." name))
(message "`%s' is already installed" name))))
(declare-function package-vc-update "package-vc" (pkg))
(declare-function package-vc-upgrade "package-vc" (pkg))
;;;###autoload
(defun package-update (name)
"Update package NAME if a newer version exists."
(defun package-upgrade (name)
"Upgrade package NAME if a newer version exists."
(interactive
(list (completing-read
"Update package: " (package--updateable-packages) nil t)))
"Upgrade package: " (package--upgradeable-packages) nil t)))
(let* ((package (if (symbolp name)
name
(intern name)))
(pkg-desc (cadr (assq package package-alist))))
(if (package-vc-p pkg-desc)
(package-vc-update pkg-desc)
(package-vc-upgrade pkg-desc)
(package-delete pkg-desc 'force)
(package-install package 'dont-select))))
(defun package--updateable-packages ()
(defun package--upgradeable-packages ()
;; Initialize the package system to get the list of package
;; symbols for completion.
(package--archives-initialize)
@ -2298,23 +2298,23 @@ had been enabled."
package-alist)))
;;;###autoload
(defun package-update-all (&optional query)
(defun package-upgrade-all (&optional query)
"Refresh package list and upgrade all packages.
If QUERY, ask the user before updating packages. When called
If QUERY, ask the user before upgrading packages. When called
interactively, QUERY is always true."
(interactive (list (not noninteractive)))
(package-refresh-contents)
(let ((updateable (package--updateable-packages)))
(if (not updateable)
(message "No packages to update")
(let ((upgradeable (package--upgradeable-packages)))
(if (not upgradeable)
(message "No packages to upgrade")
(when (and query
(not (yes-or-no-p
(if (length= updateable 1)
"One package to update. Do it? "
(format "%s packages to update. Do it?"
(length updateable))))))
(user-error "Updating aborted"))
(mapc #'package-update updateable))))
(if (length= upgradeable 1)
"One package to upgrade. Do it? "
(format "%s packages to upgrade. Do it?"
(length upgradeable))))))
(user-error "Upgrade aborted"))
(mapc #'package-upgrade upgradeable))))
(defun package--dependencies (pkg)
"Return a list of all dependencies PKG has.