Bug 46771

Summary: [PATCH] fop fails if JAVACMD_OPTS is set
Product: Fop - Now in Jira Reporter: Michal Vyskocil <mvyskocil>
Component: generalAssignee: fop-dev
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 0.95   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: Allow to set a JAVACMD_OPTS on jpackage.org compatible systems

Description Michal Vyskocil 2009-02-26 04:48:22 UTC
Created attachment 23313 [details]
Allow to set a JAVACMD_OPTS on jpackage.org compatible systems

Moved from https://bugzilla.novell.com/show_bug.cgi?id=467866

The jpackage-utils contatenace the JAVACMD_OPTS with JAVACMD, so on rpm distributions with something in JAVACMD_OPTS in /etc/java/java.conf the following test in /usr/share/fop/fop fails:

if [ ! -x "$JAVACMD" ] ; then
  echo "Error: JAVA_HOME is not defined correctly."
  echo "  We cannot execute $JAVACMD"
  exit 1
fi

Attached patch splits JAVACMD variable in executable test and remove the \"\" from exec.
Comment 1 Vincent Hennebert 2009-02-27 03:43:58 UTC
Hi,

It looks like it is a jpackage.org-specific problem. Basically the java-functions script referred to in the upstream bug should probably not concatenate $JAVACMD_OPTS to JAVACMD. As its name indicates JAVACMD refers to the executable, not to possible command arguments.

The fop script is based on the script shipped with ant, so that problem that's occurring with fop will most probably occur with ant as well. The removal of quotes in fop_exec_command worries me: there's certainly a good reason why they were added in the first place, probably to handle paths with spaces in them. I'm not keen to modify the script without a good reason, as it's designed to work on all types of Unix platforms, even those with ancient tools and shells. If we change it then it needs to be re-tested on all those platforms, which we don't have access to.

I'm happy to hear comments or opinions about this, but I would close the bug as invalid.

Thanks,
Vincent
Comment 2 Glenn Adams 2012-04-07 01:43:06 UTC
resetting P2 open bugs to P3 pending further review
Comment 3 Glenn Adams 2012-04-11 03:20:15 UTC
increase priority for bugs with a patch