bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64242: [PATCH] Fix VC package build when there is no docs dir


From: Daniel Semyonov
Subject: bug#64242: [PATCH] Fix VC package build when there is no docs dir
Date: Fri, 23 Jun 2023 09:32:01 +0300
User-agent: Gnus/5.13 (Gnus v5.13)

>>>>> 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.

>From 0160171b1663bf349af7ffe6de0b2ea6b4b326a7 Mon Sep 17 00:00:00 2001
From: Daniel Semyonov <daniel@dsemy.com>
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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]