#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_compatibility_withdash_fixbug.dpatch by  <roudiere@lipn.univ-paris13.fr>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Replaced source with . for dash compatibility; also explicitly invoke 
## DP: bash in UnixExtra.run

@DPATCH@

diff -ru ocamlbricks_orig/CONFIGURATION/configuration_files.ml ocamlbricks/CONFIGURATION/configuration_files.ml
--- ocamlbricks_orig/CONFIGURATION/configuration_files.ml	2009-03-25 02:26:21.000000000 +0100
+++ ocamlbricks/CONFIGURATION/configuration_files.ml	2009-03-25 02:42:54.000000000 +0100
@@ -58,7 +58,9 @@
 let output_of_file_name file_name variables =
   try
     let source_command_line =
-      Printf.sprintf "set -e; (source %s 2> /dev/null &&" file_name in
+    (* This is very important: dash does not support "source", you have to use the
+       less readable, but more portable, ".": *)
+      Printf.sprintf "set -e; (. %s 2> /dev/null &&" file_name in
     let command_line =
       List.fold_left
         (fun string variable ->
diff -ru ocamlbricks_orig/EXTRA/unixExtra.ml ocamlbricks/EXTRA/unixExtra.ml
--- ocamlbricks_orig/EXTRA/unixExtra.ml	2009-03-25 02:26:21.000000000 +0100
+++ ocamlbricks/EXTRA/unixExtra.ml	2009-03-25 02:40:48.000000000 +0100
@@ -366,7 +366,7 @@
         ((" <"^name),name) 
       end
   in 
-  let code = Unix.system(script^" >"^output^input_option) in 
+  let code = Unix.system("bash -c " ^script^" >"^output^input_option) in
   let str = (cat output) in
   begin
     if trace then begin 
