Permalink
Browse files

[enhance] mlstate_dir: now creates an .opa dir instead of .mlstate

you should rename your .mlstate dir !!
  • Loading branch information...
1 parent 17c3909 commit 9559cae107719f57e02b4e6cf277558bf165bb66 @Aqua-Ye Aqua-Ye committed Feb 7, 2012
Showing with 9 additions and 5 deletions.
  1. +1 −1 database/badop_meta.ml
  2. +8 −4 libbase/file.ml
View
@@ -26,7 +26,7 @@ let default_file ?(name="db") () =
try
let id = Unix.geteuid() in
(Unix.getpwuid id).Unix.pw_dir /
- (if id = 0 || id >= 500 then ".mlstate" else "mlstate")
+ (if id = 0 || id >= 500 then ".opa" else "opa")
with Not_found ->
Lazy.force File.mlstate_dir (* Useful on windows (getpwuid raises that) *)
in
View
@@ -382,14 +382,18 @@ exception NoMLstateDir
let mlstate_dir = lazy (
try
let path = match Sys.os_type with
- | "Unix"
- | "Cygwin" -> Filename.concat (Sys.getenv "HOME") ".mlstate/"
+ | "Unix" ->
+ (* begin match Config.os with *)
+ (* | Config.Mac -> Filename.concat (Sys.getenv "HOME") "Library/Application Support/Opa/" *)
+ (* | _ -> *) Filename.concat (Sys.getenv "HOME") ".opa/"
+ (* end *)
+ | "Cygwin" -> Filename.concat (Sys.getenv "HOME") ".opa/"
| "Win32" -> Filename.concat (Sys.getenv "USERPROFILE") "AppData\\Local\\MLstate\\"
| s -> failwith (Printf.sprintf "Base.ml_state_dir : this platform (%s) is yet unsupported" s) in
(* assert (check_create_path ~rights:0o700 path) ; *)
if check_create_path ~rights:0o700 path then path
- else ".mlstate/" (* raise NoMLstateDir *)
- with Not_found -> ".mlstate/"
+ else ".opa/" (* raise NoMLstateDir *)
+ with Not_found -> ".opa/"
)
let mlstatelibs =

0 comments on commit 9559cae

Please sign in to comment.