emacs-devel
[Top][All Lists]
Advanced

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

package-update-all from command line


From: Sam Steingold
Subject: package-update-all from command line
Date: Mon, 23 May 2022 23:42:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

I would like to be able to update packages from the command line, and
thanks to Lars, I now can do

--8<---------------cut here---------------start------------->8---
emacs -batch -funcall package-initialize -load ~/.emacs.elc -funcall 
package-update-all
--8<---------------cut here---------------end--------------->8---

Alas, this has two problems:

1. It prints "No packages to update" even though M-x list-packages RET
reports "Packages that can be upgraded: 3; type ā€˜Uā€™ to mark for upgrading".

2. Loading ~/.emacs.elc is relatively slow (e.g., because it fetches a
remote `remember-data-file'). so I would rather use something smaller.

After much experimentation, it turned out that this is what I need:

--8<---------------cut here---------------start------------->8---
emacs -batch -load package -load ~/.config/emacs/package-quickstart.elc \
  -eval '(setq package-selected-packages (delete-dups package-activated-list))' 
\
  -eval '(push (quote ("melpa" . "https://melpa.org/packages/";)) 
package-archives)' \
  -eval '(package-update-all nil)'
--8<---------------cut here---------------end--------------->8---

Note that I had to specify the `QUERY` argument to `package-update-all'
explicitly, otherwise it asked me "3 packages to update.  Do it?(yes or no)"

I wonder if this feature is working as intended, or maybe there is a way
to make it nicer.
E.g., I would like to save `package-archives' in
`package-quickstart-file' so that I won't have to specify it on the
command line (it is set in ~/.emacs, of course).

Thanks.

-- 
Sam Steingold (http://sds.podval.org/) on Pop 22.04 (jammy) X 11.0.12101003
http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com
https://thereligionofpeace.com https://fairforall.org https://ij.org/
Don't be afraid of happiness.  It does not exist.



reply via email to

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