From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#66115: [PATCH] Ensure that directory is expanded in package-vc-checkout Date: Fri, 22 Sep 2023 10:51:13 +0000 Message-ID: <875y42v5um.fsf@posteo.net> References: <87a5thfh7i.fsf@breatheoutbreathe.in> <87lecyvcyd.fsf@posteo.net> <871qeqppxm.fsf@breatheoutbreathe.in> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21521"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66115-done@debbugs.gnu.org To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 22 12:52:00 2023 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 1qjdlQ-0005LW-JK for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Sep 2023 12:52:00 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjdlL-0007jG-Ub; Fri, 22 Sep 2023 06:51:56 -0400 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 1qjdlI-0007id-Jl for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 06:51:52 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qjdlI-0004UK-Bw for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 06:51:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjdlS-0002sL-SP for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 06:52:02 -0400 Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Sep 2023 10:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 66115 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 66115@debbugs.gnu.org, philipk@posteo.net, joseph@breatheoutbreathe.in Original-Received: via spool by 66115-done@debbugs.gnu.org id=D66115.169537989610993 (code D ref 66115); Fri, 22 Sep 2023 10:52:02 +0000 Original-Received: (at 66115-done) by debbugs.gnu.org; 22 Sep 2023 10:51:36 +0000 Original-Received: from localhost ([127.0.0.1]:35362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjdl2-0002rF-Bh for submit@debbugs.gnu.org; Fri, 22 Sep 2023 06:51:36 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:58719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjdkw-0002qw-QF for 66115-done@debbugs.gnu.org; Fri, 22 Sep 2023 06:51:34 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 5204A240104 for <66115-done@debbugs.gnu.org>; Fri, 22 Sep 2023 12:51:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1695379874; bh=feQ8uJiXM6ty0jdbZjtelvFVPKxLcjwkPTOWSJaL35s=; h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:From; b=QsqpC5gwgO2HUThQ27YsSb/0qH7iYY3kT7E7V27qvqIiL6T0zOajEM7ht7fv3y7sV uoFSq3vu78mshA02+etMpYZmItsSyKN3P1RZi+WuqcDbsiqGlfTltaitBimp9ZaTWp pM1SLaON8mdHQACU/czLHc5heVS25ClMpreIVtGo4kZ8Atj0jcWB1SoriU2MylPDqF oz/ac4ubsgVACDWkNKtz+NNd0wqK3UAhoj5cHgVIMKi19JZItVrJySdP4dWs6srrBS T9SpgO9/y22Xbbvsoi8aDWNtJ5BpwU+5nlDbG607/c0z6iQTtD2ektNZUmN0gVi6+S q2AhBfmwtf8Uw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RsTb5555dz9rxM; Fri, 22 Sep 2023 12:51:13 +0200 (CEST) In-Reply-To: <871qeqppxm.fsf@breatheoutbreathe.in> (Joseph Turner's message of "Fri, 22 Sep 2023 01:33:45 -0700") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM 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:271062 Archived-At: Joseph Turner writes: > Philip Kaludercic writes: > >> Joseph Turner writes: >> >>> Tags: patch >>> >>> Tags: patch >>> >>> This patch fixes a serious bug which caused package-vc-checkout to fail >>> entirely when its second argument `directory' was not expanded. >>> >>> From 75a6ec74ff5e31edc7592b68e7ad9d1ec26f515c Mon Sep 17 00:00:00 2001 >>> From: Joseph Turner >>> Date: Wed, 20 Sep 2023 00:12:10 -0700 >>> Subject: [PATCH] Ensure that directory is expanded in package-vc-checkout >>> >>> * lisp/emacs-lisp/package-vc.el (package-vc-checkout) >>> --- >>> lisp/emacs-lisp/package-vc.el | 1 + >>> 1 file changed, 1 insertion(+) >>> >>> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el >>> index 29b540d86b8..47d8c996ff0 100644 >>> --- a/lisp/emacs-lisp/package-vc.el >>> +++ b/lisp/emacs-lisp/package-vc.el >>> @@ -834,6 +834,7 @@ for the last released version of the package." >>> (setf dir subdir) >>> (user-error "Directory not empty: %S" (expand-file-name dir))))) >>> (list desc dir (and current-prefix-arg :last-release)))) >>> + (setf directory (expand-file-name directory)) >>> (package-vc--archives-initialize) >>> (let ((pkg-spec (or (package-vc--desc->spec pkg-desc) >>> (and-let* ((extras (package-desc-extras pkg-desc)) >> >> DIRECTORY is passed on to `package-vc--clone' and in turn `vc-clone'. >> Wouldn't it be more robust to ensure that `vc-clone' can handle >> unexpanded directory names, eg. like this: >> >> diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el >> index 2f4b028bb4a..7f334397a5e 100644 >> --- a/lisp/vc/vc.el >> +++ b/lisp/vc/vc.el >> @@ -3676,8 +3676,7 @@ vc-clone >> checkout. If BACKEND is nil, iterate through every known backend >> in `vc-handled-backends' until one succeeds. If REV is non-nil, >> it indicates a specific revision to check out." >> - (unless directory >> - (setq directory default-directory)) >> + (setq directory (expand-file-name (or directory default-directory))) >> (if backend >> (progn >> (unless (memq backend vc-handled-backends) > > Yes, certainly. Your solution is better. OK, closing the issue.