From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Semyonov via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64242: [PATCH] Fix VC package build when there is no docs dir Date: Fri, 23 Jun 2023 09:32:01 +0300 Message-ID: <87fs6ilme6.fsf@dsemy.com> References: <877cruvijk.fsf@dsemy.com> <83352i3ed4.fsf@gnu.org> Reply-To: Daniel Semyonov 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="32002"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 64242@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 23 08:35:18 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 1qCaO5-00089B-VV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jun 2023 08:35:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCaNs-0005ez-QB; Fri, 23 Jun 2023 02:35:04 -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 1qCaNr-0005d9-0Q for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 02:35:03 -0400 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 1qCaNq-0006t1-Jz for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 02:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qCaNq-0000pj-BU for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 02:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Semyonov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jun 2023 06:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64242 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64242-submit@debbugs.gnu.org id=B64242.16875020513137 (code B ref 64242); Fri, 23 Jun 2023 06:35:02 +0000 Original-Received: (at 64242) by debbugs.gnu.org; 23 Jun 2023 06:34:11 +0000 Original-Received: from localhost ([127.0.0.1]:37337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCaN0-0000oW-NG for submit@debbugs.gnu.org; Fri, 23 Jun 2023 02:34:11 -0400 Original-Received: from dsemy.com ([46.23.89.208]:40172) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCaMy-0000oH-GD for 64242@debbugs.gnu.org; Fri, 23 Jun 2023 02:34:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=dkim; bh=o648cSrG6a6ds WIG+1HlXZD634q9A5+ok856+01kj0Q=; h=date:references:in-reply-to: subject:cc:to:from; d=dsemy.com; b=buz+qSoE85zF/X64hSKupyX1bfI15GBO8FM VMA6AQiYR+VGOhjheVUyeM4TCOr4aCT+CCM8Pk83+6gdV290psHwBKSCLy5Uj0KTE4Zhvi i7JFCbUCOVSel2OyrLORPS1Pyhcg1PXYAVTEcuWeSG3hv2oeJvzFKStdNP9mYBrcjHCCPP OAGGhSqntf0Ig4lt14p9yuJGbof5Q6Bygeniq9tiwv2rbLvJ+9DYxD/70V1NT1CTJIIxMc oSa26hYP/zMoQi6eccxo9OckNULOAaDVK9L9uMs24k8EgLyI5uSSLbJuZSz4Ffy2YiabCv ZAqjJsGe5GXuZb0zP8AAHvO8+cA== Original-Received: from coldharbour.home.arpa (bzq-109-64-87-185.red.bezeqint.net [109.64.87.185]) by dsemy.com (OpenSMTPD) with ESMTPSA id aebbcb39 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 23 Jun 2023 08:34:01 +0200 (CEST) Original-Received: from localhost (coldharbour.home.arpa [local]) by coldharbour.home.arpa (OpenSMTPD) with ESMTPA id dbad34a0; Fri, 23 Jun 2023 06:32:01 +0000 (UTC) In-Reply-To: <83352i3ed4.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 23 Jun 2023 09:02:47 +0300") 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:263932 Archived-At: --=-=-= Content-Type: text/plain >>>>> Eli Zaretskii writes: > What do you mean by "isn't a directory"? FILE is supposed to be a > documentation file, not a directory, see the doc string of this > function. Do you mean that FILE is a relative file name so that > file-name-directory returns nil for it? If so, I think the > correct fix would be to reverse the order: > (docs-directory (file-name-directory (expand-file-name file))) Yeah, you're completely right, this was a misunderstanding on my part; my fix just happened to also work so I made some incorrect assumptions. After some further testing, this seems to happen for packages for which the doc file is in the base directory of the package (which causes 'file-name-directory' to return nil as the doc file name is relative to the package dir). I attached an updated patch. > Can you show a recipe to reproduce this problem, preferably > starting from "emacs -Q"? 1. $ emacs -Q 2. M-x package-vc-install RET eat RET 3. A few seconds later, "package-vc--unpack-1: Wrong type argument: stringp, nil" > And finally, this issue exists on the emacs-29 release branch as > well, doesn't it? I haven't tested it, but I don't see a reason it wont. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Fix-VC-package-build-when-doc-file-isn-t-in-a-subdir.patch Content-Description: patch >From 0160171b1663bf349af7ffe6de0b2ea6b4b326a7 Mon Sep 17 00:00:00 2001 From: Daniel Semyonov Date: Fri, 23 Jun 2023 08:40:57 +0300 Subject: [PATCH] Fix VC package build when doc file isn't in a subdir * lisp/emacs-lisp/package-vc.el (package-vc--build-documentation): Expand 'file' before attempting to get its directory. --- lisp/emacs-lisp/package-vc.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index f34cfb3120b..db8b41aee6a 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -386,7 +386,7 @@ package-vc--build-documentation otherwise it's assumed to be an Info file." (let* ((pkg-name (package-desc-name pkg-desc)) (default-directory (package-desc-dir pkg-desc)) - (docs-directory (expand-file-name (file-name-directory file))) + (docs-directory (file-name-directory (expand-file-name file))) (output (expand-file-name (format "%s.info" pkg-name))) clean-up) (when (string-match-p "\\.org\\'" file) -- 2.41.0 --=-=-=--