[Pkg-cups-devel] Bug#631282: [cups] Cups filter cpdftocps fails, causing failure to print pdf

Utku Erdoğdu utku at ceng.metu.edu.tr
Wed Jul 13 16:17:58 UTC 2011


I've spend some time on this bug and it turned out that this is a locale 
problem.

cpdftocps extracts resolution info from ppd file that belongs to the 
printer. It uses sed in text extraction. In tr_TR.UTF8 locale I'm using 
the extracted text is not what it's supposed to be:

utku at uther:~$  sed -nre 
's/^\*DefaultResolution:\s*([0-9.]+(x[0-9.]+)?).*/resolution="${resolution:-\1}"/pi' 
/etc/cups/ppd/printer.ppd
resolution="${resolution:-1200x600}"on: 1200x600dpi
utku at uther:~$ LC_ALL=en_US sed -nre 
's/^\*DefaultResolution:\s*([0-9.]+(x[0-9.]+)?).*/resolution="${resolution:-\1}"/pi' 
/etc/cups/ppd/printer.ppd
resolution="${resolution:-1200x600}"

Naturally this breaks the rest of the script.

There are two points here.

1. If sed's behaviour on text extraction is locale dependent, then 
cpdftocps should switch to C locale (or something). Since this is a 
configuration file I do not think a localized way of text extraction is 
necessary.

2. I do not have any idea whether it is OK for sed to extract different 
text in different locales.

Point #2 is related to sed. I'll look into it and possibly fill an 
upstream bug report.

I think Point #1 is not related to upstream, since cpdftocps is not 
distributed in the cups tarball, but included in distributions.

-- 
Utku





More information about the Pkg-cups-devel mailing list