Skip to content
This repository
  • 3 commits
  • 2 files changed
  • 0 comments
  • 1 contributor

Showing 2 changed files with 18 additions and 10 deletions. Show diff stats Hide diff stats

  1. +11 6 ocamllib/libbase/file.ml
  2. +7 4 tools/utils/install_release.sh
17 ocamllib/libbase/file.ml
@@ -316,17 +316,15 @@ let rec remove_symlinks path =
316 316
317 317 (* remove symlinks everywhere in the path *)
318 318 let rec remove_all_symlinks path =
319   - if path = "." || path = "/" then path else
  319 + let dirname = Filename.dirname path in
  320 + if dirname=path || path = "." || path = "/" then path else
320 321 let dirname = Filename.dirname path in
321 322 let dirname = remove_all_symlinks dirname in
322 323 let path = Filename.concat dirname (Filename.basename path) in
323 324 remove_symlinks path
324 325
325 326 (** create all necessary directories to access a file path *)
326   -let rec check_create_path ?(rights=0o755) ?(nobackslash=true) ?(isdirectory=false) path =
327   - let path = remove_all_symlinks path in
328   - let path = if isdirectory then Filename.concat path "test" else path in
329   - let path = if nobackslash then Base.String.map (fun c -> if c='\\' then '/' else c) path else path in
  327 +let rec check_create_path_of_filepath ~rights path =
330 328 let dirname = Filename.dirname path in
331 329 if dirname=path || dirname=".." || path="." || path="/" then (
332 330 true (*terminal case*)
@@ -337,10 +335,17 @@ let rec check_create_path ?(rights=0o755) ?(nobackslash=true) ?(isdirectory=fals
337 335 )
338 336 (* terminal case *)
339 337 with Sys_error _ -> (
340   - check_create_path ~rights dirname
  338 + check_create_path_of_filepath ~rights dirname
341 339 && (try Unix.mkdir dirname rights; true with Unix.Unix_error _ -> Printf.printf "mkdir error %s\n" dirname; false)
342 340 )
343 341
  342 +(** create all necessary directories to access a file or directory path *)
  343 +let check_create_path ?(rights=0o755) ?(nobackslash=true) ?(isdirectory=false) path =
  344 + let path = if nobackslash then Base.String.map (fun c -> if c='\\' then '/' else c) path else path in
  345 + let path = remove_all_symlinks path in
  346 + let path = if isdirectory then Filename.concat path "test" else path in
  347 + check_create_path_of_filepath ~rights path
  348 +
344 349 (** hopefully, this is the ultimate and portable version of cp *)
345 350 let copy ?(force=false) src tgt =
346 351 if not (Sys.file_exists src) then 1
11 tools/utils/install_release.sh
@@ -204,7 +204,7 @@ SRCDIR=$OPALANG
204 204 OPABOOK=$OPALANG/doc/book # the tutorial and book
205 205
206 206 # This is absolutely correct that the 2 variables are inversed, we should fix the value inside
207   -./configure -prefix $INSTALLDIR -libdir $PREFIX -release
  207 +#./configure -prefix $INSTALLDIR -libdir $PREFIX -release
208 208
209 209
210 210 TARGETS="distrib"
@@ -213,9 +213,9 @@ if [ $NOMAN = "false" ]; then
213 213 fi
214 214
215 215 if [ $NOOCAML = "false" ]; then
216   - make clean $TARGETS install
  216 + make install
217 217 else
218   - make clean $TARGETS install-node
  218 + make install-node
219 219 fi
220 220
221 221 mkdir -p $INSTALLDIR/share/opa/
@@ -329,7 +329,10 @@ upxf(){
329 329 if [ -n "$IS_WINDOWS" ];
330 330 then
331 331 #assuming 32-bits ocaml
332   - upx $1 || true
  332 + if file $1 | grep "ELF ";
  333 + then
  334 + upx $1 || true
  335 + fi
333 336 elif [ -n "$IS_MAC" ];
334 337 then
335 338 echo "No UPX on Mac for the moment, might bug..."

No commit comments for this range

Something went wrong with that request. Please try again.