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

[debian-users:08321] Bug#JP/544: xdic installation doesn't correctly create gene.dic



Package: xdic
Version: 1.5p1-1

During installation of xdic, the user is given the opportunity to
create a gene.dic file (that is, not use any existing gene.dic files).
Choosing to create a new gene.dic file failed as follows:

Setting up xdic (1.5p1-1) ...
You have /usr/share/dict/gene.dic already. Do you use it? [Y/n]: n
Please enter the directory which has gene95.lzh or gene95.tar.gz.
Or, enter `none' if you want to abort the installation.
Where? : /tmp
Building /usr/share/dict/gene.dic from /tmp/gene95.lzh ... sed: -e expression #1, char 28: Unterminated `y' command
/var/lib/dpkg/info/xdic.postinst: line 69:  1228 Broken pipe             $COMMAND gene.txt
      1229                       | nkf -S -e
      1230 Done(1)                 | sed -e "
1,${IGNORELINES}d
s/      /        /
//
y/
/       /
n
//"
      1231 Done                    | sort -f >$DICT
done.

Copying the relevant portions of the xdic.postinst script and using
jsed (in the sed-ja package) instead of sed created the appropriate
gene.dic file.

Relevant portion of xdic.postinst:

echo -n "Building $DICT from $ARC ... "
$COMMAND gene.txt | \
nkf -S -e | \
sed -e "
1,${IGNORELINES}d
s/      /        /
s/^M//
y/
/       /
n
s/^M//" | \
sort -f > $DICT
chmod 644 $DICT
echo "done."

(N.B. this text was copied and pasted, so tabs (and other characters)
may not have survived.)

Suggested fix:

-Determine an appropriate sed script.
-Try to detect whether perl is installed, if it is, use perl.
 (perhaps, xdic can 'suggest' perl?)  Since it appears that
 many debian systems use perl, checking for it seems reasonable.
-If perl is not installed, use an appropriate sed script.

System details:

-Linux 2.0.35
-slink (w/ files from slink-jp)
-libc.so.5 (libc.so.5.4.38) and libc.so.6 (libc-2.0.7.so)

Additional notes:

-Installation was performed via dselect as well as dpkg -i, w/ the
same results.  (This note is only here because the instructions for
reporting a bug request it.)
-The same problem was experienced w/ version 1.4-1 in hamm.