libpaper should honor the LC_PAPER instead of /etc/papersize
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libpaper (Debian) |
Fix Released
|
Unknown
|
|||
libpaper (Ubuntu) |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
libpaper should be fixed to honor locale settings instead of always reading /etc/papersize.
I'd prefer removing support for /etc/papersize altogether, but honoring locale settings over a global file would be a nice start.
Actual results (I have "a4" in /etc/papersize):
$ LC_PAPER=
210 mm 297 mm
$ LC_PAPER=
210 mm 297 mm
Expected results:
$LC_PAPER=
215.9 mm 279.4 mm
$ LC_PAPER=
210 mm 297 mm
(paperconf should probably also use "-s" or "-i" automatically according to LC_MEASUREMENT)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 9.04
Release: 9.04
Codename: jaunty
$ apt-cache policy libpaper1
libpaper1:
Installed: 1.1.23+nmu1
Candidate: 1.1.23+nmu1
Version table:
*** 1.1.23+nmu1 0
500 http://
100 /var/lib/
$ ldd $(which paperconf)
linux-vdso.so.1 => (0x00007fffaeff
libpaper.so.1 => /usr/lib/
libc.so.6 => /lib/libc.so.6 (0x00007f13a670
/lib64/
Other information:
libpaper seems to honor PAPERSIZE environment variable. The PAPERSIZE environment variable seems inferior to querying actual paper size because every application that inspects the PAPERSIZE environment variable must include a list of paper names and sizes and such list cannot ever be complete.
Changed in libpaper (Debian): | |
status: | Unknown → New |
Changed in libpaper (Debian): | |
status: | New → Fix Released |
Some history lesson: www.opengroup. org/onlinepubs/ 9699919799/).
The LC_PAPER environment variable was not part of the original POSIX standard.
To tackle the default papersize problem the Debian operation system gave birth to libpaper (/etc/papersize), most programs in Debian/Ubuntu use libpaper to retrieve the paper size, CUPS is also compiled with libpaper support.
Later a DRAFT specification of a newer POSIX standard included the LC_PAPER environment variable, glibc was based on this DRAFT specification. But the FINAL version of this POSIX standard didn't include the LC_PAPER environment variable, this is also the current POSIX standard version (http://
So both methods can be used by application developers depending if they target POSIX compliance or only Linux compliance. In Debian/Ubuntu we could agree on any of these methods and adapt all programs to use this method. Furthermore this effort would be limited to Debian/Ubuntu only as long as there is no new POSIX standard that clearly describes how the default papersize should be retrieved.