Bug#300990: xfonts-scalable: postinst barfs on zero width
Package: xfonts-scalable
Version: 4.3.0.dfsg.1-10
Severity: normal
/var/lib/dpkg/info/xfonts-scalable.postinst sets DEFCOLUMNS (the
default value of COLUMNS) using this code:
DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
DEFCOLUMNS=80
fi
If "stty size" outputs "0 0", the expr conditional leaves DEFCOLUMNS=0,
which leads to this error message:
fmt: invalid width: `0'
There are various workarounds, like exporting COLUMNS or using stty to
set the window size or using the resize command from the xutils
package or running apt-get in an xterm window instead of on a serial
console (the window size settings reported by stty are zero on a
serial console, at least they are zero on my serial consoles).
I do have COLUMNS=80 in my serial consoles, but only as a bash
variable (bash doesn't seem to export it by default).
Perhaps that expr command (or another one following it) should also
make sure DEFCOLUMNS as generated by stty is nonzero.
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages xfonts-scalable depends on:
ii xutils 4.3.0.dfsg.1-10 X Window System utility programs
-- no debconf information
Reply to: