Bug 194013 - xfig ignores its command line arguments
Summary: xfig ignores its command line arguments
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: xfig
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ngo Than
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-06-04 17:47 UTC by Jean-Luc Richier
Modified: 2007-11-30 22:11 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2006-06-07 16:11:42 UTC


Attachments (Terms of Use)

Description Jean-Luc Richier 2006-06-04 17:47:22 UTC
Description of problem:
xfig ignores the arguments on the command line


Version-Release number of selected component (if applicable):
xfig-3.2.4-17.2.i386

How reproducible:
try any argument, e.g. xfig -help, xfig does not list help

Steps to Reproduce:
1. % xfig -help 
2.
3.
  
Actual results:
starts xfig window

Expected results:
show print the help

Additional info:
The Reason is that in FC5 (at least xfig-3.2.4-17.2), /usr/bin/xfig is a shell
wrapper which sets env and then calls "exec /usr/bin/xfig.bin" without copying
the command line arguments.

To correct, apply the following patch:

--- /usr/bin/xfig.DIST  2006-02-12 19:59:07.000000000 +0100
+++ /usr/bin/xfig       2006-06-04 19:48:26.000000000 +0200
@@ -1,4 +1,4 @@
 #! /bin/sh
 export XAPPLRESDIR=/usr/share/X11/app-defaults
 export LANG=${LANG%.UTF-8}
-exec /usr/bin/xfig.bin
+exec /usr/bin/xfig.bin "$@"

Comment 1 Jean-Luc Richier 2006-06-04 18:13:32 UTC
Sorry, my path is not sufficient, as the binary xfig seems to ignore the
arguments if its name is not xfig (in fc5, the it is xfig.bin)
This is shown by trying xfig -metric: the display is still in inches.

So a full correction is the following
1/ Put the ELF binary in some directory with name xfig, for example
/usr/libexec/xfig
2/ Apply this patch
--- /usr/bin/xfig.DIST  2006-02-12 19:59:07.000000000 +0100
+++ /usr/bin/xfig       2006-06-04 20:11:08.000000000 +0200
@@ -1,4 +1,4 @@
 #! /bin/sh
 export XAPPLRESDIR=/usr/share/X11/app-defaults
 export LANG=${LANG%.UTF-8}
-exec /usr/bin/xfig.bin
+exec /usr/libexec/xfig "$@"

PS : the bug in xfig is explicitely said to be fixed in the source of xfig!
cf. the CHANGE file in source rpm:
o If xfig was renamed to anything else, the command-line arguments and X
resources weren't parsed by the Intrinsics.  This is fixed.


Comment 2 Jean-Luc Richier 2006-06-05 11:46:06 UTC
A other solution for the bug is to force the application name in the wrapper,
that is:
1/ leave the ELF binary as /usr/bin/xfig.bin
2/ Apply this patch
--- /usr/bin/xfig.DIST  2006-02-12 19:59:07.000000000 +0100
+++ /usr/bin/xfig       2006-06-05 13:48:20.000000000 +0200
@@ -1,4 +1,5 @@
 #! /bin/sh
 export XAPPLRESDIR=/usr/share/X11/app-defaults
 export LANG=${LANG%.UTF-8}
-exec /usr/bin/xfig.bin
+export RESOURCE_NAME=xfig
+exec /usr/bin/xfig.bin "$@"


Comment 3 Jean-Luc Richier 2006-06-05 14:08:28 UTC
I was still trying to correct the binray itself, but it seems complicated, so I
submit a bug report to xfig
I found an other simpler solution as the wrapper is using bash: use the -a
option of exec to force the command name ==>
1/ leave the ELF binary as /usr/bin/xfig.bin
2/ Apply this patch
--- /usr/bin/xfig.DIST  2006-02-12 19:59:07.000000000 +0100
+++ /usr/bin/xfig       2006-06-05 16:14:40.000000000 +0200
@@ -1,4 +1,4 @@
 #! /bin/sh
 export XAPPLRESDIR=/usr/share/X11/app-defaults
 export LANG=${LANG%.UTF-8}
-exec /usr/bin/xfig.bin
+exec -a xfig /usr/bin/xfig.bin "$@"


Comment 4 Ngo Than 2006-06-07 16:11:42 UTC
xfig from rawhide does not use the wrapper anymore. I will build
new xfig for FC5 update soon. Thanks for your report.


Note You need to log in before you can comment on or make changes to this bug.