[Pkg-ocaml-maint-commits] [SCM] Debian packaging for coccinelle branch, fixes/system-ocamlsexp, updated. upstream/0.1.7.deb-15-ga0bedcf

Eugeniy Meshcheryakov eugen at debian.org
Mon May 11 12:15:09 UTC 2009


The following commit has been merged in the fixes/system-ocamlsexp branch:
commit a0bedcf512be138630a9bfe9f28ddd7d39bd2437
Merge: c5ed6f01c989d5f40e95676c4af11339e5a9e767 35e77c20d9896486144a66d685bbf91a011791f9
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Mon May 11 01:16:31 2009 +0200

    Merge commit 'refs/top-bases/fixes/system-ocamlsexp' into fixes/system-ocamlsexp
    
    Conflicts:
    	Makefile

diff --combined Makefile
index 013c9b3,f57fe76..cd974ce
--- a/Makefile
+++ b/Makefile
@@@ -50,7 -50,7 +50,7 @@@ SEXPSYSCMA=bigarray.cma nums.cm
  
  SYSLIBS=str.cma unix.cma $(SEXPSYSCMA)
  LIBS=commons/commons.cma \
 -     ocamlsexp/sexplib1.cma commons/commons_sexp.cma \
 +     sexplib.cma commons/commons_sexp.cma \
       globals/globals.cma \
       ctl/ctl.cma \
       parsing_cocci/cocci_parser.cma parsing_c/parsing_c.cma \
@@@ -58,10 -58,10 +58,10 @@@
       extra/extra.cma $(PYCMA) python/coccipython.cma
  
  #used for clean: and depend: and a little for rec & rec.opt
 -MAKESUBDIRS=commons ocamlsexp \
 +MAKESUBDIRS=commons \
   globals $(PYDIR) ctl parsing_cocci parsing_c \
   engine extra python
 -INCLUDEDIRS=commons commons/ocamlextra ocamlsexp \
 +INCLUDEDIRS=commons commons/ocamlextra \
   globals $(PYDIR) ctl \
   parsing_cocci parsing_c engine extra python
  
@@@ -85,13 -85,16 +85,16 @@@ OCAMLCFLAGS= #-g -dtypes # -w 
  # for profiling add  -p -inline 0
  # but 'make forprofiling' below does that for you.
  # This flag is also used in subdirectories so don't change its name here.
+ # To enable backtrace support for native code, you need to put -g in OPTFLAGS
+ # to also link with -g, but even in 3.11 the backtrace support seems buggy so
+ # not worth it.
  OPTFLAGS=
  # the following is essential for Coccinelle to compile under gentoo
  # but is now defined above in this file
  #OPTLIBFLAGS=-cclib dllpycaml_stubs.so
  
 -OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS)  $(INCLUDES)
 -OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES)
 +OCAMLC=ocamlc$(OPTBIN) $(OCAMLCFLAGS)  $(INCLUDES) -I $(shell ocamlfind query sexplib)
 +OCAMLOPT=ocamlopt$(OPTBIN) $(OPTFLAGS) $(INCLUDES) -I $(shell ocamlfind query sexplib)
  OCAMLLEX=ocamllex #-ml # -ml for debugging lexer, but slightly slower
  OCAMLYACC=ocamlyacc -v
  OCAMLDEP=ocamldep $(INCLUDES)
@@@ -106,30 -109,38 +109,36 @@@ BYTECODE_STATIC=-custo
  ##############################################################################
  # Top rules
  ##############################################################################
- .PHONY: all all.opt opt top clean distclean configure
- .PHONY: $(MAKESUBDIRS) $(MAKESUBDIRS:%=%.opt) subdirs subdirs.opt
+ .PHONY:: all all.opt byte opt top clean distclean configure
+ .PHONY:: $(MAKESUBDIRS) $(MAKESUBDIRS:%=%.opt) subdirs subdirs.opt
  
- all: .depend
+ all: Makefile.config byte preinstall
+ 
+ opt: all.opt
+ all.opt: opt-compil preinstall
+ 
+ world: preinstall
+ 	$(MAKE) byte
+ 	$(MAKE) opt-compil
+ 
+ byte: .depend
  	$(MAKE) subdirs
  	$(MAKE) $(EXEC)
  
- opt: .depend
+ opt-compil: .depend
  	$(MAKE) subdirs.opt
  	$(MAKE) $(EXEC).opt
  
