pcb

command line batch export is wrong for some locales

Bug #905968 reported by Vladimir Zhbanov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Low
Unassigned

Bug Description

If I build pcb from the fresh cloned git sources and my locale
is not C I have the following errors:

Making all in doc
...
/usr/bin/ps2pdf `gawk 'BEGIN{s=8}; /BoundingBox/ {printf("-r%d -g%dx%d", s*72, s*$4, s*$5);}' pad.eps` pad.eps pad.pdf
Error: /typecheck in --lt--
Operand stack:
   --nostringval-- (%%BoundingBox: 0 0 219,446699 127,142563) --dict:1/2(ro)(G)-- --nostringval-- --nostringval-- (%%BoundingBox: 0 0 219,446699 127,142563) 1 0 0 219,446699 0.0 0.0 219.0 127.0 127,142563
Execution stack:
   %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1910 1 3 %oparray_pop 1909 1 3 %oparray_pop --nostringval-- 1893 1 3 %oparray_pop 1787 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- %ztokenexec_continue (scanner state) --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- --nostringval-- %loop_continue --nostringval--
Dictionary stack:
   --dict:1162/1684(ro)(G)-- --dict:0/20(G)-- --dict:81/200(L)--
Current allocation mode is local
Current file position is 65
GPL Ghostscript 9.04: Unrecoverable error, exit code 1
make[2]: *** [pad.pdf] Error 1
rm pad.eps
make[2]: Leaving directory `/home/vovka/sources/pcbtest/pcb/doc'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/vovka/sources/pcbtest/pcb'
make: *** [all] Error 2

I've bisected and found that the problem is in
commit fa0768e9a8a1367fedcac74858fe3d08a89f8a71.

To find it I did:
  git init
  git clone git://git.gpleda.org/pcb.git
  cd pcb
  git bisect start
  git bisect bad
  git bisect good 262ec1ab712879aa27a4e1b318b8128a8bf45fd4 #pcb-20100929 release
  git bisect run sh -c "rm * -r .cvsignore .gitignore && git reset --hard && ./autogen.sh && ./configure && make"

My locale's output:
 $ locale | grep LANG
 LANG=ru_RU.UTF-8

If I build using previous commit
  git-checkout -f fa0768e9a8a1367fedcac74858fe3d08a89f8a71~1
  ./autogen.sh && ./configure && make
(which will make all necessary *.eps-files), then checkout master HEAD
and build again:
  git-checkout -f master
  make
all works well.

Further investigation has shown that even if I afterwards build needed
eps-files using for example
 LANG=C make pad.eps puller.eps gcode.eps thermal.eps
then make the program and install it, the problem still exists.
If I export abovementioned formats from gui all is OK. When I use for
example
  pcb -x eps mypcb.pcb
from command line, they're outputted with comma as separator in numbers.

The issue is probably the same as in the bug #883768.

How to solve this issue (possible workarounds):

1) revert the abovementioned commit
  git revert fa0768e9a8a1367fedcac74858fe3d08a89f8a71
2) use the same approach for any exporter as used in commit
4101b611a84fbcd00cf984c8303502935cce38e9. One question still exits in
that case: why export from GUI works well and does not depend on
locale settings?
3) use an attached patch as a workaround.

Revision history for this message
Vladimir Zhbanov (vzhbanov) wrote :
Revision history for this message
Vladimir Zhbanov (vzhbanov) wrote :

Forgot to mention formats which output is wrong: eps, ps, gcode, nelma.

Revision history for this message
Felix Ruoff (felixruoff) wrote :

This patch works fine for me (and fixes this problem for me). Please, can someone else review this patch and commit it?

Changed in pcb:
status: New → Confirmed
importance: Undecided → Low
Felix Ruoff (felixruoff)
Changed in pcb:
status: Confirmed → Fix Committed
Changed in pcb:
status: Fix Committed → Fix Released
Changed in pcb:
milestone: none → pcb-20140316
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.