Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#2262 closed defect (fixed)

Vim instructions have an error

Reported by: randy@… Owned by: lfs-book@…
Priority: normal Milestone: 6.4
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

In the Vim instructions there is a command to create a /usr/share/man/ru/man1/vi.1 symlink which ends up being a dangling link as the vim.1 file is not installed into /usr/share/man/ru/man1.

Perhaps this is because the mandir patch is not used any longer?

Attachments (1)

fix-vim-mans.patch (1.6 KB ) - added by bryan@linuxfromscratch.org 16 years ago.
Proposed fix for vim manpage symlinks

Download all attachments as: .zip

Change History (15)

comment:1 by bdubbs@…, 16 years ago

I don't see this. I've got:

# ls
fr            fr.UTF-8  it.ISO8859-1  man1  pl.ISO8859-2  ru.KOI8-R
fr.ISO8859-1  it        it.UTF-8      pl    pl.UTF-8      ru.UTF-8

I don't have a /usr/share/man/ru/ directory at all. What am I missing?

comment:2 by randy@…, 16 years ago

Please look at the instructions where there is a loop creating symlinks. It should be obvious to you.

The whole problem is "I don't have a /usr/share/man/ru/ directory at all." (quoting Bruce)

:-)

comment:3 by bdubbs@…, 16 years ago

Actually, I used DESTDIR and was looking at that.

I'll get it fixed.

comment:4 by bdubbs@…, 16 years ago

Resolution: fixed
Status: newclosed

Reverted deletion of vim mandir patch.

Fixed at revision 8706.

comment:5 by bryan@linuxfromscratch.org, 16 years ago

I'm not quite sure we want to re-add the entire patch just because of this. If the issue is that ru.KOI8-R needs to be changed to ru in the vim Makefile to get our loop to work, then why not (keep the patch, but also) delete the other bits? There's no point in suppressing the bits that install UTF-8 manpages for French, Italian, Polish, and Russian. I am undecided about suppressing the ISO8859-x character sets of French/Italian/Polish, though they do no harm when they're in character-set-specific directories.

Or instead of re-adding the patch, would it also work to change "ru" in the loop to "ru.KOI8-R"?

Actually, that may be best anyway -- if we do want vim to install all its UTF-8 manpages (into the .UTF-8 directories that it uses without the patch), we'd have to add all those directories to the loop already. Why not replace "ru" with "ru.KOI8-R" at the same time as we add "ru.UTF-8"?

(Or do we want to ignore this for 6.4? I suppose that's possible, though we've already gone through some effort to get man-db working better.)

comment:6 by bdubbs@…, 16 years ago

Resolution: fixed
Status: closedreopened

OK, I'm going to reopen the ticket, but I'd like another editor to fix it or someone to send a patch. I really don't have a good feel for the internationalization issues. From the write-up in man-db, it mentions xx.UTF-8, but expects KOI8-R formatted files in ru. There is no mention of ru.KOI8-R. Vim installs man pages in ru.KOI8-R and ru.UTF-8, but not ru. Should the ru.KOI8-R files be placed in ru and symlinks made in both places?

comment:7 by DJ Lucas, 16 years ago

KOI8-R encoded pages can be placed in either/or. Both locations will work fine. Cleanliness is the only reason to move them as we previously only installed in ru/. There is no technical reason to change any of it.

by bryan@linuxfromscratch.org, 16 years ago

Attachment: fix-vim-mans.patch added

Proposed fix for vim manpage symlinks

comment:8 by bryan@linuxfromscratch.org, 16 years ago

DJ: Agreed -- current man-db doesn't (appear to) care. The "ru" directory defaults to KOI8-R, but putting the file in another directory with the explicit charset name won't hurt. (The reason vim does this is because it assumes that the unadorned directory name holds ISO8859-x, probably -1. The reason it bothers with the ISO8859-1 directories for French and Italian is for FreeBSD. See the comments in the Makefile near where these directories get set.)

But I've attached what I was thinking, so others can sanity-check it. This re-removes the mandirs patch, and updates the for loop to account for the new directories.

Though actually, this does miss one thing: it doesn't set MANDIR during the vim "make install". I doubt that's terribly important (since /usr/man is a link to it anyway), so hopefully it doesn't matter.

Other opinions? Sanity checks -- did I miss something critically obvious? Alexander? :-P

in reply to:  8 comment:9 by DJ Lucas, 16 years ago

Replying to Bryan Kadzban:

Though actually, this does miss one thing: it doesn't set MANDIR during the vim "make install". I doubt that's terribly important (since /usr/man is a link to it anyway), so hopefully it doesn't matter.

I haven't even looked at the patch yet. Assuming that it checks OK, it should be good for 6.4. However, MANDIR will be an issue for 7.0. This was brought up by Randy recently. While the symlink _works_, it is a workaround for properly configuring the packages in the book. I will go ahead and add it into tonight's build, and report back tomorrow evening or Tuesday.

comment:10 by alexander@…, 16 years ago

Bryan's approach seems to be correct: in every directory containing the "vim.1" file, and nowhere else, there should be the "vi.1" symlink.

comment:11 by bryan@linuxfromscratch.org, 16 years ago

OK, I figured that was the idea, but it helps to know for sure. Thanks!

Something like this should work as well then (it also makes it a bit more explicit what the critical part is: the existence of man1/vim.1 under the language directory):

for i in /usr/share/man/*/man1/vim.1 ; do
  ln -s vim.1 $(dirname $i)/vi.1
done

ln -s vim.1 /usr/share/man/man1/vi.1

That way we don't end up missing future vim.1 pages in different directories.

I did, however, think up another solution to this whole loop thing late last night (and forgot about it until now): depending on whether man-db re-searches the man directories when it sees a ".so" include, it may work to create a simple vi.1 wrapper:

echo '.so man1/vim.1' >/usr/share/man/man1/vi.1

But I have not tested this. I don't know if that .so will cause man-db to include ru.UTF-8/man1/vim.1 if that's your locale, for instance, or if it will use the unlocalized /usr/share/man/man1/vim.1 file instead. The latter would be bad (or at least, worse than the fixed loop).

comment:12 by bdubbs@…, 16 years ago

Resolution: fixed
Status: reopenedclosed

I made a slight modification to your loop:

for L in  /usr/share/man/{,*/}man1/vim.1; do
    ln -sv vim.1 $(dirname $L)/vi.1
done

Fixed at revision 8716.

comment:13 by bryan@linuxfromscratch.org, 16 years ago

Yes, I saw that loop; it's quite a bit shorter than mine. :-)

Something else I noticed, though: the mandirs patch is still present in chapter06/vim.xml and patches.ent (but missing from chapter03/patches.xml?). Did you intend to leave it? The only reason I can think of to keep it would be to change MANDIR -- but at minimum, we should remove the other parts of the patch in that case.

And actually, I've just configured and compiled a test version of vim-7.2 -- and according to auto/config.mk (and "make -n install"), the manpages are going into /usr/share/man already (i.e. the comments in src/Makefile about it using /usr/man are wrong). So I don't think *any* part of the patch is needed anymore, between man-db and the correct default MANDIR.

comment:14 by bdubbs@…, 16 years ago

Sigh.

Yes, I meant to remove the patch completely. Thanks.

Committed revision 8717.

Note: See TracTickets for help on using tickets.