- all.opt: opt
  top: $(EXEC).top
  
- world: all opt
- 
  subdirs:
- 	$(MAKE) -C commons 
- 	$(MAKE) -C commons sexp
+ 	$(MAKE) -C commons OCAMLCFLAGS="$(OCAMLCFLAGS)"
 -	$(MAKE) -C ocamlsexp OCAMLCFLAGS="$(OCAMLCFLAGS)"
+ 	$(MAKE) -C commons sexp OCAMLCFLAGS="$(OCAMLCFLAGS)"
  	+for D in $(MAKESUBDIRS); do $(MAKE) $$D || exit 1 ; done
  
  subdirs.opt:
- 	$(MAKE) all.opt -C commons 
- 	$(MAKE) -C commons sexp.opt
+ 	$(MAKE) -C commons all.opt OCAMLCFLAGS="$(OCAMLCFLAGS)"
 -	$(MAKE) -C ocamlsexp all.opt OCAMLCFLAGS="$(OCAMLCFLAGS)"
+ 	$(MAKE) -C commons sexp.opt OCAMLCFLAGS="$(OCAMLCFLAGS)"
  	+for D in $(MAKESUBDIRS); do $(MAKE) $$D.opt || exit 1 ; done
  
  $(MAKESUBDIRS):
@@@ -175,11 -186,15 +184,15 @@@ clean:
  	rm -f dllpycaml_stubs.so
  
  
- .PHONY: tools configure
+ .PHONY:: tools configure
  
  configure:
  	./configure
  
+ Makefile.config:    
+ 	@echo "Makefile.config is missing. Have you run ./configure?"
+ 	@exit 1
+ 
  tools:
  	$(MAKE) -C tools
  
@@@ -197,6 -212,57 +210,57 @@@ purebytecode
  
  
  ##############################################################################
+ # Build documentation
+ ##############################################################################
+ .PHONY:: docs
+ 
+ docs:
+ 	make -C docs
+ 
+ clean::
+ 	make -C docs clean
+ 
+ distclean::
+ 	make -C docs distclean
+ 
+ ##############################################################################
+ # Pre-Install (customization of spatch frontend script)
+ ##############################################################################
+ 
+ preinstall: scripts/spatch scripts/spatch.opt scripts/spatch.byte
+ 
+ # user will use spatch to run spatch.opt (native)
+ scripts/spatch:
+ 	cp scripts/spatch.sh scripts/spatch.tmp2
+ 	sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.tmp2 > scripts/spatch.tmp
+ 	sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.tmp > scripts/spatch
+ 	rm -f scripts/spatch.tmp2 scripts/spatch.tmp
+ 
+ # user will use spatch to run spatch (bytecode)
+ scripts/spatch.byte:
+ 	cp scripts/spatch.sh scripts/spatch.byte.tmp3
+ 	sed "s|\.opt||" scripts/spatch.byte.tmp3 > scripts/spatch.byte.tmp2
+ 	sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.byte.tmp2 \
+ 		> scripts/spatch.byte.tmp
+ 	sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.byte.tmp \
+ 		> scripts/spatch.byte
+ 	rm -f   scripts/spatch.byte.tmp3 \
+ 		scripts/spatch.byte.tmp2 \
+ 		scripts/spatch.byte.tmp
+ 
+ # user will use spatch.opt to run spatch.opt (native)
+ scripts/spatch.opt:
+ 	cp scripts/spatch.sh scripts/spatch.opt.tmp2
+ 	sed "s|SHAREDIR|$(SHAREDIR)|g" scripts/spatch.opt.tmp2 \
+ 		> scripts/spatch.opt.tmp
+ 	sed "s|LIBDIR|$(LIBDIR)|g" scripts/spatch.opt.tmp \
+ 		> scripts/spatch.opt
+ 	rm -f scripts/spatch.opt.tmp scripts/spatch.opt.tmp2
+ 
+ clean::
+ 	rm -f scripts/spatch scripts/spatch.byte scripts/spatch.opt
+ 
+ ##############################################################################
  # Install
  ##############################################################################
  
@@@ -211,11 -277,6 +275,6 @@@ install-common
  	$(INSTALL_DATA) standard.iso $(DESTDIR)$(SHAREDIR)
  	$(INSTALL_DATA) docs/spatch.1 $(DESTDIR)$(MANDIR)/man1/
  	@if [ $(FEATURE_PYTHON) -eq 1 ]; then $(MAKE) install-python; fi
