DO NOT REPLY [Bug 42616] fop bash script still broken under cygwin when current dir has spaces
https://issues.apache.org/bugzilla/show_bug.cgi?id=42616 Glenn Adams gl...@skynav.com changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||WONTFIX --- Comment #16 from Glenn Adams gl...@skynav.com 2012-04-01 19:21:52 UTC --- if this problem still exists in current trunk (FOP1.0 or later), then submit a new bug -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug.
Re: DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
On Wed, 2007-10-31 at 15:05 +1000, Peter B. West wrote: Mark C. Allman wrote: On Tue, 2007-10-30 at 13:32 -0700, [EMAIL PROTECTED] wrote: Try OLD_IFS=$IFS IFS= find ${FOP}/lib -name -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done IFS=$OLD_IFS find ${FOP}/lib -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done would be almost perfect, and avoid the need for the change of IFS, except that the call to find places the whole while loop in a subshell, and updates of LOCALCLASSPATH are lost when it returns. Change to: for jarfile in `find ${FOP}/lib -name '*.jar'`; do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done -- Mark C, Allman, PMP -- Allman Professional Consulting, Inc. -- www.allmanpc.com, 617-947-4263 BusinessMsg -- the secure, managed, J2EE/AJAX Enterprise IM/IC solution I think this brings back the original problem. Peter We've fixed this before (more than once, I think), so I'll dig up what we did and re-post it. I thought this was a new problem. We used something in Cygwin to fix up path strings. You'd use it in the loop to fix each path for prepending. I didn't have time last night to find it (worked on a business plan). -- Mark C, Allman, PMP -- Allman Professional Consulting, Inc. -- www.allmanpc.com, 617-947-4263 BusinessMsg -- the secure, managed, J2EE/AJAX Enterprise IM/IC solution
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-10-31 13:07 --- (In reply to comment #13) So how about JARPATH=$(SEP=;find ${FOP}/lib -name '*.jar'|\ while read jarfile;do echo -n $SEP$jarfile; SEP=${pathSepChar}; done) if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$JARPATH else LOCALCLASSPATH=$JARPATH${pathSepChar}$LOCALCLASSPATH fi Excellent. But keep it simple and use =`...` instead of =$(...) (is this a bashism?). Then the following should replace the libs section in the fop script: # add in the dependency .jar files, which reside in $FOP_HOME/lib if [ -z $LOCALCLASSPATH ] ; then SEP= else SEP=${pathSepChar} fi LOCALCLASSPATH=${LOCALCLASSPATH}`find ${FOP_HOME}/lib -name '*.jar' \ | while read jarfile do echo -n $SEP$jarfile SEP=${pathSepChar} done` Note, however, that the complaint with which this bug was reopened, has never been validated; see comments #9 and #10. So one may argue that this solution is not sufficiently better to warrant being committed. I think it is, because it removes the fiddling with IFS and the parsing of a list of libs. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
Re: DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
On Wed, Oct 31, 2007 at 06:57:58AM -0400, Mark C. Allman wrote: We've fixed this before (more than once, I think), so I'll dig up what we did and re-post it. I thought this was a new problem. We used something in Cygwin to fix up path strings. You'd use it in the loop to fix each path for prepending. I didn't have time last night to find it (worked on a business plan). Indeed, this bug is reopened ad nauseam, with and without good reason. And the script was also the subject of an earlier bug report. You were involved in one of these. I hope my most recent proposal in the bug report also works properly under Cygwin and under vanilla Bourne shells. Broken support for these shells gave rise to the earlier bug reports. Simon -- Simon Pepping home page: http://www.leverkruid.eu
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-10-31 22:56 --- $(...) is posix-preferred, I believe. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-10-30 13:32 --- (In reply to comment #11) Try OLD_IFS=$IFS IFS= find ${FOP}/lib -name -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done IFS=$OLD_IFS find ${FOP}/lib -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done would be almost perfect, and avoid the need for the change of IFS, except that the call to find places the whole while loop in a subshell, and updates of LOCALCLASSPATH are lost when it returns. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
Re: DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
On Tue, 2007-10-30 at 13:32 -0700, [EMAIL PROTECTED] wrote: Try OLD_IFS=$IFS IFS= find ${FOP}/lib -name -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done IFS=$OLD_IFS find ${FOP}/lib -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done would be almost perfect, and avoid the need for the change of IFS, except that the call to find places the whole while loop in a subshell, and updates of LOCALCLASSPATH are lost when it returns. Change to: for jarfile in `find ${FOP}/lib -name '*.jar'`; do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done -- Mark C, Allman, PMP -- Allman Professional Consulting, Inc. -- www.allmanpc.com, 617-947-4263 BusinessMsg -- the secure, managed, J2EE/AJAX Enterprise IM/IC solution
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-10-30 22:05 --- I forgot that everything in the line would be assigned to the variable, and I forgot that the pipeline would be executed in a subshell. So how about JARPATH=$(SEP=;find ${FOP}/lib -name '*.jar'|\ while read jarfile;do echo -n $SEP$jarfile; SEP=${pathSepChar}; done) if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$JARPATH else LOCALCLASSPATH=$JARPATH${pathSepChar}$LOCALCLASSPATH fi -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
Re: DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
Mark C. Allman wrote: On Tue, 2007-10-30 at 13:32 -0700, [EMAIL PROTECTED] wrote: Try OLD_IFS=$IFS IFS= find ${FOP}/lib -name -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done IFS=$OLD_IFS find ${FOP}/lib -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done would be almost perfect, and avoid the need for the change of IFS, except that the call to find places the whole while loop in a subshell, and updates of LOCALCLASSPATH are lost when it returns. Change to: for jarfile in `find ${FOP}/lib -name '*.jar'`; do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done -- Mark C, Allman, PMP -- Allman Professional Consulting, Inc. -- www.allmanpc.com, 617-947-4263 BusinessMsg -- the secure, managed, J2EE/AJAX Enterprise IM/IC solution I think this brings back the original problem. Peter
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | --- Additional Comments From [EMAIL PROTECTED] 2007-10-29 07:48 --- The IFS assignment has to be removed altogether. In Bourne shell it means that fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf is interpreted as fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf which produces for basically all commandlines: java.lang.IllegalArgumentException: Error creating InputHandler object. at org.apache.fop.cli.CommandLineOptions.createInputHandler (CommandLineOptions.java:818) at org.apache.fop.cli.CommandLineOptions.parse (CommandLineOptions.java:165) at org.apache.fop.cli.Main.startFOP(Main.java:154) at org.apache.fop.cli.Main.main(Main.java:197) Workaround (provided bash is installed): invoke fop script explicitly as bash script instead of implicit #!/bin/sh $ bash fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-10-29 12:23 --- (In reply to comment #9) The IFS assignment has to be removed altogether. In Bourne shell it means that fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf is interpreted as fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf Can you explain? I do not see such a thing happen: $ /fop/fop --execdebug -xml foo.xml -xsl foo.xsl -pdf foo.pdf exec /usr/lib/jvm/java-1.5.0-sun/bin/java -classpath /fop/lib/xmlgraphics-commons-1.3svn.jar:/fop/lib/xml-apis-1.3.02.jar:/fop/lib/xercesImpl-2.7.1.jar:/fop/lib/xalan-2.7.0.jar:/fop/lib/servlet-2.2.jar:/fop/lib/serializer-2.7.0.jar:/fop/lib/fop-hyph.jar:/fop/lib/commons-logging-1.0.4.jar:/fop/lib/commons-io-1.3.1.jar:/fop/lib/batik-all-1.6.jar:/fop/lib/avalon-framework-4.2.0.jar:/fop/build/fop.jar:/fop/build/fop-sandbox.jar:/fop/build/fop-hyph.jar org.apache.fop.cli.Main -xml foo.xml -xsl foo.xsl -pdf foo.pdf -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-10-29 18:40 --- Try OLD_IFS=$IFS IFS= find ${FOP}/lib -name -name '*.jar'|while read jarfile do if [ -z $LOCALCLASSPATH ] ; then LOCALCLASSPATH=$jarfile else LOCALCLASSPATH=$jarfile${pathSepChar}$LOCALCLASSPATH fi done IFS=$OLD_IFS I don't know how the CLASSPATH reacts to spaces. If there's a problem, the assignments to LOCALCALSSPATH will have to have the spaces escaped. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 [EMAIL PROTECTED] changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED | Version|1.0dev |0.94 --- Additional Comments From [EMAIL PROTECTED] 2007-10-22 07:36 --- http://svn.apache.org/viewvc?view=revrevision=551972 breaks the 0.94 fop script on Solaris where /bin/sh is a plain-vanilla Bourne shell. The assigment should be written as: IFS= export IFS -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 [EMAIL PROTECTED] changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED --- Additional Comments From [EMAIL PROTECTED] 2007-10-22 12:11 --- Fixed in revision 587204. I removed the export statement because it is not needed. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 [EMAIL PROTECTED] changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Additional Comments From [EMAIL PROTECTED] 2007-06-29 10:41 --- Applied the fix in the form: export IFS= because I feared that $'\n' is specific for bash. Thanks for the suggestion and the testing. See revision 551972. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-06-28 08:28 --- export IFS=$'\n' Adding this just after the opening comments fixes the problem under Linux and Cygwin. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-06-12 00:19 --- To avoid splitting arguments on spaces, set IFS to newline at the beginning of the script like so: export IFS=$'\n' Please try this and report your findings. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.
DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://issues.apache.org/bugzilla/show_bug.cgi?id=42616. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=42616 --- Additional Comments From [EMAIL PROTECTED] 2007-06-11 11:16 --- The problem may be due to this part: DIRLIBS=${FOP_HOME}/lib/*.jar for i in ${DIRLIBS} I have no idea how to solve it, even on Linux. ${FOP_HOME}/lib/*.jar simply is not expanded when it contains one or more spaces, even when quoted or when the spaces are escaped. The for loop is even worse. Even if DIRLIBS would be properly set, it seems impossible to obtain a correct word splitting in the for loop when each separate path element contains spaces. Bug 40583 is not really related. It addresses another problem, one which is specific for Cygwin. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are the assignee for the bug, or are watching the assignee.