Bug 171848

Summary: gv attempts to open /usr/share/gv/ as a file
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: gvAssignee: Orion Poplawski <orion>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: extras-qa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 3.6.1-4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-27 20:24:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Jaegermann 2005-10-26 23:34:09 UTC
Description of problem:

Looking at a strace of a gv startup one can see there:

open("/usr/share/gv", O_RDONLY)         = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
read(4, 0x554b40, 4096)                 = -1 EISDIR (Is a directory)
close(4)                                = 0

The context would indicate that really /usr/share/gv/GV is wanted here.
Otherwise we rely on compiled in defaults for various settings.

It would be even nicer if GV.fallbackPageMedia would change to 'A4' or
'Letter' depending on what 'locale -c LC_PAPER' has to say but maybe this
is asking too much. :-)  Not of a vital importance anyway.

Version-Release number of selected component (if applicable):
gv-3.6.1-3.fc5

Comment 1 Orion Poplawski 2005-10-27 20:24:18 UTC
Added patch to open /usr/share/gv/GV.

I'm not opposed to mucking with GV.fallbackPageMedia if you sent a script that
would parse 'local -c LC_PAPER' appropriately.

Comment 2 Michal Jaegermann 2005-10-27 21:12:13 UTC
> I'm not opposed to mucking with GV.fallbackPageMedia if you sent a script ...

  sz=($(locale -c LC_PAPER)); [ "${sz[1]}" = 279 ] && echo Letter || echo A4

or, if you want to avoid arrays,

  sz=$(a="$(locale -c LC_PAPER)"; echo $a | (read b a b ; echo $a))
  [ "$sz" = 279 ] && echo Letter || echo A4

I am not sure if this is worth the bother.  Most documents will have
a bounding box anyway and this will be used.