From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gabriel Newsgroups: gmane.emacs.bugs Subject: bug#47124: 28.0.50; [PATCH] Init archive and add noconfirm to 'package-install-selected-packages' Date: Sat, 13 Mar 2021 14:15:07 -0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33203"; mail-complaints-to="usenet@ciao.gmane.io" To: 47124@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 13 18:21:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lL7ws-0008QA-MP for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 18:21:10 +0100 Original-Received: from localhost ([::1]:46892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lL7wr-0004mM-Db for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 13 Mar 2021 12:21:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL7ru-0000ms-SI for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 12:16:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lL7ru-0003RI-Er for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 12:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lL7ru-0002o0-AQ for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 12:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gabriel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Mar 2021 17:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47124 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161565572810738 (code B ref -1); Sat, 13 Mar 2021 17:16:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Mar 2021 17:15:28 +0000 Original-Received: from localhost ([127.0.0.1]:60624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lL7rL-0002n7-Vl for submit@debbugs.gnu.org; Sat, 13 Mar 2021 12:15:28 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:39396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lL7rJ-0002mz-BN for submit@debbugs.gnu.org; Sat, 13 Mar 2021 12:15:26 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL7rI-0000Yl-DB for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 12:15:25 -0500 Original-Received: from mail-dm6nam12olkn2029.outbound.protection.outlook.com ([40.92.22.29]:16128 helo=NAM12-DM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lL7rF-0003Ad-9u for bug-gnu-emacs@gnu.org; Sat, 13 Mar 2021 12:15:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HNPoB8kOvKoWfp3K/dyISZRCu1YH9Z6t/CtQVArFqSn1bTOu+6DN+Hj8QMI4viX12M3T9FQHRXjh8IgcJZswnW477cREcxHhywZfgrPatbMhpG9nweg22djnjKNc513coH4YemSGV2sTmCK84qAjQIKIODudqueiScl3SxYzSnXGyhrcoAoy02bG5OEhtpDKkQ6j8ZF0rkGF1VMMZsGaqhZDTGWPtgd9qX/mtGh8FVyvK8wJk9WEqwGzB3Bn8f8vhY2nU+C8ysXtzzqGh0Es4hf7DFrvWLkpMylw2+ywTTZdOiWkWb6CR7jItfAQ69vRG7WBmU09OD0DuP29Ae6ERA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HjGLDNcX+2NzHel/n8+YPoE9EXTM1VrW+LXjXmchKd4=; b=a5YKqhtfWSN7suWys+MTXwpHhZ5OItxqqXIWxg40tWDS6s6BIB2ynUPdTl9r4HPbRC6nk1rpPxq/pb67eoYSPwN5/eK6nGwpfzLQFhzEMvHbhfNcY6TwQ/gFVwoT5Djr5l41xxyI3OCnpW0GI2lKgTsQvUZ95iaWN3p7wP6hxP6LWXpOQ2Rh1BUn0WaJ8xrfauMdwyizbjGrrf+doBMQWhTtcn9KRMUF/D3jV7aeBFHfvnczhcsW3o5N9UH0xr8tsArA3wmTidrQjeQpgT1z57Zyxhwnx3HqIQqJ4FOBjTxIO5hRXbRvw7LOJIGT49iPKBmuPEOohPgRat6uwzMgTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HjGLDNcX+2NzHel/n8+YPoE9EXTM1VrW+LXjXmchKd4=; b=i/wuzILcoYx9pnOj3o5HrZPZEXRssRgZrC6sNk8t3rOVeNPjX+kmp8woszW2Bw89Rl6jhM1rj5W579Yemhh2bIkQ58EqsSPIjDBC/IUvncHQoB7lRTGNjQYjWMd+le5RrQveBBNlxK1+36hXfOD5ZMD25FQww+g+Kn+LWMF59593gz232o2DsI4uf7jzUZmZSpTujMrVdOmVMA7mtQhXPPLAR4QJVPu6sjb6JJ45kZFRmImOui1WxvTqCj2+nD7cNts8RE4IOe30UNf+W8Db18DmtmT4crVZ0Ih3yz7eSuHWLkJUuIAvVS7iaBw/xEADLCtkeWHIrG8d9jTx6Sc1XA== Original-Received: from DM6NAM12FT067.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc64::4b) by DM6NAM12HT037.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc64::390) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.9; Sat, 13 Mar 2021 17:15:16 +0000 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com (2a01:111:e400:fc64::44) by DM6NAM12FT067.mail.protection.outlook.com (2a01:111:e400:fc64::397) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3955.9 via Frontend Transport; Sat, 13 Mar 2021 17:15:16 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:A8F001FACDDD67F2AB0B1CD27F2A73B5916D598ACF7971D119DF9C2D2792995C; UpperCasedChecksum:6530DCC6066DE5D9BF110EF60765567AE1D6F936CFA19F99FE4A97CF5648107E; SizeAsReceived:7279; Count:42 Original-Received: from CH2PR01MB5879.prod.exchangelabs.com ([fe80::592f:9a58:d8cd:d9c9]) by CH2PR01MB5879.prod.exchangelabs.com ([fe80::592f:9a58:d8cd:d9c9%7]) with mapi id 15.20.3912.028; Sat, 13 Mar 2021 17:15:16 +0000 X-TMN: [Npxmi44zOYne9AVbux5tXRH86L6g8zmdiqaC9Quad9Iqxc0uzt5wXU/zrNoWbeaG] X-ClientProxiedBy: CP3P284CA0099.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:6f::14) To CH2PR01MB5879.prod.exchangelabs.com (2603:10b6:610:3c::12) X-Microsoft-Original-Message-ID: <877dmb2cx0.fsf@hotmail.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from precision5540 (2804:431:c7f2:d29a:bc7e:8e85:9e80:fe60) by CP3P284CA0099.BRAP284.PROD.OUTLOOK.COM (2603:10d6:103:6f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Sat, 13 Mar 2021 17:15:15 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 42 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: f1bcb505-5e2e-4082-59c8-08d8e6439223 X-MS-TrafficTypeDiagnostic: DM6NAM12HT037: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ve6YibjYpx2koZPIUESBzD/yn9kJJw0v5xkuIGvA+vuRkxjDc2mzx7LAm/g0x4BvR3D1OE6ViE55MPPE0nH6YdbaW/7vTmoq+8F8Ijw/ONhUo7qnCpfDxTqSAHAs2gKM9iykQh9LTt/Y7iX1Q8sApCJ9IXJHCmizKFqRLV44xn0DDoKQP68sQ8yYEzmekpHgfaP1+cgoHN0hiEELb6jlCwT8MOjVcbhs/nON0vJxuz/QTgmq+2J2UpQm/CJfWqTjbCNzJqFVHzAjyK+XzVmcjMG8eCjHXmURMoQIBRwbxQjxb9tm7o7PXHZM8B//6P9f85nk9CtI9Wia4CEsC79sWp88Th9h2wJW9Y1KGn3R7ydbekoWGnrsuYqAej+Mi4185Qq5WMT4HtowLSM9tuimO6eztg1LvVFQQPSnDvk20IE= X-MS-Exchange-AntiSpam-MessageData: Y6oMjDgO7O9ntV7gTALW2TSmfWuZ7vJveg8zNyakBFiLVrXkSlPXLiVhVxGfT9UtPSjozWLIy8XIOd9XdaZ3rz/MEyPwqeoXpaQjOTmiTtYHfhRoZmSU908eKiCEnEX3xDE540+j/fFTAcWGMYdwL4LUhjX5ZZEelf2Yk1MwFplx9Oo15oeOaIfKplDHOlQ47PIgm+QSPU++2IjV1SwunQ== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1bcb505-5e2e-4082-59c8-08d8e6439223 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2021 17:15:16.7649 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT067.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6NAM12HT037 Received-SPF: pass client-ip=40.92.22.29; envelope-from=gabriel376@hotmail.com; helo=NAM12-DM6-obe.outbound.protection.outlook.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:202281 Archived-At: --=-=-= Content-Type: text/plain This patch adds the following to 'package-install-selected-packages': - a call to 'package--archives-initialize', to initialize the archive contents, similar to how 'package-install' works; - a new optional argument NOCONFIRM, to don't ask for confirmation when installing new packages. Thread on emacs-devel: https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00662.html --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Init-archive-and-add-noconfirm-to-package-install-se.patch >From 9cc5189d1837a7cc403849e81a27b82f9c2e1160 Mon Sep 17 00:00:00 2001 From: Gabriel do Nascimento Ribeiro Date: Sat, 13 Mar 2021 14:08:48 -0300 Subject: [PATCH] Init archive and add noconfirm to 'package-install-selected-packages' * lisp/emacs-lisp/package.el (package-install-selected-packages): Add call to 'package--archives-initialize' and add optional argument NOCONFIRM to skip user confirmation when installing packages. --- lisp/emacs-lisp/package.el | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 0973963af2..a78d05c80b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2206,13 +2206,16 @@ package-install-file (package-install-from-buffer))) ;;;###autoload -(defun package-install-selected-packages () +(defun package-install-selected-packages (&optional noconfirm) "Ensure packages in `package-selected-packages' are installed. -If some packages are not installed propose to install them." +If some packages are not installed, propose to install them. +If optional argument NOCONFIRM is non-nil, don't ask for +confirmation to install packages." (interactive) ;; We don't need to populate `package-selected-packages' before ;; using here, because the outcome is the same either way (nothing ;; gets installed). + (package--archives-initialize) (if (not package-selected-packages) (message "`package-selected-packages' is empty, nothing to install") (let* ((not-installed (seq-remove #'package-installed-p package-selected-packages)) @@ -2220,10 +2223,11 @@ package-install-selected-packages (difference (- (length not-installed) (length available)))) (cond (available - (when (y-or-n-p - (format "Packages to install: %d (%s), proceed? " - (length available) - (mapconcat #'symbol-name available " "))) + (when (or noconfirm + (y-or-n-p + (format "Packages to install: %d (%s), proceed? " + (length available) + (mapconcat #'symbol-name available " ")))) (mapc (lambda (p) (package-install p 'dont-select)) available))) ((> difference 0) (message "Packages that are not available: %d (the rest is already installed), maybe you need to `M-x package-refresh-contents'" -- 2.27.0 --=-=-=--