all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Semyonov via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 64242@debbugs.gnu.org
Subject: bug#64242: [PATCH] Fix VC package build when there is no docs dir
Date: Fri, 23 Jun 2023 09:32:01 +0300	[thread overview]
Message-ID: <87fs6ilme6.fsf@dsemy.com> (raw)
In-Reply-To: <83352i3ed4.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 23 Jun 2023 09:02:47 +0300")

[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 1111 bytes --]

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	other threads:[~2023-06-23  6:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-23  5:45 bug#64242: [PATCH] Fix VC package build when there is no docs dir Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-23  6:02 ` Eli Zaretskii
2023-06-23  6:32   ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-06-23  7:10     ` Eli Zaretskii
2023-06-23  7:35       ` Philip Kaludercic
2023-06-24 10:24         ` Philip Kaludercic
2023-06-24 10:43           ` Eli Zaretskii
2023-06-24 15:34             ` Philip Kaludercic
2023-06-24 17:07               ` Eli Zaretskii
2023-06-25 21:41                 ` Philip Kaludercic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fs6ilme6.fsf@dsemy.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=64242@debbugs.gnu.org \
    --cc=daniel@dsemy.com \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.