From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: package-update-all from command line Date: Tue, 24 May 2022 09:54:30 -0400 Message-ID: References: <877d6bd2a2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35599"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 24 15:57:38 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntV2X-00092w-29 for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 15:57:37 +0200 Original-Received: from localhost ([::1]:41136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntV2V-0001YE-Mb for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 09:57:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntUzf-0007lJ-9W for emacs-devel@gnu.org; Tue, 24 May 2022 09:54:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:14218) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntUzc-0002ef-8n for emacs-devel@gnu.org; Tue, 24 May 2022 09:54:37 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0B9374422F1; Tue, 24 May 2022 09:54:34 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 05DDD4422EF; Tue, 24 May 2022 09:54:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1653400472; bh=PszPl+YDirXD7oeG95T+MjmvxCQPgpHen7G27wuIo+A=; h=From:To:Subject:References:Date:In-Reply-To:From; b=gKOB8RdTlfCWi57KZMTqN9p5ere6VEE6osuhWlVHPAs6VY5mhsuHY5G8C0/Yf93dP qbfMg2g8RUJnlsa5ty401pYGhi7u3kxb+DyrLKa1T+XrZ0EYPGQmc5Spib9e2wo0iL 3y6PyCwyWnRorhIjZFrsPVsNyyKjyxtuA3FIwRKslE465OBI6cYX+wLTC0+Ip41N9M DJ3VfmznW4R76d1J6Do+4v1kS7FE3/h5O9ulxCLDE/8rFD0OyYoMHN5YJoFN2qcFX/ HejxvZQdOT4NzNBNJDn+poAvpgcMomqNmYpAcfTdQ12a+ubFcOOIxeesilMIkY35QI Z7VuhTMDCcOmg== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C881D1205A2; Tue, 24 May 2022 09:54:31 -0400 (EDT) In-Reply-To: <877d6bd2a2.fsf@gnu.org> (Sam Steingold's message of "Mon, 23 May 2022 23:42:45 -0400") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290187 Archived-At: > 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 pack= age-update-all > --8<---------------cut here---------------end--------------->8--- `package-initialize` should basically never be needed any more (other than internally within `package.el`). `package-activate-all` should be sufficient. If not, report it as a bug. > 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 =E2=80=98U=E2=80=99 to ma= rk for upgrading". I'll let the author of `package-update-all` deal with this part :-) > 2. Loading ~/.emacs.elc is relatively slow (e.g., because it fetches a > remote `remember-data-file'). so I would rather use something smaller. If it hurts don't do that: e.g., only fetch that remote file if (not noninteractive) or something like that. > --8<---------------cut here---------------start------------->8--- > emacs -batch -load package -load ~/.config/emacs/package-quickstart.elc \ The above 2 steps should be subsumed by calling `package-activate-all` > -eval '(setq package-selected-packages (delete-dups package-activated-l= ist))' \ Hmm... I wonder why you needed that. > -eval '(push (quote ("melpa" . "https://melpa.org/packages/")) package-= archives)' \ This one basically plays the role of a stripped down version of your `.emac= s`. > 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). I can't think of a way to do that in a way that's reliable for all the various ways this var can be set. :-( I have wished for there to be a init file that's loaded in batch sessions. Sometimes I feel like `early-init.el` could be this file; i.e. load it when in `--batch` as well. Stefan