public inbox for docbook-tools-discuss@sourceware.org
 help / color / mirror / Atom feed
* Patch for handling spaces in directory name
@ 2006-06-15 18:38 Trevor Harmon
  2006-06-16  5:21 ` Éric Bischoff
  0 siblings, 1 reply; 6+ messages in thread
From: Trevor Harmon @ 2006-06-15 18:38 UTC (permalink / raw)
  To: docbook-tools-discuss


[-- Attachment #1.1: Type: text/plain, Size: 503 bytes --]

There's a bug in docbook-tools 0.6.14: If the directory containing  
the DocBook file to be processed has a space in it, the scripts will  
fail.

I've attached a patch that fixes this bug. Basically, all I did was  
put quotes around shell variables. However, I did have to make a more  
substantial change: The SGML_FILE variable had to be factored out of  
SGML_ARGUMENTS so that it could be quoted.

Could someone with commit rights please take a look at this patch and  
apply it? Thanks,

Trevor


[-- Attachment #1.2: docbook-directory-with-spaces.patch --]
[-- Type: application/octet-stream, Size: 8697 bytes --]

Index: docbook-utils/backends/dvi
===================================================================
RCS file: /cvs/docbook-tools/docbook-tools/docbook-utils/backends/dvi,v
retrieving revision 1.3
diff -u -r1.3 dvi
--- docbook-utils/backends/dvi	13 Jan 2003 17:14:10 -0000	1.3
+++ docbook-utils/backends/dvi	15 Jun 2006 18:36:11 -0000
@@ -6,31 +6,31 @@
 export TEXINPUTS
 
 # Convert to TeX
-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
+$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE"
 if [ $? -ne 0 ]
 then exit 1
 fi
 
 # Convert from TeX to DVI
-jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp
+jadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp"
 if [ $? -ne 0 ]
 then
-  cat ${SGML_FILE_NAME}.tmp
-  rm ${SGML_FILE_NAME}.tmp
-  rm ${SGML_FILE_NAME}.tex
+  cat "${SGML_FILE_NAME}.tmp"
+  rm "${SGML_FILE_NAME}.tmp"
+  rm "${SGML_FILE_NAME}.tex"
   exit 2
 fi
-rm ${SGML_FILE_NAME}.tmp
+rm "${SGML_FILE_NAME}.tmp"
 
 # If there are unresolved references, re-run jadetex, twice 
-if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1
+if egrep '^LaTeX Warning: There were undefined references.$' "${SGML_FILE_NAME}.log" >/dev/null 2>&1
 then
-    jadetex ${SGML_FILE_NAME}.tex >/dev/null
-    jadetex ${SGML_FILE_NAME}.tex >/dev/null
+    jadetex "${SGML_FILE_NAME}.tex" >/dev/null
+    jadetex "${SGML_FILE_NAME}.tex" >/dev/null
 fi
-rm ${SGML_FILE_NAME}.log
-rm ${SGML_FILE_NAME}.aux
-rm ${SGML_FILE_NAME}.tex
-rm ${SGML_FILE_NAME}.out
+rm "${SGML_FILE_NAME}.log"
+rm "${SGML_FILE_NAME}.aux"
+rm "${SGML_FILE_NAME}.tex"
+rm "${SGML_FILE_NAME}.out"
 
 exit 0
Index: docbook-utils/backends/html
===================================================================
RCS file: /cvs/docbook-tools/docbook-tools/docbook-utils/backends/html,v
retrieving revision 1.1
diff -u -r1.1 html
--- docbook-utils/backends/html	21 Jul 2000 18:15:22 -0000	1.1
+++ docbook-utils/backends/html	15 Jun 2006 18:36:11 -0000
@@ -3,7 +3,7 @@
 # This program is under GPL license. See LICENSE file for details.
 
 # Convert to HTML
-$SGML_JADE -t sgml $SGML_ARGUMENTS
+$SGML_JADE -t sgml $SGML_ARGUMENTS "$SGML_FILE"
 if [ $? -ne 0 ]
 then exit 1
 fi
Index: docbook-utils/backends/pdf
===================================================================
RCS file: /cvs/docbook-tools/docbook-tools/docbook-utils/backends/pdf,v
retrieving revision 1.5
diff -u -r1.5 pdf
--- docbook-utils/backends/pdf	17 Mar 2003 17:47:11 -0000	1.5
+++ docbook-utils/backends/pdf	15 Jun 2006 18:36:11 -0000
@@ -6,26 +6,26 @@
 export TEXINPUTS
 
 # Convert to TeX
-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
+$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE"
 if [ $? -ne 0 ]
 then exit 1
 fi
 
 # Convert from TeX to PDF
-pdfjadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp
+pdfjadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp"
 if [ $? -ne 0 ]
 then
-  cat ${SGML_FILE_NAME}.tmp
-  rm ${SGML_FILE_NAME}.tmp
-  rm ${SGML_FILE_NAME}.tex
+  cat "${SGML_FILE_NAME}.tmp"
+  rm "${SGML_FILE_NAME}.tmp"
+  rm "${SGML_FILE_NAME}.tex"
   exit 2
 fi
-rm ${SGML_FILE_NAME}.tmp
+rm "${SGML_FILE_NAME}.tmp"
 
 # Unconditionally re-run pdfjadetex, twice 
-pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null
-pdfjadetex ${SGML_FILE_NAME}.tex >/dev/null
-rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \
-      ${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out
+pdfjadetex "${SGML_FILE_NAME}.tex" >/dev/null
+pdfjadetex "${SGML_FILE_NAME}.tex" >/dev/null
+rm -f "${SGML_FILE_NAME}.log" "${SGML_FILE_NAME}.aux" \
+      "${SGML_FILE_NAME}.tex" "${SGML_FILE_NAME}.out"
 
 exit 0
Index: docbook-utils/backends/ps
===================================================================
RCS file: /cvs/docbook-tools/docbook-tools/docbook-utils/backends/ps,v
retrieving revision 1.5
diff -u -r1.5 ps
--- docbook-utils/backends/ps	17 Mar 2003 17:51:48 -0000	1.5
+++ docbook-utils/backends/ps	15 Jun 2006 18:36:11 -0000
@@ -6,30 +6,30 @@
 export TEXINPUTS
 
 # Convert to TeX
-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
+$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE"
 if [ $? -ne 0 ]
 then exit 1
 fi
 
 # Convert from TeX to DVI
-jadetex ${SGML_FILE_NAME}.tex >${SGML_FILE_NAME}.tmp
+jadetex "${SGML_FILE_NAME}.tex" > "${SGML_FILE_NAME}.tmp"
 if [ $? -ne 0 ]
 then
-  cat ${SGML_FILE_NAME}.tmp
-  rm ${SGML_FILE_NAME}.tmp
-  rm ${SGML_FILE_NAME}.tex
+  cat "${SGML_FILE_NAME}.tmp"
+  rm "${SGML_FILE_NAME}.tmp"
+  rm "${SGML_FILE_NAME}.tex"
   exit 2
 fi
-rm ${SGML_FILE_NAME}.tmp
+rm "${SGML_FILE_NAME}.tmp"
 
 # If there are unresolved references, re-run jadetex, twice 
 if egrep '^LaTeX Warning: There were undefined references.$' ${SGML_FILE_NAME}.log >/dev/null 2>&1
 then
-    jadetex ${SGML_FILE_NAME}.tex >/dev/null
-    jadetex ${SGML_FILE_NAME}.tex >/dev/null
+    jadetex "${SGML_FILE_NAME}.tex" >/dev/null
+    jadetex "${SGML_FILE_NAME}.tex" >/dev/null
 fi
-rm -f ${SGML_FILE_NAME}.log ${SGML_FILE_NAME}.aux \
-	${SGML_FILE_NAME}.tex ${SGML_FILE_NAME}.out
+rm -f "${SGML_FILE_NAME}.log" "${SGML_FILE_NAME}.aux" \
+	"${SGML_FILE_NAME}.tex" "${SGML_FILE_NAME}.out"
 
 # Convert from DVI to PostScript
 PAPERSIZE="-t letter"
@@ -38,12 +38,12 @@
   PAPERSIZE="-t a4"
 fi
 
-dvips -R -q $PAPERSIZE ${SGML_FILE_NAME}.dvi -o ${SGML_FILE_NAME}.ps
+dvips -R -q $PAPERSIZE "${SGML_FILE_NAME}.dvi" -o "${SGML_FILE_NAME}.ps"
 if [ $? -ne 0 ]
 then
-  rm ${SGML_FILE_NAME}.dvi
+  rm "${SGML_FILE_NAME}.dvi"
   exit 3
 fi
-rm ${SGML_FILE_NAME}.dvi
+rm "${SGML_FILE_NAME}.dvi"
 
 exit 0
Index: docbook-utils/backends/rtf
===================================================================
RCS file: /cvs/docbook-tools/docbook-tools/docbook-utils/backends/rtf,v
retrieving revision 1.1
diff -u -r1.1 rtf
--- docbook-utils/backends/rtf	21 Jul 2000 18:15:22 -0000	1.1
+++ docbook-utils/backends/rtf	15 Jun 2006 18:36:11 -0000
@@ -3,7 +3,7 @@
 # This program is under GPL license. See LICENSE file for details.
 
 # Convert to RTF
-$SGML_JADE -t rtf -o ${SGML_FILE_NAME}.rtf $SGML_ARGUMENTS
+$SGML_JADE -t rtf -o "${SGML_FILE_NAME}.rtf" $SGML_ARGUMENTS "$SGML_FILE"
 if [ $? -ne 0 ]
 then exit 1
 fi
Index: docbook-utils/backends/tex
===================================================================
RCS file: /cvs/docbook-tools/docbook-tools/docbook-utils/backends/tex,v
retrieving revision 1.1
diff -u -r1.1 tex
--- docbook-utils/backends/tex	21 Jul 2000 18:15:22 -0000	1.1
+++ docbook-utils/backends/tex	15 Jun 2006 18:36:11 -0000
@@ -3,7 +3,7 @@
 # This program is under GPL license. See LICENSE file for details.
 
 # Convert to TeX
-$SGML_JADE -t tex -o ${SGML_FILE_NAME}.tex $SGML_ARGUMENTS
+$SGML_JADE -t tex -o "${SGML_FILE_NAME}.tex" $SGML_ARGUMENTS "$SGML_FILE"
 if [ $? -ne 0 ]
 then exit 1
 fi
Index: docbook-utils/backends/txt
===================================================================
RCS file: /cvs/docbook-tools/docbook-tools/docbook-utils/backends/txt,v
retrieving revision 1.5
diff -u -r1.5 txt
--- docbook-utils/backends/txt	11 Feb 2004 13:58:03 -0000	1.5
+++ docbook-utils/backends/txt	15 Jun 2006 18:36:11 -0000
@@ -23,7 +23,7 @@
 trap 'rm -f "$HTML"; exit' 0 1 2 3 7 13 15
 
 # Convert to HTML
-$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} >${HTML}
+$SGML_JADE -V nochunks -t sgml ${SGML_ARGUMENTS} "$SGML_FILE" >${HTML}
 if [ $? -ne 0 ]
 then exit 1
 fi
Index: docbook-utils/bin/jw.in
===================================================================
RCS file: /cvs/docbook-tools/docbook-tools/docbook-utils/bin/jw.in,v
retrieving revision 1.23
diff -u -r1.23 jw.in
--- docbook-utils/bin/jw.in	19 Aug 2004 08:30:13 -0000	1.23
+++ docbook-utils/bin/jw.in	15 Jun 2006 18:36:11 -0000
@@ -270,14 +270,14 @@
   echo -e $SGML_HELP_MESSAGE >&2
   exit 1
 fi
-if [ ! -s $SGML_FILE ]
+if [ ! -s "$SGML_FILE" ]
 then
   echo "`basename $0`: Cannot open \"$SGML_FILE\"." >&2
   exit 3
 fi
 
 # Separate the file name and the extension (if any)
-SGML_FILE_NAME=`basename $SGML_FILE`
+SGML_FILE_NAME=`basename "$SGML_FILE"`
 SGML_FILE_NAME=${SGML_FILE_NAME%.*}
 
 # Determine if we are in an XML file
@@ -416,7 +416,7 @@
 fi
 
 # Prepare the parser's arguments
-SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL $SGML_FILE"
+SGML_ARGUMENTS="$SGML_INCLUDE -i $SGML_TYPE -d $SGML_STYLESHEET $SGML_OPTIONS $SGML_WARNINGS $SGML_DECL"
 
 # Call the backend
 echo "Using catalogs: `echo $SGML_CATALOG_FILES | sed 's/:/, /g'`"
@@ -430,7 +430,7 @@
 then
 	sh $SGML_BACKEND
 else
-	sh $SGML_BACKEND >$SGML_FILE_NAME.html
+	sh $SGML_BACKEND > "$SGML_FILE_NAME.html"
 fi
 SGML_RETURN=$?
 cd "$SGML_CURRENT_DIRECTORY"

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2363 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for handling spaces in directory name
  2006-06-15 18:38 Patch for handling spaces in directory name Trevor Harmon
@ 2006-06-16  5:21 ` Éric Bischoff
  2006-06-27 19:36   ` Trevor Harmon
  0 siblings, 1 reply; 6+ messages in thread
From: Éric Bischoff @ 2006-06-16  5:21 UTC (permalink / raw)
  To: Tim Waugh; +Cc: docbook-tools-discuss, Trevor Harmon

Le Jeudi 15 Juin 2006 20:38, Trevor Harmon a écrit :
> There's a bug in docbook-tools 0.6.14: If the directory containing
> the DocBook file to be processed has a space in it, the scripts will
> fail.
>
> I've attached a patch that fixes this bug. Basically, all I did was
> put quotes around shell variables. However, I did have to make a more
> substantial change: The SGML_FILE variable had to be factored out of
> SGML_ARGUMENTS so that it could be quoted.
>
> Could someone with commit rights please take a look at this patch and
> apply it? Thanks,

Tim? Are you still alive?


-- 
Concombre : "Alors, qu'est-ce que tu aimes dans la vie ?"
Chourave :  "J'aime médire."
(Le concombre masqué, Mandriva)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for handling spaces in directory name
  2006-06-16  5:21 ` Éric Bischoff