- 	@echo ""
- 	@echo "You can also install spatch by copying the program spatch"
- 	@echo "(available in this directory) anywhere you want and"
- 	@echo "give it the right options to find its configuration files."
- 	@echo ""
  
  install-python:
  	mkdir -p $(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
@@@ -228,7 -289,7 +287,7 @@@
  	$(INSTALL_DATA) python/coccilib/coccigui/pygui.gladep \
  		$(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
  
- install:
+ install: install-common 
  	@if test -x spatch -a ! -x spatch.opt ; then \
  		$(MAKE) install-byte;fi
  	@if test ! -x spatch -a -x spatch.opt ; then \
@@@ -237,31 -298,26 +296,26 @@@
  		$(MAKE) install-byte; $(MAKE) install-opt;fi
  	@if test ! -x spatch -a ! -x spatch.opt ; then \
  		echo "\n\n\t==> Run 'make', 'make opt', or both first. <==\n\n";fi
+ 	@echo ""
+ 	@echo "\tYou can also install spatch by copying the program spatch"
+ 	@echo "\t(available in this directory) anywhere you want and"
+ 	@echo "\tgive it the right options to find its configuration files."
+ 	@echo ""
  
  # user will use spatch to run spatch.opt (native)
- install-def: install-common
+ install-def:
  	$(INSTALL_PROGRAM) spatch.opt $(DESTDIR)$(SHAREDIR)
- 	cp scripts/spatch.sh $(DESTDIR)$(BINDIR)/spatch
- 	sed -i "s|SHAREDIR|$(SHAREDIR)|g" $(DESTDIR)$(BINDIR)/spatch
- 	sed -i "s|LIBDIR|$(LIBDIR)|g" $(DESTDIR)$(BINDIR)/spatch
- 	chmod 755 $(DESTDIR)$(BINDIR)/spatch
+ 	$(INSTALL_PROGRAM) scripts/spatch $(DESTDIR)$(BINDIR)/spatch
  
  # user will use spatch to run spatch (bytecode)
- install-byte: install-common
+ install-byte:
  	$(INSTALL_PROGRAM) spatch $(DESTDIR)$(SHAREDIR)
- 	cp scripts/spatch.sh $(DESTDIR)$(BINDIR)/spatch
- 	sed -i "s|\.opt||" $(DESTDIR)$(BINDIR)/spatch
- 	sed -i "s|SHAREDIR|$(SHAREDIR)|g" $(DESTDIR)$(BINDIR)/spatch
- 	sed -i "s|LIBDIR|$(LIBDIR)|g" $(DESTDIR)$(BINDIR)/spatch
- 	chmod 755 $(DESTDIR)$(BINDIR)/spatch
+ 	$(INSTALL_PROGRAM) scripts/spatch.byte $(DESTDIR)$(BINDIR)/spatch
  
  # user will use spatch.opt to run spatch.opt (native)
- install-opt: install-common
+ install-opt:
  	$(INSTALL_PROGRAM) spatch.opt $(DESTDIR)$(SHAREDIR)
- 	cp scripts/spatch.sh $(DESTDIR)$(BINDIR)/spatch.opt
- 	sed -i "s|SHAREDIR|$(SHAREDIR)|g" $(DESTDIR)$(BINDIR)/spatch.opt
- 	sed -i "s|LIBDIR|$(LIBDIR)|g" $(DESTDIR)$(BINDIR)/spatch.opt
- 	chmod 755 $(DESTDIR)$(BINDIR)/spatch.opt
+ 	$(INSTALL_PROGRAM) scripts/spatch.opt $(DESTDIR)$(BINDIR)/spatch.opt
  
  uninstall:
  	rm -f $(DESTDIR)$(BINDIR)/spatch
@@@ -272,8 -328,6 +326,6 @@@
  	rm -rf $(DESTDIR)$(SHAREDIR)/python/coccilib
  	rm -f $(DESTDIR)$(MANDIR)/man1/spatch.1
  
- 
- 
  version:
  	@echo $(VERSION)
  
@@@ -285,7 -339,9 +337,9 @@@
  PACKAGE=coccinelle-$(VERSION)
  
  BINSRC=spatch env.sh env.csh standard.h standard.iso \
-        *.txt docs/* \
+        *.txt \
+        docs/manual/options.pdf docs/manual/cocci_syntax.pdf docs/spatch.1 \
+        docs/manual/cocci-python.txt \
         demos/foo.* demos/simple.*
  #      $(PYLIB) python/coccilib/ demos/printloc.*
  BINSRC2=$(BINSRC:%=$(PACKAGE)/%)
@@@ -307,7 -363,7 +361,7 @@@ OCAMLVERSION=$(shell ocaml -version |pe
  # Procedure to do each time:
  #  cvs update
  #  make sure that ocaml is the distribution ocaml of /usr/bin, not ~pad/...
- #  modify globals/config.ml
+ #  modify globals/config.ml.in
  #  cd globals/; cvs commit -m"new version"  (do not commit from the root!)
  #  ./configure --without-python
  #  make package
@@@ -327,6 -383,7 +381,7 @@@
  package:
  	make srctar
  	./configure --without-python
+ 	make docs
  	make bintar
  	make staticbintar
  	make bytecodetar
@@@ -334,8 -391,14 +389,14 @@@
  # I currently pre-generate the parser so the user does not have to
  # install menhir on his machine. We could also do a few cleanups.
  # You may have first to do a 'make licensify'.
+ #
+ # update: make docs generates pdf but also some ugly .log files, so 
+ # make clean is there to remove them while not removing the pdf
+ # (only distclean remove the pdfs).
  srctar:
  	make distclean
+ 	make docs
+ 	make clean
  	cp -a .  $(TMP)/$(PACKAGE)
  	cd $(TMP)/$(PACKAGE); cd parsing_cocci/; make parser_cocci_menhir.ml
  	cd $(TMP); tar cvfz $(PACKAGE).tgz --exclude-vcs $(PACKAGE)
@@@ -404,6 -467,7 +465,7 @@@ website
  	rm -f $(WEBSITE)/LATEST* $(WEBSITE)/coccinelle-latest.tgz
  	cp changes.txt $(WEBSITE)/changes-$(VERSION).txt
  	cd $(WEBSITE); touch LATEST_IS_$(VERSION); ln -s $(PACKAGE).tgz coccinelle-latest.tgz
+ 	cp readme.txt $(WEBSITE)
  
  
  #TXT=$(wildcard *.txt)
@@@ -414,7 -478,7 +476,7 @@@ syncwiki
  darcsweb:
  #	@echo pull from ~/public_html/darcs/c-coccinelle and c-commons and lib-xxx
  
- DARCSFORESTS=commons \
+ DARCSFORESTS=commons ocamlsexp \
   parsing_c parsing_cocci engine
  
  update_darcs:
diff --combined commons/Makefile
index 7a76d19,ce53152..ee407bb
--- a/commons/Makefile
+++ b/commons/Makefile
@@@ -29,7 -29,7 +29,7 @@@ SRC+=$(MYSRC
  SRC+=ocamlextra/enum.ml ocamlextra/dynArray.ml
  SRC+=ocamlextra/suffix_tree.ml ocamlextra/suffix_tree_ext.ml
  
- SYSLIBS=str.cma unix.cma
+ SYSLIBS=str.cma bigarray.cma unix.cma
  
  INCLUDEDIRS=ocamlextra ocollection
  SUBDIRS=ocamlextra ocollection
@@@ -72,7 -72,7 +72,7 @@@ REGEXPINCLUDES=-I ../ocamlpcre/lib  -I 
  
  #sexplib 
  MYSEXPSRC=sexp_common.ml
 -SEXPINCLUDES=-I ../ocamlsexp -I ../ocamltarzan/lib-sexp -I ../../ocamltarzan/lib-sexp
 +SEXPINCLUDES=-I `ocamlfind query sexplib` -I ../ocamltarzan/lib-sexp -I ../../ocamltarzan/lib-sexp
  #binprot
  MYBINSRC=bin_common.ml
  BININCLUDES=-I ../ocamltarzan/lib-binprot -I ../../ocamltarzan/lib-binprot
@@@ -105,7 -105,7 +105,7 @@@ OPTFLAGS
  # ocaml, when it is available, which speeds up compilation. So
  # if you want the fast version of the ocaml chain tools, set this var 
  # or setenv it to ".opt" in your startup script.
- #OPTBIN= #.opt
+ OPTBIN ?= #.opt
  
  OCAMLCFLAGS ?= -g -dtypes
  
diff --combined commons/sexp_common.ml
index 2f0c6a0,208d760..806c40e
--- a/commons/sexp_common.ml
+++ b/commons/sexp_common.ml
@@@ -1,5 -1,6 +1,7 @@@
+ (* automatically generated by ocamltarzan *)
+ 
  open Common
 +open Sexplib
  
  let either_of_sexp__ =
    let _loc = "Xxx.either"
diff --combined testing.ml
index 8777859,b488d72..ee89772
--- a/testing.ml
+++ b/testing.ml
@@@ -21,7 -21,6 +21,7 @@@
  
  
  open Common
 +open Sexplib
  
  (*****************************************************************************)
  (* Test framework *)
@@@ -69,8 -68,18 +69,18 @@@ let testone x compare_with_expected_fla
            
  
  (* ------------------------------------------------------------------------ *)
- let testall () =
- 
+ (* note: if you get some weird results in -testall, and not in -test, 
+  * it is possible that a test file work in -test but may not 
+  * work while used inside a -testall. If we have some bugs in our
+  * parser that modify some global state and that those states 
+  * are not reseted between each test file, then having run previous
+  * test files may have an influence on another test file which mean
+  * than a test may work in isolation (via -test) but not otherwise
+  * (via -testall). Fortunately such bugs are rare.
+  * 
+  *)
+ let testall ?(expected_score_file="tests/SCORE_expected.sexp") () =
+  
    let score  = empty_score () in
  
    let expected_result_files = 
@@@ -94,6 -103,8 +104,8 @@@
        try (
          Common.timeout_function timeout_testall  (fun () -> 
  
+ 	  pr2 res;
+ 
  	  let cocci_infos = Cocci.pre_engine (cocci_file, !Config.std_iso) in
            let xs = Cocci.full_engine cocci_infos [cfile] in
  	  Cocci.post_engine cocci_infos;
@@@ -107,7 -118,6 +119,6 @@@
            let (correct, diffxs) = Compare_c.compare_default generated expected
            in
  
- 	  pr2 res;
            (* I don't use Compare_c.compare_result_to_string because
             * I want to indent a little more the messages.
             *)
@@@ -156,18 -166,31 +167,31 @@@
      pr2 "--------------------------------";
      pr2 "regression testing  information";
      pr2 "--------------------------------";
- 
+  
+     (* now default argument of testall:
      let expected_score_file = "tests/SCORE_expected.sexp" in
+     *)
+     let expected_score_file_orig = "tests/SCORE_expected_orig.sexp" in
      let best_of_both_file = "tests/SCORE_best_of_both.sexp" in
      let actual_score_file = "tests/SCORE_actual.sexp" in
-     
+ 
      pr2 ("regression file: "^ expected_score_file);
      let (expected_score : score) = 
        if Sys.file_exists expected_score_file
        then 
          let sexp = Sexp.load_sexp expected_score_file in
          Sexp_common.score_of_sexp sexp
-       else empty_score()
+       else 
+         if Sys.file_exists expected_score_file_orig 
+         then begin
+           pr2 (spf "use expected orig file (%s)" expected_score_file_orig);
+           Common.command2 (spf "cp %s %s" expected_score_file_orig 
+                                           expected_score_file);
+           let sexp = Sexp.load_sexp expected_score_file in
+           Sexp_common.score_of_sexp sexp
+         end
+        else 
+           empty_score()
      in
  
      let new_bestscore = Common.regression_testing_vs score expected_score in
@@@ -196,7 -219,8 +220,8 @@@
      else 
        if good < expected_good
        then begin 
-         pr2 "Current score is lower than expected, :(";
+         pr2 "Current score is lower than expected :(";
+         pr2 (spf "(was expecting %d but got %d)" expected_good good);
          pr2 "";
          pr2 "If you think it's normal, then maybe you need to update the";
          pr2 (spf "score file %s, copying info from %s."
@@@ -204,7 -228,8 +229,8 @@@
          raise (UnixExit 1);
        end
        else begin
-         pr2 "Current score is greater than expected, :)";
+         pr2 "Current score is greater than expected :)";
+         pr2 (spf "(was expecting %d but got %d)" expected_good good);
          pr2 "Generating new expected score file and saving old one";
          Common.command2_y_or_no_exit_if_no
            (spf "mv %s %s" expected_score_file (expected_score_file ^ ".save"));

-- 
Debian packaging for coccinelle



More information about the Pkg-ocaml-maint-commits mailing list