help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: upgrading packages via script


From: Seb
Subject: Re: upgrading packages via script
Date: Wed, 27 Sep 2017 17:39:51 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

On Wed, 27 Sep 2017 10:33:50 -0500,
Seb <spluque@gmail.com> wrote:

> On Wed, 27 Sep 2017 15:21:26 +0200,
> Michael Heerdegen <michael_heerdegen@web.de> wrote:

>> Seb <spluque@gmail.com> writes:
>>> ╭───── [ upgrade_packages.el ] │ (setq package-archives │ (quote │
>>> (("gnu" . "http://elpa.gnu.org/packages/";) │ ("melpa"
>>> . "http://melpa.org/packages/";) │ ("marmalade"
>>> . "https://marmalade-repo.org/packages/";) │ ("org"
>>> . "http://orgmode.org/elpa/";)))) │ (package-initialize) │
>>> (list-packages) │ (package-menu-mark-upgrades) │
>>> (package-menu-execute t) ╰─────

>> My first guess would be that in nature, one has to wait until the
>> package manager has refreshed the view before one can select packages
>> to upgrade.  Your script finishes before that because updating the
>> package list happens asynchronously.

> That was also my first guess, but in that case shouldn't
> (package-menu-execute t) fail altogether?

Well, I found the variable package-menu-async, which if toggled answers
my question.  If set to nil in the script, then packages to upgrade are
found successfully against the latest candidates.  If non-nil, as by
default, then things go wrong as shown, so answer is no.

And the working script boils down to:

╭───── [ upgrade_packages.el ]
│ (setq package-archives
│       (quote
│        (("gnu" . "http://elpa.gnu.org/packages/";)
│       ("melpa" . "http://melpa.org/packages/";)
│       ("marmalade" . "https://marmalade-repo.org/packages/";)
│       ("org" . "http://orgmode.org/elpa/";)))
│       package-menu-async nil)
│ (list-packages)
│ (package-menu-mark-upgrades)
│ (package-menu-execute t)
╰─────

-- 
Seb




reply via email to

[Prev in Thread] Current Thread [Next in Thread]