@ 2006-06-27 19:36   ` Trevor Harmon
  2006-06-27 20:14     ` Éric Bischoff
  2006-06-28 17:20     ` Éric Bischoff
  0 siblings, 2 replies; 6+ messages in thread
From: Trevor Harmon @ 2006-06-27 19:36 UTC (permalink / raw)
  To: Éric Bischoff; +Cc: Tim Waugh, docbook-tools-discuss

On Jun 15, 2006, at 10:21 PM, Éric Bischoff wrote:

> Le Jeudi 15 Juin 2006 20:38, Trevor Harmon a écrit :
>> There's a bug in docbook-tools 0.6.14: If the directory containing
>> the DocBook file to be processed has a space in it, the scripts will
>> fail.
>>
>> I've attached a patch that fixes this bug. Basically, all I did was
>> put quotes around shell variables. However, I did have to make a more
>> substantial change: The SGML_FILE variable had to be factored out of
>> SGML_ARGUMENTS so that it could be quoted.
>>
>> Could someone with commit rights please take a look at this patch and
>> apply it? Thanks,
>
> Tim? Are you still alive?

Hmm... apparently not. Is there someone else who could review the  
patch and commit it to the repo?

Trevor

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for handling spaces in directory name
  2006-06-27 19:36   ` Trevor Harmon
