diff options
| author | Philip Kaludercic | 2025-12-23 00:12:39 +0100 |
|---|---|---|
| committer | Philip Kaludercic | 2026-01-01 13:47:41 +0100 |
| commit | 4771cd2e5835efb6cfbc2efe2287ff58e7b5b6dc (patch) | |
| tree | ca8988531c3f7e74a094193744e6fa282a2d9283 | |
| parent | e1f87081d417ce69f6e101d9d38feeb77e4f3697 (diff) | |
| download | emacs-4771cd2e5835efb6cfbc2efe2287ff58e7b5b6dc.tar.gz emacs-4771cd2e5835efb6cfbc2efe2287ff58e7b5b6dc.zip | |
; Fix test resulting from 5744519e
* lisp/emacs-lisp/package.el (package-install): Delete dead code
resulting from previous change.
* test/lisp/emacs-lisp/package-tests.el
(package-test-install-single): Adjust code to expect
'user-error'
| -rw-r--r-- | lisp/emacs-lisp/package.el | 12 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/package-tests.el | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 5118f25f468..70e88d081fa 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el | |||
| @@ -2280,15 +2280,15 @@ had been enabled." | |||
| 2280 | nil t)) | 2280 | nil t)) |
| 2281 | nil))) | 2281 | nil))) |
| 2282 | (cl-check-type pkg (or symbol package-desc)) | 2282 | (cl-check-type pkg (or symbol package-desc)) |
| 2283 | (when (or (and package-install-upgrade-built-in | ||
| 2284 | (package--active-built-in-p pkg)) | ||
| 2285 | (package-installed-p pkg)) | ||
| 2286 | (user-error "Package is already installed")) | ||
| 2287 | (package--archives-initialize) | 2283 | (package--archives-initialize) |
| 2288 | (add-hook 'post-command-hook #'package-menu--post-refresh) | 2284 | (add-hook 'post-command-hook #'package-menu--post-refresh) |
| 2289 | (let ((name (if (package-desc-p pkg) | 2285 | (let ((name (if (package-desc-p pkg) |
| 2290 | (package-desc-name pkg) | 2286 | (package-desc-name pkg) |
| 2291 | pkg))) | 2287 | pkg))) |
| 2288 | (when (or (and package-install-upgrade-built-in | ||
| 2289 | (package--active-built-in-p pkg)) | ||
| 2290 | (package-installed-p pkg)) | ||
| 2291 | (user-error "`%s' is already installed" name)) | ||
| 2292 | (unless (or dont-select (package--user-selected-p name)) | 2292 | (unless (or dont-select (package--user-selected-p name)) |
| 2293 | (package--save-selected-packages | 2293 | (package--save-selected-packages |
| 2294 | (cons name package-selected-packages))) | 2294 | (cons name package-selected-packages))) |
| @@ -2304,8 +2304,8 @@ had been enabled." | |||
| 2304 | (progn | 2304 | (progn |
| 2305 | (package-download-transaction transaction) | 2305 | (package-download-transaction transaction) |
| 2306 | (package--quickstart-maybe-refresh) | 2306 | (package--quickstart-maybe-refresh) |
| 2307 | (message "Package `%s' installed." name)) | 2307 | (message "Package `%s' installed." name))))) |
| 2308 | (message "`%s' is already installed" name)))) | 2308 | |
| 2309 | 2309 | ||
| 2310 | (declare-function package-vc-upgrade "package-vc" (pkg)) | 2310 | (declare-function package-vc-upgrade "package-vc" (pkg)) |
| 2311 | 2311 | ||
diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el index 55f69d888b8..1f0a8f73a5c 100644 --- a/test/lisp/emacs-lisp/package-tests.el +++ b/test/lisp/emacs-lisp/package-tests.el | |||
| @@ -241,7 +241,9 @@ Must called from within a `tar-mode' buffer." | |||
| 241 | (package-initialize) | 241 | (package-initialize) |
| 242 | (should (package-installed-p 'simple-single)) | 242 | (should (package-installed-p 'simple-single)) |
| 243 | ;; Check if we properly report an "already installed". | 243 | ;; Check if we properly report an "already installed". |
| 244 | (should-error (package-install 'simple-single) :type 'user-error) | 244 | (should (condition-case nil |
| 245 | (progn (package-install 'simple-single) nil) | ||
| 246 | (user-error t))) | ||
| 245 | (should (package-installed-p 'simple-single)) | 247 | (should (package-installed-p 'simple-single)) |
| 246 | (let* ((simple-pkg-dir (file-name-as-directory | 248 | (let* ((simple-pkg-dir (file-name-as-directory |
| 247 | (expand-file-name | 249 | (expand-file-name |