mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 04:21:24 +00:00
Copy changes from tarballs when installing VC packages
* etc/NEWS: Document change. * lisp/emacs-lisp/package-vc.el (package-vc--clone): Implement logic to find and copy files from a previous installation. (package-vc-install): Indicate the effect of the prefix argument in the prompt.
This commit is contained in:
parent
407b5ce7ab
commit
b13450973a
2 changed files with 33 additions and 2 deletions
10
etc/NEWS
10
etc/NEWS
|
|
@ -36,6 +36,16 @@ applies, and please also update docstrings as needed.
|
|||
|
||||
* Changes in Specialized Modes and Packages in Emacs 32.1
|
||||
|
||||
** Package
|
||||
|
||||
---
|
||||
*** Package-vc can copy local changes from existing installations
|
||||
When installing the latest release of a package, package-vc will propose
|
||||
copying files from an existing, tarball installation of the same package
|
||||
with the same version. This is useful if you have started making local
|
||||
changes to your tarball installation, and then decide to check out the
|
||||
repository to prepare a patch for the package maintainer.
|
||||
|
||||
|
||||
* New Modes and Packages in Emacs 32.1
|
||||
|
||||
|
|
|
|||
|
|
@ -725,7 +725,25 @@ attribute in PKG-SPEC."
|
|||
;; Check out the latest release if requested
|
||||
(when (eq rev :last-release)
|
||||
(if-let* ((release-rev (package-vc--release-rev pkg-desc)))
|
||||
(vc-retrieve-tag dir release-rev)
|
||||
(progn
|
||||
(vc-retrieve-tag dir release-rev)
|
||||
(when-let* ((vers (version-to-list
|
||||
(lm-package-version (package-vc--main-file pkg-desc))))
|
||||
(prev-desc (package-get-descriptor
|
||||
name 'installed
|
||||
(lambda (desc)
|
||||
(version-list-= (package-desc-version desc)
|
||||
vers))))
|
||||
(_ (yes-or-no-p "Copy files from previous installation?")))
|
||||
(let* ((remove (seq-remove
|
||||
#'file-exists-p
|
||||
(let ((default-directory dir))
|
||||
(mapcar #'expand-file-name '("REAME-elpa"))))))
|
||||
(copy-directory
|
||||
(file-name-as-directory (package-desc-dir prev-desc))
|
||||
(file-name-as-directory dir)
|
||||
nil 'parents 'copy-contents)
|
||||
(mapc #'delete-file remove))))
|
||||
(message "No release revision was found, continuing...")))))
|
||||
|
||||
(defvar package-vc-non-code-file-names
|
||||
|
|
@ -941,7 +959,10 @@ installs takes precedence."
|
|||
;; symbols for completion.
|
||||
(package-vc--archives-initialize)
|
||||
(let* ((name-or-url (package-vc--read-package-name
|
||||
"Fetch and install package: " t))
|
||||
(if current-prefix-arg
|
||||
"Fetch and install latest release of package: "
|
||||
"Fetch and install package: ")
|
||||
t))
|
||||
(name (file-name-base (directory-file-name name-or-url))))
|
||||
(when (string-empty-p name)
|
||||
(user-error "Empty package name"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue