diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-09-30 17:48:40 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-09-30 17:48:40 +0000 |
commit | eac85b5363a054499d04928741f98498228699ec (patch) | |
tree | dcc119a08cb50c18d44fc818d5779a0fadfebf27 | |
parent | 6052fd382e639cb30feba5eb4a3b276ba0ec5c43 (diff) | |
download | perl-MDK-Common-eac85b5363a054499d04928741f98498228699ec.tar perl-MDK-Common-eac85b5363a054499d04928741f98498228699ec.tar.gz perl-MDK-Common-eac85b5363a054499d04928741f98498228699ec.tar.bz2 perl-MDK-Common-eac85b5363a054499d04928741f98498228699ec.tar.xz perl-MDK-Common-eac85b5363a054499d04928741f98498228699ec.zip |
use absolute directories in Tree.use_lib
-rw-r--r-- | perl_checker.src/common.ml | 4 | ||||
-rw-r--r-- | perl_checker.src/tree.ml | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/perl_checker.src/common.ml b/perl_checker.src/common.ml index 9286857..4a7f950 100644 --- a/perl_checker.src/common.ml +++ b/perl_checker.src/common.ml @@ -829,7 +829,9 @@ let expand_symlinks file = | _ -> internal_error (Printf.sprintf "expand_symlinks: %s is relative\n" file) let file_to_absolute_file file = - if file.[0] = '/' then file else expand_symlinks (Unix.getcwd() ^ "/" ^ file) + if file.[0] = '/' then file else + let cwd = Unix.getcwd() in + if file = "." then cwd else expand_symlinks (cwd ^ "/" ^ file) let mtime f = int_of_float ((Unix.stat f).Unix.st_mtime) diff --git a/perl_checker.src/tree.ml b/perl_checker.src/tree.ml index e126808..7126f91 100644 --- a/perl_checker.src/tree.ml +++ b/perl_checker.src/tree.ml @@ -42,7 +42,7 @@ type per_file = { let anonymous_package_count = ref 0 let empty_exports = { export_ok = []; export_auto = []; export_tags = []; special_export = None } -let use_lib = ref (readlines (Unix.open_process_in "perl -le 'print foreach @INC'")) +let use_lib = ref (List.map file_to_absolute_file (readlines (Unix.open_process_in "perl -le 'print foreach @INC'"))) let ignore_package pkg = if !Flags.verbose then print_endline_flush ("ignoring package " ^ pkg); @@ -185,7 +185,7 @@ let get_uses t = List.fold_left (fun uses e -> match e with | Use(Ident(None, "lib", _), [libs]) -> - use_lib := List.map snd (from_qw libs) @ !use_lib ; + use_lib := List.map file_to_absolute_file (List.map snd (from_qw libs)) @ !use_lib ; uses | Use(Ident _ as pkg, _) when uses_external_package (string_of_Ident pkg) -> uses | Use(Ident(_, _, pos) as ident, l) -> |