@ 2006-06-27 20:14     ` Éric Bischoff
  2006-06-28 17:20     ` Éric Bischoff
  1 sibling, 0 replies; 6+ messages in thread
From: Éric Bischoff @ 2006-06-27 20:14 UTC (permalink / raw)
  To: Trevor Harmon; +Cc: Tim Waugh, docbook-tools-discuss

Le Mardi 27 Juin 2006 21:36, Trevor Harmon a écrit :
> > Tim? Are you still alive?
>
> Hmm... apparently not. Is there someone else who could review the
> patch and commit it to the repo?

I think I still have write access to the repository... I could try.


-- 
Si on ne peut pas toujours compter sur ses amis, on peut toujours compter son 
or.
(Donjon de Naheulbeuk)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for handling spaces in directory name
  2006-06-27 19:36   ` Trevor Harmon
  2006-06-27 20:14     ` Éric Bischoff
@ 2006-06-28 17:20     ` Éric Bischoff
  2006-06-28 18:18       ` Tim Waugh
  1 sibling, 1 reply; 6+ messages in thread
From: Éric Bischoff @ 2006-06-28 17:20 UTC (permalink / raw)
  To: Trevor Harmon; +Cc: Tim Waugh, docbook-tools-discuss, Tim Waugh

Le Mardi 27 Juin 2006 21:36, Trevor Harmon a écrit :
> > Tim? Are you still alive?
>
> Hmm... apparently not. Is there someone else who could review the
> patch and commit it to the repo?

