Permalink
Browse files

Use FileUtil's recursive mkdir

  • Loading branch information...
1 parent 67e8bde commit 0a68eb0fe515fd8c0aadc4ef9e60a96fc2a6036b Luke Closs committed Oct 14, 2008
Showing with 10 additions and 2 deletions.
  1. +7 −1 OMakefile
  2. +3 −1 ometastore.ml
View
@@ -13,6 +13,12 @@
# older version of glibc, to link against libattr1.
#OCAMLFLAGS += -cclib -lattr
+# Use the fileutils library for a recursive mkdir
+USE_OCAMLFIND = TRUE
+OCAMLPACKS[] =
+ fileutils
+ unix
+
# === No change should be needed after this line. ===
OCAMLFLAGS += -dtypes
@@ -21,7 +27,7 @@ OCAMLOPTFLAGS += -inline 10 -S
StaticCLibrary(ometastore_stub, ometastore_stub)
OCAML_CLIBS += ometastore_stub
-OCAML_OTHER_LIBS += unix str
+OCAML_OTHER_LIBS += str
OCamlProgram(ometastore, folddir util ometastore)
OCamlProgram(find-git-repos, folddir util find-git-repos)
View
@@ -5,6 +5,7 @@ open Printf
open Unix
open Folddir
open Util
+open FileUtil.StrUtil
let debug = ref false
let verbose = ref false
@@ -256,7 +257,8 @@ let fix_xattrs src dst =
let apply_change = function
| Added e when e.kind = S_DIR ->
out "%s: mkdir (mode %04o)\n" e.path e.mode;
- Unix.mkdir e.path e.mode
+ mkdir ~parent:true e.path;
+ chmod e.path e.mode
| Deleted _ | Added _ -> ()
| Diff (e1, e2) ->
if e1.owner <> e2.owner || e1.group <> e2.group then fix_usergroup e2;

0 comments on commit 0a68eb0

Please sign in to comment.