From: Artur Malabarba <bruce.connor.am@gmail.com>
To: Aaron Ecay <aaronecay@gmail.com>
Cc: 21625@debbugs.gnu.org
Subject: bug#21625: [PATCH] lisp/emacs-lisp/package.el (package-install): Fix error.
Date: Tue, 6 Oct 2015 11:39:41 +0100 [thread overview]
Message-ID: <CAAdUY-+fE9V8UbQYVprmfpVjff-dTXZRPFZnx7M-YEXgwLxFyg@mail.gmail.com> (raw)
In-Reply-To: <1444074958-32600-1-git-send-email-aaronecay@gmail.com>
Looks good to me.
Thanks for the patch Aaron. Have you done the copyright paperwork?
2015-10-05 20:55 GMT+01:00 Aaron Ecay <aaronecay@gmail.com>:
> * lisp/emacs-lisp/package.el (package-install): Fix error when ‘pkg’ is
> not a ‘package-desc’. Also clarify documentation.
>
> Through trial and error, I discovered that for non-interactive use the
> ‘pkg’ argument of the package-install function should be a symbol, not a
> string. This can also be discerned by inspecting the (interactive)
> spec, specifically the call to ‘intern’. However, even when proceeding
> with a symbol an error is raised if the package is already installed.
> This patch reuses the name computed earlier in the function to avoid
> this.
> ---
> lisp/emacs-lisp/package.el | 20 ++++++++++----------
> 1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index eb66e8f..89f2a1a 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -1887,7 +1887,7 @@ add a call to it along with some explanatory comments."
> ;;;###autoload
> (defun package-install (pkg &optional dont-select)
> "Install the package PKG.
> -PKG can be a package-desc or the package name of one the available packages
> +PKG can be a package-desc or a symbol naming one of the available packages
> in an archive in `package-archives'. Interactively, prompt for its name.
>
> If called interactively or if DONT-SELECT nil, add PKG to
> @@ -1918,15 +1918,15 @@ to install it but still mark it as selected."
> pkg)))
> (unless (or dont-select (package--user-selected-p name))
> (package--save-selected-packages
> - (cons name package-selected-packages))))
> - (if-let ((transaction
> - (if (package-desc-p pkg)
> - (unless (package-installed-p pkg)
> - (package-compute-transaction (list pkg)
> - (package-desc-reqs pkg)))
> - (package-compute-transaction () (list (list pkg))))))
> - (package-download-transaction transaction)
> - (message "`%s' is already installed" (package-desc-full-name pkg))))
> + (cons name package-selected-packages)))
> + (if-let ((transaction
> + (if (package-desc-p pkg)
> + (unless (package-installed-p pkg)
> + (package-compute-transaction (list pkg)
> + (package-desc-reqs pkg)))
> + (package-compute-transaction () (list (list pkg))))))
> + (package-download-transaction transaction)
> + (message "`%s' is already installed" name))))
>
> (defun package-strip-rcs-id (str)
> "Strip RCS version ID from the version string STR.
> --
> 2.6.0
>
>
>
>
next prev parent reply other threads:[~2015-10-06 10:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 19:55 bug#21625: [PATCH] lisp/emacs-lisp/package.el (package-install): Fix error Aaron Ecay
2015-10-06 10:39 ` Artur Malabarba [this message]
2015-10-06 12:01 ` Aaron Ecay
2015-10-06 18:43 ` Artur Malabarba
2015-10-12 10:53 ` immerrr again
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAAdUY-+fE9V8UbQYVprmfpVjff-dTXZRPFZnx7M-YEXgwLxFyg@mail.gmail.com \
--to=bruce.connor.am@gmail.com \
--cc=21625@debbugs.gnu.org \
--cc=aaronecay@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.