summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--perl_checker.src/Makefile2
-rw-r--r--perl_checker.src/build.mli1
-rw-r--r--perl_checker.src/perl_checker.ml4
-rw-r--r--perl_checker.src/tree.ml2
5 files changed, 7 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 35d224b..eabff8b 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ MDK/Common.pm: %: %.pl
perl $< > $@
perl_checker.src/perl_checker:
- $(MAKE) -C perl_checker.src build_ml $(PERL_CHECKER_TARGET) VENDORLIB=$(VENDORLIB)
+ $(MAKE) -C perl_checker.src build_ml $(PERL_CHECKER_TARGET) VENDORLIB=$(VENDORLIB) DEBUG=0
test: perl_checker.src/perl_checker
perl_checker.src/perl_checker MDK/Common/*.pm
diff --git a/perl_checker.src/Makefile b/perl_checker.src/Makefile
index 37a562b..91a79bd 100644
--- a/perl_checker.src/Makefile
+++ b/perl_checker.src/Makefile
@@ -7,6 +7,7 @@ BCSUFFIX = _debug
SOURCES = build.ml common.ml flags.ml config_file.ml types.mli info.ml parser_helper.ml parser.mly lexer.mll tree.ml global_checks.ml perl_checker.ml
LIBS = unix
VENDORLIB = $(shell dirname `pwd`)
+DEBUG = 1
NAME = shyant
@@ -19,6 +20,7 @@ build_ml:
build.ml:
date '+let date = %s' > $@
echo 'let fake_packages_dir = "'$(VENDORLIB)'/perl_checker_fake_packages"' >> $@
+ echo 'let debugging = $(DEBUG) > 0' >> $@
tags:
ocamltags *.ml
diff --git a/perl_checker.src/build.mli b/perl_checker.src/build.mli
index 49acf6e..3c6641d 100644
--- a/perl_checker.src/build.mli
+++ b/perl_checker.src/build.mli
@@ -1,2 +1,3 @@
val date : int
val fake_packages_dir : string
+val debugging : bool
diff --git a/perl_checker.src/perl_checker.ml b/perl_checker.src/perl_checker.ml
index 761d7e5..48e9a2d 100644
--- a/perl_checker.src/perl_checker.ml
+++ b/perl_checker.src/perl_checker.ml
@@ -33,7 +33,7 @@ let rec parse_file from_basedir require_name per_files file =
try
Info.start_a_new_file file ;
let tokens = Lexer.get_token Lexer.token lexbuf in
- let _ = Unix.close_process_in channel in
+ if not Build.debugging then ignore (Unix.close_process_in channel) ;
let t = Parser_helper.parse_tokens Parser.prog tokens (Some lexbuf) in
let per_file = get_global_info_from_package from_basedir require_name build_time t in
set_basedir per_files per_file ;
@@ -102,7 +102,7 @@ let parse_options =
let usage = "Usage: perl_checker [-v] [-q] <files>\nOptions are:" in
Arg.parse options (lpush args_r) usage;
- let files = if !args_r = [] then ["../t.pl"] else !args_r in
+ let files = if !args_r = [] && Build.debugging then ["../t.pl"] else !args_r in
let files = List.map Info.file_to_absolute_file files in
let required_packages, per_files = collect_withenv (parse_file true None) (default_per_files()) files in
diff --git a/perl_checker.src/tree.ml b/perl_checker.src/tree.ml
index ea61876..7e1488d 100644
--- a/perl_checker.src/tree.ml
+++ b/perl_checker.src/tree.ml
@@ -257,7 +257,7 @@ let read_xs_extension_from_so global_vars_declared package pos =
let fq, name = find_package_name [] 0 in
Hashtbl.replace global_vars_declared (I_func, String.concat "::" fq, name) (pos, None)
) () channel;
- let _ = Unix.close_process_in channel in
+ if not Build.debugging then ignore (Unix.close_process_in channel) ;
true
with Not_found -> false