[Pkg-ocaml-maint-commits] [SCM] Debian packaging for coccinelle branch, master, updated. debian/0.1.7.deb-3-9-gb86803d
Eugeniy Meshcheryakov
eugen at debian.org
Mon May 11 12:31:39 UTC 2009
The following commit has been merged in the master branch:
commit b86803d39214636f25044c264ad3e44f2651c92a
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date: Mon May 11 14:28:20 2009 +0200
Don't suggest doc-base and build-depend on texlive packages
diff --git a/Makefile b/Makefile
index 78923d7..cd974ce 100644
--- a/Makefile
+++ b/Makefile
@@ -34,11 +34,11 @@ TARGET=spatch
SRC=flag_cocci.ml cocci.ml testing.ml test.ml main.ml
ifeq ($(FEATURE_PYTHON),1)
-PYCMA=pycaml/pycaml.cma
-PYDIR=pycaml
-PYLIB=dllpycaml_stubs.so
-# the following is essential for Coccinelle to compile under gentoo (weird)
-OPTLIBFLAGS=-cclib dllpycaml_stubs.so
+PYCMA=pycaml.cma
+PYDIR=
+PYLIB=
+# the following is essential for Coccinelle to compile under gentoo (wierd)
+OPTLIBFLAGS=
else
PYCMA=
PYDIR=
@@ -50,7 +50,7 @@ SEXPSYSCMA=bigarray.cma nums.cma
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,11 +58,11 @@ LIBS=commons/commons.cma \
extra/extra.cma $(PYCMA) python/coccipython.cma
#used for clean: and depend: and a little for rec & rec.opt
-MAKESUBDIRS=commons ocamlsexp \
- globals menhirlib $(PYDIR) ctl parsing_cocci parsing_c \
+MAKESUBDIRS=commons \
+ globals $(PYDIR) ctl parsing_cocci parsing_c \
engine extra python
-INCLUDEDIRS=commons commons/ocamlextra ocamlsexp \
- globals menhirlib $(PYDIR) ctl \
+INCLUDEDIRS=commons commons/ocamlextra \
+ globals $(PYDIR) ctl \
parsing_cocci parsing_c engine extra python
##############################################################################
@@ -93,8 +93,8 @@ OPTFLAGS=
# 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)
@@ -133,13 +133,11 @@ top: $(EXEC).top
subdirs:
$(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) -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
@@ -288,7 +286,6 @@ install-python:
$(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
$(INSTALL_DATA) python/coccilib/coccigui/pygui.gladep \
$(DESTDIR)$(SHAREDIR)/python/coccilib/coccigui
- $(INSTALL_LIB) dllpycaml_stubs.so $(DESTDIR)$(LIBDIR)
install: install-common
@if test -x spatch -a ! -x spatch.opt ; then \
diff --git a/commons/Makefile b/commons/Makefile
index ce53152..ee407bb 100644
--- a/commons/Makefile
+++ b/commons/Makefile
@@ -72,7 +72,7 @@ REGEXPINCLUDES=-I ../ocamlpcre/lib -I ../../ocamlpcre/lib
#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
diff --git a/commons/sexp_common.ml b/commons/sexp_common.ml
index 208d760..806c40e 100644
--- a/commons/sexp_common.ml
+++ b/commons/sexp_common.ml
@@ -1,6 +1,7 @@
(* automatically generated by ocamltarzan *)
open Common
+open Sexplib
let either_of_sexp__ =
let _loc = "Xxx.either"
diff --git a/debian/changelog b/debian/changelog
index 73dfa75..56f4148 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,8 +6,9 @@ coccinelle (0.1.8.deb-1) unstable; urgency=low
* New patch:
- fixes/documentation-build
* Don't build documentation
+ * Don't suggest doc-base and build-depend on texlive packages
- -- Євгеній Мещеряков <eugen at debian.org> Mon, 11 May 2009 01:59:31 +0200
+ -- Євгеній Мещеряков <eugen at debian.org> Mon, 11 May 2009 14:27:45 +0200
coccinelle (0.1.7.deb-3) unstable; urgency=high
diff --git a/debian/control b/debian/control
index bb00d17..089e161 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Package: coccinelle
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}, ${F:OCamlRun}, ${python:Depends}, python-gobject,
python-gtk2, python-glade2
-Suggests: doc-base, vim-addon-manager
+Suggests: vim-addon-manager
Description: semantic patching tool for C
Cocinelle is a program matching and transformation tool for C.
The programmer describes the code to match and the transformation to
diff --git a/docs/Makefile b/docs/Makefile
index 91d8e35..89eea99 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -3,12 +3,12 @@ SUBDIR=manual
.PHONY: all clean distclean
all:
- make -C $(SUBDIR)
+# make -C $(SUBDIR)
clean:
- make -C $(SUBDIR) clean
+# make -C $(SUBDIR) clean
distclean:
- make -C $(SUBDIR) distclean
+# make -C $(SUBDIR) distclean
diff --git a/docs/spatch.1 b/docs/spatch.1
index 87e0ec8..2448f7c 100644
--- a/docs/spatch.1
+++ b/docs/spatch.1
@@ -61,10 +61,10 @@ the semantic patch file
process all files in directory recursively
.TP
.B -iso_file \fI<file>\fP
-(default=/usr/local/share/coccinelle/standard.iso)
+(default=/usr/share/coccinelle/standard.iso)
.TP
.B -macro_file \fI<file>\fP
-(default=/usr/local/share/coccinelle/standard.h)
+(default=/usr/share/coccinelle/standard.h)
.TP
.B -debug
print some information to help debug the matching process
@@ -118,7 +118,7 @@ show summary of options.
Apply the semantic patch foo.cocci to the C file foo.c. The semantic patch
is applied modulo a set of isomorphisms contained in standard.iso
(standard.iso is by default located in
-/usr/local/share/coccinelle/standard.iso). A patch showing the effect of
+/usr/share/coccinelle/standard.iso). A patch showing the effect of
the application, if any, will be generated on the standard output.
./spatch -sp_file foo.cocci foo.c -o /tmp/newfoo.c
@@ -136,18 +136,18 @@ shows selection of information about the application of
a semantic patch to a file or directory.
.SH FILES
-.I /usr/local/share/coccinelle/standard.iso
+.I /usr/share/coccinelle/standard.iso
.RS
This file contains the default set of isomorphisms.
.RE
-.I /usr/local/share/coccinelle/standard.h
+.I /usr/share/coccinelle/standard.h
.RS
This file contains the default set of macro hints.
.SH ENVIRONMENT
.IP COCCINELLE_HOME
The path to coccinelle share directory. Defaut is
-.I /usr/local/share/coccinelle
+.I /usr/share/coccinelle
.SH REFERENCES
Y. Padioleau, J.L. Lawall, R.R Hansen, G. Muller
diff --git a/main.ml b/main.ml
index 7aa9ab5..02b4357 100644
--- a/main.ml
+++ b/main.ml
@@ -798,9 +798,11 @@ let main_action xs =
if !output_file =$= ""
then begin
+ (*
let tmpfile = "/tmp/"^Common.basename infile in
pr2 (spf "One file modified. Result is here: %s" tmpfile);
Common.command2 ("cp "^outfile^" "^tmpfile);
+ *)
end
));
if !output_file <> "" then
diff --git a/parsing_cocci/Makefile b/parsing_cocci/Makefile
index 51a86b4..532c0d4 100644
--- a/parsing_cocci/Makefile
+++ b/parsing_cocci/Makefile
@@ -40,8 +40,8 @@ get_constants.ml get_constants2.ml adjacency.ml parse_cocci.ml
LIBS=../commons/commons.cma ../globals/globals.cma
SYSLIBS = str.cma unix.cma
-#MENHIR_PATH=$(shell ocamlfind query menhirLib)
-MENHIR_PATH=../menhirlib
+MENHIR_PATH=$(shell ocamlfind query menhirLib)
+#MENHIR_PATH=../menhirlib
INCLUDES = -I ../commons -I ../commons/ocamlextra -I ../globals \
-I $(MENHIR_PATH)
diff --git a/python/Makefile b/python/Makefile
index 16a9407..33e2642 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -30,7 +30,7 @@ TARGET=coccipython
SOURCES= pycocci_aux.ml pycocci.ml
-INCLUDEDIRS = ../commons ../commons/ocamlextra ../globals ../pycaml \
+INCLUDEDIRS = ../commons ../commons/ocamlextra ../globals \
../parsing_c ../parsing_cocci
SYSLIBS = str.cma unix.cma
diff --git a/python/yes_pycocci.ml b/python/yes_pycocci.ml
index 2ef2807..7949d91 100644
--- a/python/yes_pycocci.ml
+++ b/python/yes_pycocci.ml
@@ -66,6 +66,11 @@ let load_module module_name =
(* end python module handling part *)
(* initialisation routines *)
+let _pycocci_setargs argv0 =
+ let argv = pysequence_list (pytuple_fromsingle (pystring_fromstring argv0)) in
+ let sys_mod = load_module "sys" in
+ pyobject_setattrstring (sys_mod, "argv", argv)
+
let pycocci_init () =
(* initialize *)
if not !initialised then (
@@ -78,7 +83,7 @@ let pycocci_init () =
(* set argv *)
let argv0 = Printf.sprintf "%s%sspatch" (Sys.getcwd ()) (match Sys.os_type with "Win32" -> "\\" | _ -> "/") in
- let _ = pycaml_setargs argv0 in
+ let _ = _pycocci_setargs argv0 in
coccinelle_module := (pymodule_new "coccinelle");
module_map := StringMap.add "coccinelle" !coccinelle_module !module_map;
@@ -107,7 +112,7 @@ let pycocci_get_class_type fqn =
let pycocci_instantiate_class fqn args =
let class_type = pycocci_get_class_type fqn in
- let obj = pyobject_callobject(class_type, args) in
+ let obj = pyeval_callobject(class_type, args) in
check_return_value obj;
obj
@@ -137,13 +142,21 @@ let build_class cname parent methods pymodule =
check_int_return_value v;
(cd, cx)
+let _pycocci_true () =
+ let builtins = pyeval_getbuiltins () in
+ pyobject_getitem (builtins, pystring_fromstring "True")
+
+let _pycocci_false () =
+ let builtins = pyeval_getbuiltins () in
+ pyobject_getitem (builtins, pystring_fromstring "False")
+
let has_environment_binding env name =
let a = pytuple_toarray name in
let (rule, name) = (Array.get a 1, Array.get a 2) in
let orule = pystring_asstring rule in
let oname = pystring_asstring name in
let e = List.exists (function (x,y) -> orule =$= x && oname =$= y) env in
- if e then pytrue () else pyfalse ()
+ if e then _pycocci_true () else _pycocci_false ()
let pyoutputinstance = ref (pynone ())
let pyoutputdict = ref (pynone ())
@@ -178,6 +191,9 @@ let contains_binding e (_,(r,m)) =
let _ = List.find (function ((re, rm), _) -> r =$= re && m =$= rm) e in true
with Not_found -> false
+let _pycocci_tuple6 (a,b,c,d,e,f) =
+ pytuple_fromarray ([|a; b; c; d; e; f|])
+
let construct_variables mv e =
let find_binding (r,m) =
try
@@ -211,7 +227,7 @@ let construct_variables mv e =
let locs =
List.map
(function (fname,current_element,(line,col),(line_end,col_end)) ->
- pycocci_instantiate_class "coccilib.elems.Location" (pytuple6
+ pycocci_instantiate_class "coccilib.elems.Location" (_pycocci_tuple6
(pystring_fromstring fname,pystring_fromstring current_element,
pystring_fromstring (Printf.sprintf "%d" line),
pystring_fromstring (Printf.sprintf "%d" col),
diff --git a/testing.ml b/testing.ml
index b488d72..ee89772 100644
--- a/testing.ml
+++ b/testing.ml
@@ -21,6 +21,7 @@
open Common
+open Sexplib
(*****************************************************************************)
(* Test framework *)
--
Debian packaging for coccinelle
More information about the Pkg-ocaml-maint-commits
mailing list