unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* package-update-all from command line
@ 2022-05-24  3:42 Sam Steingold
  2022-05-24 13:54 ` Stefan Monnier
  2022-05-25  1:26 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 19+ messages in thread
From: Sam Steingold @ 2022-05-24  3:42 UTC (permalink / raw)
  To: emacs-devel

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.



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-05-27 20:33 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-24  3:42 package-update-all from command line Sam Steingold
2022-05-24 13:54 ` Stefan Monnier
2022-05-24 14:05   ` Eli Zaretskii
2022-05-24 16:00     ` Loading early-init.el in batch mode (was: package-update-all from command line) Stefan Monnier
2022-05-24 18:58       ` Eli Zaretskii
2022-05-24 15:04   ` package-update-all from command line Sam Steingold
2022-05-24 15:52     ` Stefan Monnier
2022-05-24 19:01       ` Sam Steingold
2022-05-24 19:55         ` Stefan Monnier
2022-05-25 15:14           ` Sam Steingold
2022-05-25 16:13             ` Stefan Monnier
2022-05-26 15:13               ` Sam Steingold
2022-05-26 15:35                 ` Stefan Monnier
2022-05-25  1:26 ` Lars Ingebrigtsen
2022-05-25  4:58   ` Tassilo Horn
2022-05-25 12:05     ` Lars Ingebrigtsen
2022-05-25 12:27       ` Tassilo Horn
2022-05-27 10:21         ` Lars Ingebrigtsen
2022-05-27 20:33           ` Tassilo Horn

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).