The following commit has been merged in the master branch:
commit e55aa5780ead29c8ca46081911f5eaf47c374e6d
Author: Ralf Treinen <trei...@free.fr>
Date:   Sun Apr 1 12:20:38 2012 +0200

    cd to tmpdir before running bibtex (closes #666572)

diff --git a/debian/changelog b/debian/changelog
index fb6423e..273d509 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,12 @@
-bibtex2html (1.97-1) UNRELEASED; urgency=low
+bibtex2html (1.97-2) unstable; urgency=medium
+
+  * patch paranoid-bibtex: run bibtex in the directory where the .aux file
+    resides (closes: #666572). Upload with urgency medium since older
+    bibtex2html will fail with recent TeX.
+
+ -- Ralf Treinen <trei...@debian.org>  Sun, 01 Apr 2012 17:23:15 +0200
+
+bibtex2html (1.97-1) unstable; urgency=low
 
   * New upstream version
 
diff --git a/debian/patches/paranoid-bibtex b/debian/patches/paranoid-bibtex
new file mode 100644
index 0000000..4b57e14
--- /dev/null
+++ b/debian/patches/paranoid-bibtex
@@ -0,0 +1,43 @@
+Author: Ralf Treinen <trei...@debian.org>
+Description: run bibtex in the directory where the .aux file resides, in 
+ order work around security-enhanced bibtex that cannot write outside
+ its working directory
+Debian-Bug: #666572
+
+Index: bibtex2html/main.ml
+===================================================================
+--- bibtex2html.orig/main.ml   2012-04-01 16:59:13.000000000 +0200
++++ bibtex2html/main.ml        2012-04-01 16:59:49.000000000 +0200
+@@ -105,7 +105,12 @@
+    \end{enumerate} *)
+ 
+ let create_aux_file fbib tmp =
+-  let ch = open_out (tmp ^ ".aux") in
++  let ch = open_out (tmp ^ ".aux")
++  and absolute_fbib =
++    if Filename.is_relative fbib
++    then Filename.concat (Sys.getcwd ()) fbib
++    else fbib
++  in
+   output_string ch "\\relax\n\\bibstyle{";
+   output_string ch !style;
+   output_string ch "}\n";
+@@ -116,7 +121,7 @@
+   else
+     output_string ch "\\citation{*}\n";
+   output_string ch "\\bibdata{";
+-  output_string ch (Filename.chop_suffix fbib ".bib");
++  output_string ch (Filename.chop_suffix absolute_fbib ".bib");
+   output_string ch "}\n";
+   close_out ch
+ 
+@@ -143,7 +148,8 @@
+       else 
+       "" 
+     in
+-    let cmd = sprintf "%s %s %s" !command tmp redir in
++    let cmd = sprintf "cd %s && %s %s %s"
++      (Filename.dirname tmp) !command (Filename.basename tmp) redir in
+     if !Options.debug then begin 
+       eprintf "\nbibtex command: %s\n" cmd; flush stderr
+     end;
diff --git a/debian/patches/series b/debian/patches/series
index e3286d7..10e3cb9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 charset
 doc-noexamples
 test-byte
+paranoid-bibtex

-- 
bibtex2html packaging

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to