You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2007/06/08 14:18:16 UTC

DO NOT REPLY [Bug 42616] New: - 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

           Summary: fop bash script still broken under cygwin when current
                    dir has spaces
           Product: Fop
           Version: 1.0dev
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: richardw@geoquip-rnd.demon.co.uk


e.g :

richard@birkenhead /cygdrive/c/Documents and Settings/richard/IdeaProjects/Apach
e FOP $ ./fop -awt examples/fo/basic/readme.fo

produces the following:

cygpath: error converting "FOP/lib/*.jar:Settings/richard/IdeaProjects/Apache:an
d:/cygdrive/c/Documents:/cygdrive/c/Documents and Settings/richard/IdeaProjects/
Apache FOP/build/fop.jar:/cygdrive/c/Documents and Settings/richard/IdeaProjects
/Apache FOP/build/fop-sandbox.jar:/cygdrive/c/Documents and Settings/richard/Ide
aProjects/Apache FOP/build/fop-hyph.jar:/cygdrive/f/geolog/trunk/geolog/src" - U
nknown error 4294967295
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/fop/cli/Ma
in

This affects the current trunk.

Related bugs are:
40583     Under Cygwin, fop bash script CLASSPATH problem 
  http://issues.apache.org/bugzilla/show_bug.cgi?id=40583
21070     ClassPath with spaces cause undefined class errors
  http://issues.apache.org/bugzilla/show_bug.cgi?id=21070

-- 
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

Posted by bu...@apache.org.
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 spepping@apache.org  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.

DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces

Posted by bu...@apache.org.
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


spepping@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From spepping@apache.org  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

Posted by bu...@apache.org.
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 spepping@apache.org  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.

DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces

Posted by bu...@apache.org.
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


anathaniel@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |
            Version|1.0dev                      |0.94




------- Additional Comments From anathaniel@apache.org  2007-10-22 07:36 -------
http://svn.apache.org/viewvc?view=rev&revision=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

Posted by bu...@apache.org.
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 richardw@geoquip-rnd.demon.co.uk  2007-06-28 08:26 -------
Spaces are not the whole of the problem:

The following works:

richard@birkenhead /cygdrive/f/dir with spaces/fop-head/xml-fop
$ ./fop -awt ./examples/fo/basic/simple.fo > foo 2>&1


The following doesn't:

richard@birkenhead /cygdrive/f/dir with spaces/fop-head/xml-fop
$ cd ../

richard@birkenhead /cygdrive/f/dir with spaces/fop-head
$ mv xml-fop xml\ fop

richard@birkenhead /cygdrive/f/dir with spaces/fop-head
$ cd xml\ fop/

richard@birkenhead /cygdrive/f/dir with spaces/fop-head/xml fop
$ !./f
./fop -awt ./examples/fo/basic/simple.fo > foo 2>&1

richard@birkenhead /cygdrive/f/dir with spaces/fop-head/xml fop
$ cat ./foo
cygpath: error converting "fop/lib/*.jar:spaces/fop-head/xml:with:/cygdrive/f/di
r:/cygdrive/f/dir with spaces/fop-head/xml fop/build/fop.jar:/cygdrive/f/dir wit
h spaces/fop-head/xml fop/build/fop-sandbox.jar:/cygdrive/f/dir with spaces/fop-
head/xml fop/build/fop-hyph.jar:/cygdrive/f/geolog/trunk/geolog/src" - Unknown e
rror 4294967295
java.lang.NoClassDefFoundError: org/apache/fop/cli/Main
Exception in thread "main"
richard@birkenhead /cygdrive/f/dir with spaces/fop-head/xml fop
$


-- 
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

Posted by bu...@apache.org.
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 richardw@geoquip-rnd.demon.co.uk  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

Posted by bu...@apache.org.
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


anathaniel@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Additional Comments From anathaniel@apache.org  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

Posted by bu...@apache.org.
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 spepping@apache.org  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

Posted by bu...@apache.org.
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


anathaniel@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anathaniel@apache.org




------- Additional Comments From anathaniel@apache.org  2007-10-29 07:41 -------
*** Bug 43704 has been marked as a duplicate of this bug. ***

-- 
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

Posted by bu...@apache.org.
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 lists@pbw.id.au  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

Posted by bu...@apache.org.
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


spepping@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From spepping@apache.org  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

Posted by bu...@apache.org.
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 lists@pbw.id.au  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

Posted by bu...@apache.org.
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 lists@pbw.id.au  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.

DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces

Posted by bu...@apache.org.
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 arno@dmxprint.nl  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.

Re: DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces

Posted by Simon Pepping <sp...@leverkruid.eu>.
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

Re: DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces

Posted by "Mark C. Allman" <mc...@allmanpc.com>.
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, bugzilla@apache.org 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





Re: DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces

Posted by "Peter B. West" <pb...@pbw.id.au>.
Mark C. Allman wrote:
> On Tue, 2007-10-30 at 13:32 -0700, bugzilla@apache.org 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

Re: DO NOT REPLY [Bug 42616] - fop bash script still broken under cygwin when current dir has spaces

Posted by "Mark C. Allman" <mc...@allmanpc.com>.
On Tue, 2007-10-30 at 13:32 -0700, bugzilla@apache.org 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

Posted by bu...@apache.org.
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 spepping@apache.org  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.