Opened 18 years ago

Closed 18 years ago

#1750 closed defect (fixed)

Shadow >= 4.0.14 installs UTF-8 manual pages

Reported by: alexander@… Owned by: ken@…
Priority: high Milestone: 6.2
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

Translated manual pages that come with shadow >= 4.0.14 are in UTF-8 encoding (for RedHat only). They don't show correctly (i.e.: are completely unreadable) with Man-DB. Conversion is needed, as described on Man-DB page.

Change History (7)

comment:1 by alexander@…, 18 years ago

Proposed solution: either remove all translated manual pages, or do the following:

1) Disable installation of manual pages in languages not supported by Man-DB, as we already do:

sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile

2) Create a script for converting manual pages:

cat >convert-mans <<"EOF"
#!/bin/sh -e
FROM="$1"
TO="$2"
shift ; shift
while [ $# -gt 0 ]
do
        FILE="$1"
        shift
        iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv
        mv .tmp.iconv "$FILE"
done
EOF
chmod 755 convert-mans

3) Convert manual pages:

./convert-mans UTF-8 ISO-8859-2 man/cs/*.?
./convert-mans UTF-8 ISO-8859-1 man/de/*.?
./convert-mans UTF-8 ISO-8859-1 man/es/*.?
./convert-mans UTF-8 ISO-8859-1 man/fi/*.?
./convert-mans UTF-8 ISO-8859-1 man/fr/*.?
./convert-mans UTF-8 ISO-8859-2 man/hu/*.?
./convert-mans UTF-8 ISO-8859-1 man/id/*.?
./convert-mans UTF-8 ISO-8859-1 man/it/*.?
./convert-mans UTF-8 EUC-JP man/ja/*.?
# ./convert-mans UTF-8 EUC-KR man/ko/*.?
./convert-mans UTF-8 ISO-8859-2 man/pl/*.?
./convert-mans UTF-8 ISO-8859-1 man/pt_BR/*.?
./convert-mans UTF-8 KOI8-R man/ru/*.?
./convert-mans UTF-8 ISO-8859-9 man/tr/*.?
# ./convert-mans UTF-8 GB2312 man/zh_CN/*.?
# ./convert-mans UTF-8 BIG5 man/zh_TW/*.?

Then make && make install as usual.

comment:2 by archaic@…, 18 years ago

I like the idea of installing the script at the same time as installing the man-pages package so that it can be available as a part of the base system even if we didn't need it for shadow. Then we could do a for loop instead of calling the script manually several times.

Perhaps upstream might be willing to maintain the debian form of the man pages?

comment:3 by alexander@…, 18 years ago

A "for" loop doesn't work here: the second argument of the script changes with the country.

As for the upstream of Shadow working with Debian vs RedHat convention for manual page encoding: Shadow <= 4.0.13 did use the Debian convention. Research of their mailing list archive is required to find out why they changed their minds. I guess this has to do with the fact that Debian-style manual pages are not easy to edit on UTF-8 systems, and many people think that UTF-8 is the only future.

comment:4 by archaic@…, 18 years ago

I was actaully thinking something like this:

for i in de es fi fr id it pt_BR; do
  convert-mans UTF-8 ISO-8859-1 man/${i}/*.?
done

for i in cs hu pl; do
  convert-mans UTF-8 ISO-8859-2 man/${i}/*.?
done

convert-mans UTF-8 EUC-JP man/ja/*.?
convert-mans UTF-8 KOI8-R man/ru/*.?
convert-mans UTF-8 ISO-8859-9 man/tr/*.?

It doesn't really change anything, and only saves 2 lines of typing, but it shows a different method of doing repetitive tasks.

comment:5 by ken@…, 18 years ago

Owner: changed from lfs-book@… to ken@…
Status: newassigned

I'm planning on doing the Shadow upgrade, so I'd better pick this up too. Much as I dislike hard-coded temporary files (it can set a bad example, although I don't see any security implications here), I'm inclined to go with Alexander's script because we ought to create this work-around for Man-DB when we install it, and the alphabetic branch hasn't installed mktemp at that point.

Personally, I prefer archaic's way of running the conversion.

Will look at this tomorrow, I need to recheck the sizes of everything.

comment:6 by ken@…, 18 years ago

udev_update branch done, r7469

comment:7 by ken@…, 18 years ago

Resolution: fixed
Status: assignedclosed

trunk r7472, alphabetical r7474.

Note: See TracTickets for help on using tickets.