From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.bugs Subject: bug#59923: Error when installing non-existent package add trailing dash character to package name Date: Fri, 9 Dec 2022 02:57:15 -0800 Message-ID: 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="24329"; mail-complaints-to="usenet@ciao.gmane.io" To: 59923@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 11:58:31 2022 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 1p3b5L-0006Df-Ra for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 11:58:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3b4w-0001yr-Cb; Fri, 09 Dec 2022 05:58:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3b4t-0001xX-7a for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 05:58:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3b4s-00036Q-VP for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 05:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3b4s-00064D-Nu for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 05:58:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 10:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59923 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.167058344423309 (code B ref -1); Fri, 09 Dec 2022 10:58:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Dec 2022 10:57:24 +0000 Original-Received: from localhost ([127.0.0.1]:35299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3b4G-00063t-AN for submit@debbugs.gnu.org; Fri, 09 Dec 2022 05:57:24 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:35994) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3b4F-00063n-5I for submit@debbugs.gnu.org; Fri, 09 Dec 2022 05:57:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3b4E-0001f4-Nl for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 05:57:22 -0500 Original-Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3b49-0002zl-IA for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 05:57:22 -0500 Original-Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-142b72a728fso5206652fac.9 for ; Fri, 09 Dec 2022 02:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:mime-version :from:from:to:cc:subject:date:message-id:reply-to; bh=fwwfCCKlPd63dDTLA2Z0cvLi9UcryMwvBHhk5Allnsg=; b=MCCILJcXTcMd/PoUPdbJ+mwXGo6UQ/gMy+YKI1vtnyyAI2FpC1zQ5Q6QUfP3uQMPN3 p0M8sGtxg+oroXLadc/4GS8RJC8/nSP42V9DUCqv2adzItUHAD2H0Npg/xfwNH+HCu84 0ZM7QO848AZMXNtC+hbETZ3xp7w5rFcjMi+OObwq8eK7gLtR/ktF4MIzKrJLSVMM9yyN Kwiv1jvW+AgT1/IZm+qf9vC09vrZVrwkfywXCiKbL5vPgpIcKAVFEHBmRN7KM/5z13C9 AwP7KYiaiMDGqdI4Fwj9xCrQa7SYxF73I8lAKz0tO1sueUSr+M4exTn9vQ+7yJmU8xbR dcIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:to:subject:message-id:date:mime-version :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fwwfCCKlPd63dDTLA2Z0cvLi9UcryMwvBHhk5Allnsg=; b=PCfBX0HeuttisMtnDnLPjbHogRJDvU+Ulwf/V7cy+AjAG76pLN+HzSdFQ1PaHYzYGw w08XwQej0Jy7eVCkHmVIu7Iz53bJc5WLPTdjgo40qiDUEFl2PzH46/WEfquyBeztl/e9 7tE2X0GHK3ifcfCK2rx1Kl+sdYo1ZuGw7KvR3BxRMBil34+Srs8VcGU1NWLQElfzK0Mt MCS96UFGvgFUriIUu9Vh2sFg5p4F7Y0OVpYWn7bEwnAHG+qfuOdrCbb8PwLQGLWTXGrZ tuE1Evy/0QR8gKHPIenCFzM+jDVwSlO/uFEqjbhDwtFwq4qw0YpuTIoa/rfXAPBewZMD u/uA== X-Gm-Message-State: ANoB5pmTqMvac7h8GZfFUns1XWTlTWuoe48KYmoO1D8qlwhNc2EoRjoI yiwoVW6hAJOLACZ8s/EDPaHcgFbu1dZCuSV1e/9e2O1B X-Google-Smtp-Source: AA0mqf4qUmcy/vR2LM4dGOA3eMQwFBTsjP8lrsLHMSnmAf+Gag7xOcUEUEAUbHX8bkQE/fczYBeEyJIFutAScw863Lc= X-Received: by 2002:a05:6870:668a:b0:145:3a7:99c with SMTP id ge10-20020a056870668a00b0014503a7099cmr573159oab.92.1670583436216; Fri, 09 Dec 2022 02:57:16 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 9 Dec 2022 02:57:15 -0800 X-Hashcash: 1:20:221209:bug-gnu-emacs@gnu.org::c6bwSLCBB7YineIi:0c5q Received-SPF: pass client-ip=2001:4860:4864:20::2f; envelope-from=stefankangas@gmail.com; helo=mail-oa1-x2f.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250377 Archived-At: Severity: minor Tags: patch When evaluating the following to install a package that is not available, (package-install 'foobar) I get the error message Package =E2=80=98foobar-=E2=80=99 is unavailable This makes me think I made a typo, and have added a trailing dash that shouldn't have been there. I would expect the package name to not contain that trailing dash. Here's the backtrace: Debugger entered--Lisp error: (error "Package =E2=80=98foobar-=E2=80=99 is = unavailable") error("Package `%s-%s' is unavailable" foobar "") package-compute-transaction(nil ((foobar))) package-install(foobar) elisp--eval-last-sexp(nil) eval-last-sexp(nil) funcall-interactively(eval-last-sexp nil) command-execute(eval-last-sexp) Perhaps this is an okay fix? diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index a9fd8c741e..4d33311cb7 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1949,8 +1949,10 @@ package-compute-transaction (if (eq next-pkg 'emacs) (error "This package requires Emacs version %s" (package-version-join next-version)) - (error "Package `%s-%s' is unavailable" - next-pkg (package-version-join next-version)))))) + (error (if (not next-version) + (format "Package `%s' is unavailable" next-pkg) + (format "Package `%s' (version %s) is unavailable= " + next-pkg (package-version-join next-version)))))))) (setq packages (package-compute-transaction (cons found packages) (package-desc-reqs found)