Hmmm. We are having a big problem. I have no more copy of the repository here. 
I don't remind the instructions to connect to the CVS repository (there was 
something with EXPORT CVS_RSH=ssh, as far as I can remember), nor my 
password(s). Somehow that's quite normal, since I'm not the maintainer 
anymore.

We have to hope that Tim is just on vacation now and that he will return soon.

Otherwise we will have to engage in a painful process: write to redhat to 
explain the situation, get new access to the repository or move away the 
project from their repository, etc.

I have found another email address for Tim. Perharps it will work better?

-- 
Si on ne peut pas toujours compter sur ses amis, on peut toujours compter son 
or.
(Donjon de Naheulbeuk)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Patch for handling spaces in directory name
  2006-06-28 17:20     ` Éric Bischoff
@ 2006-06-28 18:18       ` Tim Waugh
  0 siblings, 0 replies; 6+ messages in thread
From: Tim Waugh @ 2006-06-28 18:18 UTC (permalink / raw)
  To: Éric Bischoff; +Cc: Trevor Harmon, docbook-tools-discuss

[-- Attachment #1: Type: text/plain, Size: 211 bytes --]

On Wed, 2006-06-28 at 19:20 +0200, Éric Bischoff wrote:

> We have to hope that Tim is just on vacation now and that he will return soon.

I'm still here -- just a bit swamped at the moment.

Tim.
*/


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-06-28 18:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-15 18:38 Patch for handling spaces in directory name Trevor Harmon
2006-06-16  5:21 ` Éric Bischoff
2006-06-27 19:36   ` Trevor Harmon
2006-06-27 20:14     ` Éric Bischoff
2006-06-28 17:20     ` Éric Bischoff
2006-06-28 18:18       ` Tim Waugh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).