From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: package-update-all from command line Date: Mon, 23 May 2022 23:42:45 -0400 Message-ID: <877d6bd2a2.fsf@gnu.org> Reply-To: sds@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="15534"; 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 05:43:28 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 1ntLSC-0003nq-Ll for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 05:43:28 +0200 Original-Received: from localhost ([::1]:39412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntLSB-0005PQ-6O for ged-emacs-devel@m.gmane-mx.org; Mon, 23 May 2022 23:43:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntLRa-0004iD-Ib for emacs-devel@gnu.org; Mon, 23 May 2022 23:42:50 -0400 Original-Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:46855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntLRY-0001Sr-M7; Mon, 23 May 2022 23:42:50 -0400 Original-Received: by mail-qk1-x733.google.com with SMTP id c1so14237799qkf.13; Mon, 23 May 2022 20:42:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:user-agent:return-receipt-to:reply-to :mail-followup-to:date:message-id:mime-version :content-transfer-encoding; bh=trPt4d7zCI7CYglN2cfx26iDLaCSpR13/NqHg3qKtPE=; b=AKw0wSVkG6XFlt2dDs9SKEdGuZlwXvXwpopYoJ1qU3hgT08Eue6mbLVByd18lxdvRU GWWXU7dQP7bPrElCPtJP6qs+cVHu0uO8B/QQQQ9KpsSdLQO8dx45CC0VI1et8qU/GPQf 6Dq61ooPF7fvxUV65PZcgvKS0K0XWkgBpASE/jDyyDo99oosUVmbG6magV+dbSjZHYdR qYWL+/L4WAfW+QuSJ54SNrup7ORImskmbVUSndlPHwEXhVHm2WH6vFklI/XJkiIU0eZv hodEGqh7dvZVKqfSGCWt28EOXEHzw3rruwnmOef3GVege7EUEHq5oOjw5xnIHkw7tvPX rpYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:user-agent :return-receipt-to:reply-to:mail-followup-to:date:message-id :mime-version:content-transfer-encoding; bh=trPt4d7zCI7CYglN2cfx26iDLaCSpR13/NqHg3qKtPE=; b=Xa/nj8SG2GMjIY4pWoLVn9DrUH8JGxceuBM3yOma1vx83dWm23XC45yoB3kMBLSvOv 8JC0yiM+OzkEIxhkvIM16kb6ZBCFEqQlbWAK+3NqQf1JAHHBHp614dsSzYN7pbbdSloo N0HdaOiPJLFOl5VF5uGloaKuulOHg7zy33ZxN24mlCbd5TD50rfwtKq45P/xiTOylGdF dmX29Tv4ZCbtmkEDLHcRNHKQpT7DgyPcxuAiH4rrRNgZZBUcK18Z8eAu2gyX+sFCLaBK mVnty5ccm3V/V9M4a14Zy5FEJIW88mydVmogm1K0qX1zaHthz4IJ895UP+pKMQC3gb2X HFrA== X-Gm-Message-State: AOAM532mlWJ5YFz48DLHs9igJ7K/TenTcLn41cCeMEbLyQLehTYQKNSy 2FOcYWitEeoqw0xYmrTH08fmKAbAIg== X-Google-Smtp-Source: ABdhPJxU1nr8j43sKLjAbA3jPkg6fMDUKjc5HVhPOBZSW+8AvAaPRPONdphrbMvcr1QMiOvXiYH4LA== X-Received: by 2002:a37:9b55:0:b0:6a3:4ac4:1594 with SMTP id d82-20020a379b55000000b006a34ac41594mr11294313qke.164.1653363766672; Mon, 23 May 2022 20:42:46 -0700 (PDT) Original-Received: from darter (pool-108-30-23-113.nycmny.fios.verizon.net. [108.30.23.113]) by smtp.gmail.com with ESMTPSA id a69-20020ae9e848000000b0069fc13ce252sm5381804qkg.131.2022.05.23.20.42.45 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 May 2022 20:42:46 -0700 (PDT) X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Mail-Followup-To: emacs-devel@gnu.org Received-SPF: pass client-ip=2607:f8b0:4864:20::733; envelope-from=sam.steingold@gmail.com; helo=mail-qk1-x733.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:290180 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 packag= e-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 =E2=80=98U=E2=80=99 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-lis= t))' \ -eval '(push (quote ("melpa" . "https://melpa.org/packages/")) package-ar= chives)' \ -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. --=20 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.