This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 173875 - mkfontscale can't find encodings.dir
mkfontscale can't find encodings.dir
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: libfontenc (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Mike A. Harris
:
Depends On:
Blocks: FC5Blocker
  Show dependency treegraph
 
Reported: 2005-11-21 20:30 EST by sangu
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-02 12:01:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
$starce /usr/bin/mkfontscale -a fontpath (46.06 KB, text/plain)
2005-11-21 20:30 EST, sangu
no flags Details
mkfontscale's strace filei n libfontenc-0.99.2-2 (109.59 KB, text/plain)
2005-11-22 21:14 EST, sangu
no flags Details
Doing mkfontscale fonts korean, strace.txt (52.48 KB, text/plain)
2005-11-22 21:33 EST, sangu
no flags Details
$rpm -ql xorg-x11-fonts-base and $ls -alFR /usr/share/X11/fonts/encodings (18.11 KB, text/plain)
2005-12-22 05:57 EST, sangu
no flags Details
$ strace mkfontscale > strace.txt 2>&1 in korean fonts directory (39.75 KB, text/plain)
2005-12-22 06:04 EST, sangu
no flags Details
diff of spec file changes for peer review (7.15 KB, patch)
2006-02-24 10:01 EST, Mike A. Harris
no flags Details | Diff
$/usr/bin/strace mkfontscale -n -e `/usr/share/fonts/japanese/TrueType/ > ~/strace.txt 2>&1 (6.33 KB, text/plain)
2006-02-28 06:30 EST, sangu
no flags Details

  None (edit)
Description sangu 2005-11-21 20:30:28 EST
Description of problem:
$strace /usr/bin/mkfontscale -a fontpath
[...]
open("/usr/lib/X11/fonts/encodings/encodings.dir", O_RDONLY) = -1 ENOENT (No
such file or directory)
.
.
.
[...]

$ls /usr/share/X11/fonts/encodings/encodings.dir
$rpm -qf /usr/share/X11/fonts/encodings/encodings.dir
xorg-x11-fonts-base-0.99.0-6

Version-Release number of selected component (if applicable):
6.99.99.902-2

How reproducible:
always

Steps to Reproduce:
1. /usr/bin/mkfontscale -a fontpath
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 sangu 2005-11-21 20:30:28 EST
Created attachment 121328 [details]
$starce  /usr/bin/mkfontscale -a fontpath
Comment 2 Mike A. Harris 2005-11-22 17:29:09 EST
This turns out to be a bug in libfontenc, which mkfontscale links to.  It
is built with a hard coded path to the encodings files supplied by its
Makefile.am.
Comment 3 Mike A. Harris 2005-11-22 19:50:31 EST
Fixed by applying libfontenc-0.99.2-use-datadir-for-encodings.patch which patches
Makefile.am, and calling automake.  This package will require
xorg-x11-filesystem also to be installed first, or at the same time.
Comment 4 sangu 2005-11-22 21:14:14 EST
Created attachment 121380 [details]
mkfontscale's strace filei n libfontenc-0.99.2-2

still can't find encodings.dir
$ pwd
/usr/share/X11/fonts/75dpi
$ strace mkfontscale  > strace.txt  2>&1

# cat fonts.scale
0
$cat strace.txt
[...]
unlink("./encodings.dir")		= -1 ENOENT (No such file or directory)

exit_group(0)				= ?
Process 13550 detached

$ rpm -q libfontenc xorg-x11-font-utils
libfontenc-0.99.2-2
xorg-x11-font-utils-6.99.99.902-2
Comment 5 sangu 2005-11-22 21:33:20 EST
Created attachment 121383 [details]
Doing mkfontscale fonts korean, strace.txt

$strace mkfontscale /usr/share/fonts/korean/TrueType > strace.txt 2>&1
Comment 6 sangu 2005-11-22 21:45:41 EST
Sorry my misposting (comment 4, 5 ).

mkfontscale can't find enc files in /usr/share/X11/fonts/encoding/ and
/usr/share/X11/fonts/encoding/large/.

[...]
open("/usr/share/X11/fonts/encodings/./*.enc", O_RDONLY) = -1 ENOENT
(No such file or directory)
[...]
Comment 7 Mike A. Harris 2005-11-23 08:18:06 EST
Please provide output of:

rpm -q libfontenc libXfont xorg-x11-font-utils xorg-x11-fonts

and

rpm -ql xorg-x11-fonts-base
Comment 8 Mike A. Harris 2005-11-23 08:19:34 EST
Also, please run:

rpm -V libfontenc libXfont xorg-x11-font-utils xorg-x11-fonts-base

Comment 9 Mike A. Harris 2005-11-23 08:21:50 EST
And the output of "ls -alFR /usr/share/X11/fonts/encodings"
Comment 10 sangu 2005-11-23 08:39:01 EST
libfontenc-0.99.2-2
libXfont-0.99.2-3
xorg-x11-font-utils-6.99.99.902-2
xorg-x11-fonts-Type1-0.99.0-6
xorg-x11-fonts-truetype-0.99.0-6
xorg-x11-fonts-75dpi-0.99.0-6
xorg-x11-fonts-misc-0.99.0-6
xorg-x11-fonts-100dpi-0.99.0-6
xorg-x11-fonts-base-0.99.0-6

$rpm -V libfontenc libXfont xorg-x11-font-utils xorg-x11-fonts-base

no message.

$ls -alFR /usr/share/X11/fonts/encodings
/usr/share/X11/fonts/encodings:
total 184
drwxr-xr-x 3 root root 4096 Nov 22 02:43 ./
drwxr-xr-x 8 root root 4096 Nov 15 04:38 ../
-rw-r--r-- 1 root root 3253 Nov 15 04:35 adobe-dingbats.enc.gz
-rw-r--r-- 1 root root 1655 Nov 15 04:35 adobe-standard.enc.gz
-rw-r--r-- 1 root root 3165 Nov 15 04:35 adobe-symbol.enc.gz
-rw-r--r-- 1 root root  986 Nov 15 04:35 ansi-1251.enc.gz
-rw-r--r-- 1 root root 1026 Nov 15 04:35 armscii-8.enc.gz
-rw-r--r-- 1 root root  435 Nov 15 04:35 ascii-0.enc.gz
-rw-r--r-- 1 root root  582 Nov 15 04:35 dec-special.enc.gz
-rw-r--r-- 1 root root 4581 Nov 15 04:35 encodings.dir
-rw-r--r-- 1 root root 8192 Nov 17 01:02 fonts.cache-2
-rw-r--r-- 1 root root    2 Nov 17 02:46 fonts.dir
-rw-r--r-- 1 root root 1576 Nov 15 04:35 ibm-cp437.enc.gz
-rw-r--r-- 1 root root 1519 Nov 15 04:35 ibm-cp850.enc.gz
-rw-r--r-- 1 root root 1412 Nov 15 04:35 ibm-cp852.enc.gz
-rw-r--r-- 1 root root 1373 Nov 15 04:35 ibm-cp866.enc.gz
-rw-r--r-- 1 root root 1012 Nov 15 04:35 iso8859-11.enc.gz
-rw-r--r-- 1 root root  639 Nov 15 04:35 iso8859-13.enc.gz
-rw-r--r-- 1 root root  626 Nov 15 04:35 iso8859-16.enc.gz
-rw-r--r-- 1 root root  996 Nov 15 04:35 iso8859-6.16.enc.gz
-rw-r--r-- 1 root root  836 Nov 15 04:35 iso8859-6.8x.enc.gz
drwxr-xr-x 2 root root 4096 Nov 22 02:43 large/
-rw-r--r-- 1 root root  616 Nov 15 04:35 microsoft-cp1250.enc.gz
-rw-r--r-- 1 root root 1181 Nov 15 04:35 microsoft-cp1251.enc.gz
-rw-r--r-- 1 root root  529 Nov 15 04:35 microsoft-cp1252.enc.gz
-rw-r--r-- 1 root root 1219 Nov 15 04:35 microsoft-cp1253.enc.gz
-rw-r--r-- 1 root root  572 Nov 15 04:35 microsoft-cp1254.enc.gz
-rw-r--r-- 1 root root 1004 Nov 15 04:35 microsoft-cp1255.enc.gz
-rw-r--r-- 1 root root 1025 Nov 15 04:35 microsoft-cp1256.enc.gz
-rw-r--r-- 1 root root  883 Nov 15 04:35 microsoft-cp1257.enc.gz
-rw-r--r-- 1 root root  633 Nov 15 04:35 microsoft-cp1258.enc.gz
-rw-r--r-- 1 root root  435 Nov 15 04:35 microsoft-win3.1.enc.gz
-rw-r--r-- 1 root root  185 Nov 15 04:35 mulearabic-0.enc.gz
-rw-r--r-- 1 root root  455 Nov 15 04:35 mulearabic-1.enc.gz
-rw-r--r-- 1 root root  467 Nov 15 04:35 mulearabic-2.enc.gz
-rw-r--r-- 1 root root  676 Nov 15 04:35 mulelao-1.enc.gz
-rw-r--r-- 1 root root  811 Nov 15 04:35 suneu-greek.enc.gz
-rw-r--r-- 1 root root  760 Nov 15 04:35 tcvn-0.enc.gz
-rw-r--r-- 1 root root 1152 Nov 15 04:35 tis620-2.enc.gz
-rw-r--r-- 1 root root 1242 Nov 15 04:35 viscii1.1-1.enc.gz

/usr/share/X11/fonts/encodings/large:
total 672
drwxr-xr-x 2 root root  4096 Nov 22 02:43 ./
drwxr-xr-x 3 root root  4096 Nov 22 02:43 ../
-rw-r--r-- 1 root root 64391 Nov 15 04:35 big5.eten-0.enc.gz
-rw-r--r-- 1 root root 85290 Nov 15 04:35 big5hkscs-0.enc.gz
-rw-r--r-- 1 root root 29725 Nov 15 04:35 cns11643-1.enc.gz
-rw-r--r-- 1 root root 36755 Nov 15 04:35 cns11643-2.enc.gz
-rw-r--r-- 1 root root 26146 Nov 15 04:35 cns11643-3.enc.gz
-rw-r--r-- 1 root root  1769 Nov 15 04:35 encodings.dir
-rw-r--r-- 1 root root  8192 Nov 17 01:02 fonts.cache-2
-rw-r--r-- 1 root root   140 Nov 15 04:35 gb18030-0.enc.gz
-rw-r--r-- 1 root root 65458 Nov 15 04:35 gb18030.2000-0.enc.gz
-rw-r--r-- 1 root root  1677 Nov 15 04:35 gb18030.2000-1.enc.gz
-rw-r--r-- 1 root root 70467 Nov 15 04:35 gb2312.1980-0.enc.gz
-rw-r--r-- 1 root root 59166 Nov 15 04:35 gbk-0.enc.gz
-rw-r--r-- 1 root root   453 Nov 15 04:35 jisx0201.1976-0.enc.gz
-rw-r--r-- 1 root root 72764 Nov 15 04:35 jisx0208.1990-0.enc.gz
-rw-r--r-- 1 root root 23852 Nov 15 04:35 jisx0212.1990-0.enc.gz
-rw-r--r-- 1 root root 34763 Nov 15 04:35 ksc5601.1987-0.enc.gz
-rw-r--r-- 1 root root 32497 Nov 15 04:35 ksc5601.1992-3.enc.gz
-rw-r--r-- 1 root root   938 Nov 15 04:35 sun.unicode.india-0.enc.gz

Comment 11 Mike A. Harris 2005-12-21 06:25:03 EST
I believe this problem is resolved in rawhide for a while now.  Please
confirm.
Comment 12 sangu 2005-12-22 05:57:07 EST
Created attachment 122522 [details]
$rpm -ql xorg-x11-fonts-base and $ls -alFR /usr/share/X11/fonts/encodings

mharris : this problem still happens.

$ rpm -q libfontenc libXfont xorg-x11-font-utils 
libfontenc-1.0.0-1
libXfont-1.0.0-1
xorg-x11-font-utils-1.0.0-1

$rpm -qa | grep xorg-x11-fonts
xorg-x11-fonts-base-1.0.0-1
xorg-x11-fonts-misc-1.0.0-1
xorg-x11-fonts-truetype-1.0.0-1
xorg-x11-fonts-75dpi-1.0.0-1
xorg-x11-fonts-100dpi-1.0.0-1
xorg-x11-fonts-ISO8859-1-75dpi-1.0.0-1
xorg-x11-fonts-Type1-1.0.0-1

$ rpm -V libfontenc libXfont xorg-x11-font-utils
no message
Comment 13 sangu 2005-12-22 06:04:32 EST
Created attachment 122523 [details]
$ strace mkfontscale > strace.txt 2>&1 in korean fonts directory

in strace.txt
[...]
open("/encodings/encodings.dir", O_RDONLY) = -1 ENOENT (No such file or
directory)
[...]
Comment 14 Mike A. Harris 2006-02-21 06:37:29 EST
Does this problem still occur with FC5test3?
Comment 15 sangu 2006-02-23 04:05:06 EST
this problem still happens in FC5T3

$rpm -q libfontenc libXfont xorg-x11-font-utils
libfontenc-1.0.1-1.2
libXfont-1.0.0-2.2
xorg-x11-font-utils-1.0.1-2

$rpm -qa | grep xorg-x11-fonts
xorg-x11-fonts-100dpi-7.0-1
xorg-x11-fonts-ISO8859-9-75dpi-7.0-1
xorg-x11-fonts-ISO8859-14-75dpi-7.0-1
xorg-x11-fonts-75dpi-7.0-1
xorg-x11-fonts-ISO8859-9-100dpi-7.0-1
xorg-x11-fonts-ISO8859-1-75dpi-7.0-1
xorg-x11-fonts-ISO8859-1-100dpi-7.0-1
xorg-x11-fonts-ISO8859-14-100dpi-7.0-1
xorg-x11-fonts-ISO8859-15-75dpi-7.0-1
xorg-x11-fonts-base-7.0-1
xorg-x11-fonts-ISO8859-15-100dpi-7.0-1
xorg-x11-fonts-ISO8859-2-75dpi-7.0-1
xorg-x11-fonts-Type1-7.0-1
xorg-x11-fonts-ISO8859-2-100dpi-7.0-1

$rpm -V libfontenc libXfont xorg-x11-font-utils
no message
Comment 16 Mike A. Harris 2006-02-24 08:14:36 EST
Ok, I've reproduced this by copying the bitstream-vera fonts into
/tmp/fonts and running:

strace mkfontscale > strace.out 2>&1

Examining the log I see similar file not found complaints as you're
reporting.  What was odd, is that it looks for some files *.enc, and
other files as *.enc.gz

When you look in the system encodings directories however, *all* of the
files are "*.enc.gz".  The list of encodings files come from the
encodings.dir files present in each of the encodings directories.  If you
look at the contents of these encodings.dir files, you find entries that
seem to be randomly put there, some *.enc, some *.enc.gz, and various of
the files simply do not exist at all in the actual system.

I attempted to work around the problem by recreating the encodings.dir files
with mkfontscale in each encodings directory, by doing:

cp encodings.dir encodings.dir.ORIG
mkfontscale -e . -n

I repeated this in the 'large' dir as well.  This created new encodings.dir
files in each of the encodings directories, and when mkfontscale was ran on
the test font directory I created earlier, the second strace did not show
any errors.

So, in a pinch, I can work around this bug by manually invoking
"mkfontscale -e $encodingdir -n" in each encoding dir in the fonts rpm,
which will recreate the proper encodings.dir files in our rpm packaging
at least.

I'm curious though why this is happening in the first place, and am going
to dig into it further.  Either the encodings.dir files are getting
generated incorrectly in the encodings.*.tar.bz2 build in xorg-x11-fonts,
or they're getting generated and discarded, or there are pregenerated
bogus encodings.dir files stored in the CVS repo that just get copied into
the output dir when building the package.  That's my current theory anyway.

Will report back shortly with my results.

Comment 17 Mike A. Harris 2006-02-24 09:58:13 EST
Ok, I've changed the file manifest to mark the encodings.dir files in
the encodings directories as %ghost files, so that the rpm package
build time encodings.dir files are not used.  Then I updated the
base-fonts rpm %post script to create the encodings.dir files via
mkfontscale at package _install_ time.  This is more consistent with
how fonts.dir files are created, so I'm hoping it works out to be
a better solution.

I have tested the updated xorg-x11-fonts-base package locally by installing
and removing it, and it now installs encodings.dir files that properly match
the *.enc.gz files which are provided by the encodings tarball.

There are a few things I'm not 100% certain of however.  I'm not sure if
these files end up getting updated at runtime when mkfont* get invoked during
font rpm package installation/removal or not.

So, while this fix fixes the problem reported here, and does so in a manner
consistent with our other font file installation and whatnot, it could
possibly uncover additional bugs which were dormant.

There is a possibility that this could potentially regress OS installation
or upgrades, if mkfontscale and mkfontdir act differently now than they
have prior to this change.  However it is equally possible that this change
may also fix other bugs which were caused due to the encodings.dir files
being built incorrectly by the X.Org Makefiles.

Since there is some potential risk to including this fix in FC5 at this point,
I am building test packages outside of rawhide, and will make them available
on people.redhat.com for people to test.  I will then post to the fedora
lists to gather testers to bang on the package(s) and see what if anything
breaks.

Stay tuned...
Comment 18 Mike A. Harris 2006-02-24 10:01:03 EST
Created attachment 125179 [details]
diff of spec file changes for peer review
Comment 19 Mike A. Harris 2006-02-27 08:58:21 EST
I posted rpm packages for people to test to Fedora devel and test list, and
got several people to confirm things work for them with the new packages.

Since they work for me too, I'm moving the new xorg-x11-fonts-7.0-2 packages
to Fedora Devel today.
Comment 20 Mike A. Harris 2006-02-28 01:28:33 EST
Fixed in rawhide xorg-x11-fonts-7.0-2
Comment 21 sangu 2006-02-28 06:30:48 EST
Created attachment 125392 [details]
$/usr/bin/strace mkfontscale -n -e `/usr/share/fonts/japanese/TrueType/ > ~/strace.txt 2>&1

sorry about late response.
$/usr/bin/strace mkfontscale -n -e `/usr/share/fonts/japanese/TrueType/ >
~/strace.txt 2>&1

mkfontscale doesn't find encoding in large directory.
Comment 22 Mike A. Harris 2006-03-02 12:01:49 EST
This bug started out as a libfontenc bug, and each fix has uncovered a
separate bug/problem.  It is prefered to have new bug reports opened for
each new bug that pops up so it is easier to track each issue without
having to sort through old bug comments that are no longer relevent.

I have examined and verified that the encodings.dir files created during
package installation time, properly represent the encodings files in the
given directory, for both the large and non-large encodings.


Note You need to log in before you can comment on or make changes to this bug.