debian/0000755000000000000000000000000012247214524007171 5ustar debian/libxml-light-ocaml.install.in0000644000000000000000000000005612174411320014644 0ustar debian/META.xml-light @OCamlStdlibDir@/METAS/ debian/control0000644000000000000000000000304412174411376010600 0ustar Source: xml-light Section: ocaml Priority: optional Maintainer: Debian OCaml Maintainers Uploaders: Mehdi Dogguy Build-Depends: cdbs (>= 0.4.23-1.1), ocaml-nox (>= 4), debhelper (>= 7.0.50~), dh-ocaml (>= 0.9) Standards-Version: 3.9.2 Vcs-Git: git://anonscm.debian.org/pkg-ocaml-maint/packages/xml-light.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ocaml-maint/packages/xml-light.git Homepage: http://tech.motion-twin.com/xmllight.html Package: libxml-light-ocaml-dev Architecture: any Depends: ${ocaml:Depends}, ${shlibs:Depends}, ${misc:Depends} Provides: ${ocaml:Provides} Description: mininal XML parser and printer for OCaml (development package) This is a XML parser and printer, designed to help parsing basic XML document into OCaml data structures and printing it back to a XML document. . It also supports DTD. . You can find more information about xml-light at http://tech.motion-twin.com/xmllight.html Package: libxml-light-ocaml Architecture: any Depends: ${ocaml:Depends}, ${shlibs:Depends}, ${misc:Depends} Provides: ${ocaml:Provides} Breaks: libxml-light-ocaml-dev (<< 2.2-13) Replaces: libxml-light-ocaml-dev (<< 2.2-13) Description: mininal XML parser and printer for OCaml (runtime package) This is a XML parser and printer, designed to help parsing basic XML document into OCaml data structures and printing it back to a XML document. . It also supports DTD. . You can find more information about xml-light at http://tech.motion-twin.com/xmllight.html debian/libxml-light-ocaml-dev.dirs.in0000644000000000000000000000003312174411320014706 0ustar @OCamlStdlibDir@/xml-light debian/README.Debian0000644000000000000000000000031712174411320011223 0ustar xml-light for Debian -------------------- To use at the toplevel: #directory "+xml-light";; #load "xml-light.cma";; #open Xml;; #open Dtd;; -- YANG Shouxun , Mon Sep 26 15:27:45 2005 debian/README.source0000644000000000000000000000027112174411320011340 0ustar This package use dpatch for patching the source. Please consider reading dpatch manpage to patch the source. -- Sylvain Le Gall Sun, 22 Jun 2008 23:26:52 +0200 debian/source/0000755000000000000000000000000012174411320010461 5ustar debian/source/format0000644000000000000000000000001412174411320011667 0ustar 3.0 (quilt) debian/copyright0000644000000000000000000000145012174411320011114 0ustar Format-Specification: http://wiki.debian.org/Proposals/CopyrightFormat Upstream-Author: Nicolas Cannasse Packaged-By: Sylvain Le Gall Packaged-Date: Mon, 10 Oct 2005 23:45:16 +02005 Original-Source-Location: http://tech.motion-twin.com/zip/ Files: * Copyright: © 2003-2005 Nicolas Cannasse © 2003-2005 Motion-Twin License: LGPL-2.1+ Xml-light is distributed under the terms the LGPL v2.1 licence, which can be found in the /usr/share/common-licenses/LGPL-2.1 file on debian systems. Files: xmlParser.ml Copyright: © 2003 Nicolas Cannasse © 2003 Jacques Garrigue License: LGPL-2.1+ Files: debian/* Copyright: © 2005-2008 Sylvain Le Gall License: GPL-2+ debian/watch0000644000000000000000000000012112174411320010204 0ustar version=3 http://tech.motion-twin.com/xmllight.html zip/xml-light-([0-9.]*)\.zip debian/compat0000644000000000000000000000000212174411320010357 0ustar 7 debian/libxml-light-ocaml-dev.docs0000644000000000000000000000000712174411320014271 0ustar README debian/libxml-light-ocaml.dirs.in0000644000000000000000000000003312174411320014132 0ustar @OCamlStdlibDir@/xml-light debian/rules0000755000000000000000000000370712174411320010250 0ustar #!/usr/bin/make -f # debian/rules for xml-light package # Copyright (C) 2006 Sylvain Le Gall # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2, or (at # your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, # MA 02110-1301, USA. include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/makefile.mk include /usr/share/cdbs/1/rules/ocaml.mk PACKAGE_DEV := libxml-light-ocaml-dev DESTDIR_DEV := $(CURDIR)/debian/$(PACKAGE_DEV) DESTDIR_RUN := $(CURDIR)/debian/libxml-light-ocaml DEB_MAKE_CLEAN_TARGET := clean DEB_MAKE_BUILD_TARGET := all ifeq ($(OCAML_HAVE_OCAMLOPT),yes) DEB_MAKE_BUILD_TARGET += opt endif DEB_MAKE_INSTALL_TARGET := install ifeq ($(OCAML_HAVE_OCAMLOPT),yes) DEB_MAKE_INSTALL_TARGET += installopt endif DEB_MAKE_INSTALL_TARGET += INSTALLDIR='$(DESTDIR_DEV)/$(OCAML_STDLIB_DIR)/xml-light' clean:: -$(RM) -r '$(CURDIR)/doc' install/libxml-light-ocaml:: install/libxml-light-ocaml-dev VERSION=$(DEB_NOEPOCH_VERSION); \ VERSION=$${VERSION%%-*}; \ sed -i "s/@VERSION@/$$VERSION/g" '$(CURDIR)/debian/META.xml-light' mv $(DESTDIR_DEV)/$(OCAML_STDLIB_DIR)/xml-light/xml-light.cma \ $(DESTDIR_RUN)/$(OCAML_STDLIB_DIR)/xml-light ifeq ($(OCAML_NATDYNLINK),yes) mv $(DESTDIR_DEV)/$(OCAML_STDLIB_DIR)/xml-light/xml-light.cmxs \ $(DESTDIR_RUN)/$(OCAML_STDLIB_DIR)/xml-light else -$(RM) $(DESTDIR_DEV)/$(OCAML_STDLIB_DIR)/xml-light/xml-light.cmxs endif debian/META.xml-light.in0000644000000000000000000000015212174411320012141 0ustar version="@VERSION@" directory="+xml-light" archive(byte)="xml-light.cma" archive(native)="xml-light.cmxa" debian/gbp.conf0000644000000000000000000000003612174411320010577 0ustar [DEFAULT] pristine-tar = True debian/clean0000644000000000000000000000003312174411320010162 0ustar xml-light.a xml-light.cmxs debian/changelog0000644000000000000000000001124712247214524011050 0ustar xml-light (2.2-17) unstable; urgency=low * Team upload * Upload to unstable -- Stéphane Glondu Tue, 03 Dec 2013 00:35:48 +0100 xml-light (2.2-16) experimental; urgency=low * Team upload * Compile with OCaml >= 4 * Update Vcs-* -- Stéphane Glondu Fri, 26 Jul 2013 08:11:27 +0200 xml-light (2.2-15) unstable; urgency=low [ Sylvain Le Gall ] * Remove Sylvain Le Gall from uploaders [ Mehdi Dogguy ] * Fix CVE-2012-3514 (Closes: #685584). - add 06_CVE-2012-3514.diff -- Mehdi Dogguy Fri, 05 Oct 2012 15:31:52 +0200 xml-light (2.2-14) unstable; urgency=low * Do not try to install the .cmxs plugin on architectures where natdynlink is not available. -- Mehdi Dogguy Thu, 07 Jun 2012 13:55:42 +0200 xml-light (2.2-13) unstable; urgency=low * Provide a .cmxs plugin in libxml-light-ocaml-dev (Closes: #647299). Thanks to Benjamin Sigonneau for the patch. * Convert source package to 3.0 (quilt) format. - Fixes build-depends-on-obsolete-package (dpatch) - Fixes debian-rules-uses-deprecated-makefile (dpatch.mk) * Bump Standards-Version to 3.9.2, no changes needed. * Add libxml-light-ocaml, needed to ship .cmxs files. - libxml-light-ocaml Breaks/Replaces the old binary package libxml-light-ocaml-dev (<< 2.2-13). -- Mehdi Dogguy Tue, 29 May 2012 15:17:26 +0200 xml-light (2.2-12) unstable; urgency=low [ Sylvain Le Gall ] * Set maintainer to debian-ocaml-maint [ Mehdi Dogguy ] * Add myself to uploaders * Set the section to ocaml * Use new features of dh-ocaml 0.9 - Generate the documentation using dh_ocamldoc * Bump standards version to 3.8.3 * Reorder included files in debian/rules to workaround a CDBS bug -- Mehdi Dogguy Thu, 08 Oct 2009 23:55:08 +0200 xml-light (2.2-11) unstable; urgency=low [ Samuel Mimram ] * Rebuild with OCaml 3.11. * Switch packaging to git. * Update compat to 7. [ Sylvain Le Gall ] * Remove useless doc/variable for generating debian/control from control.in * Use debian/clean * Update debian/copyright using CopyrightFormat * Add Homepage field -- Sylvain Le Gall Mon, 02 Mar 2009 22:54:48 +0100 xml-light (2.2-10) experimental; urgency=low * Upload to experimental to build against released ocaml 3.11. * Updated ocaml-related build-deps. -- Romain Beauxis Sat, 13 Dec 2008 23:04:52 +0100 xml-light (2.2-9) experimental; urgency=low [ Stefano Zacchiroli ] * fix vcs-svn field to point just above the debian/ dir [ Romain Beauxis ] * Prepared upload to experimental against ocaml 3.11. * Versioned ocaml related build-dep to avoid confusion. * Added build-dep on dh-ocaml. * Bumped standards version (no change needed). -- Romain Beauxis Tue, 02 Dec 2008 19:28:59 +0100 xml-light (2.2-8) unstable; urgency=low * Build for ocaml 3.10.0 * Use CDBS generated documentation rather than upstream doc -- Sylvain Le Gall Tue, 04 Sep 2007 01:23:52 +0200 xml-light (2.2-7) experimental; urgency=low * Upgrade debian/watch version to 3, * Use "sed -i" to process debian/META.xml-light, * Change email address to gildor@debian.org everywhere * Rebuild for ocaml 3.10.0 -- Sylvain Le Gall Sat, 07 Jul 2007 23:26:26 +0200 xml-light (2.2-6) unstable; urgency=low * Remove trace call (Closes: #382828, #383255) -- Sylvain Le Gall Thu, 26 Oct 2006 23:26:25 +0200 xml-light (2.2-5) unstable; urgency=low * Use CDBS for debian/rules, * Upgrade debhelper debian/compat to 5, * Use patch 03_cflags, to remove CFLAGS use in the Makefile (CFLAGS has a particular meaning). -- Sylvain Le Gall Thu, 26 Oct 2006 00:43:02 +0200 xml-light (2.2-4) unstable; urgency=low * Change my email address to gildor@debian.org, * Made debian/control a PHONY target, * Upgrade standards version to 3.7.2 (no change), -- Sylvain Le Gall Thu, 15 Jun 2006 09:05:21 +0200 xml-light (2.2-3) unstable; urgency=low * Rebuild for OCaml 3.09.1 -- Sylvain Le Gall Wed, 11 Jan 2006 00:17:06 +0100 xml-light (2.2-2) unstable; urgency=low * Apply patch 02_cmi_depends to fix the FTBFS with the latest make package (Closes: #345792) -- Sylvain Le Gall Tue, 3 Jan 2006 17:37:47 +0100 xml-light (2.2-1) unstable; urgency=low * Initial release. (Closes: #333211) * README.Debian contributed by YANG Shouxun -- Sylvain Le Gall Thu, 3 Nov 2005 11:45:53 +0100 debian/patches/0000755000000000000000000000000012174411320010610 5ustar debian/patches/05_cmxs_plugin.diff0000644000000000000000000000157712174411320014310 0ustar --- a/Makefile +++ b/Makefile @@ -9,13 +9,13 @@ all: xml-light.cma test.exe doc -opt: xml-light.cmxa test_opt.exe +opt: xml-light.cmxs test_opt.exe install: all cp xml-light.cma xml.mli xmlParser.mli dtd.mli xml.cmi xmlParser.cmi dtd.cmi $(INSTALLDIR) installopt: opt all - cp xml-light.a xml-light.cmxa xml.cmx dtd.cmx xmlParser.cmx $(INSTALLDIR) + cp xml-light.a xml-light.cmxa xml-light.cmxs xml.cmx dtd.cmx xmlParser.cmx $(INSTALLDIR) doc: mkdir doc @@ -33,6 +33,9 @@ xml-light.cmxa: xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx ocamlopt -o xml-light.cmxa $(XML_LIGHT_OCAML_LFLAGS) $(LIBS) xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx +xml-light.cmxs: xml-light.cmxa + ocamlopt -o xml-light.cmxs -shared -linkall xml-light.cmxa + dtd.cmo: xml.cmi xml_lexer.cmi dtd.cmi dtd.cmx: xml.cmi xml_lexer.cmi dtd.cmi debian/patches/01_installopt.diff0000755000000000000000000000121512174411320014135 0ustar diff -urNad xml-light-2.2~/Makefile xml-light-2.2/Makefile --- xml-light-2.2~/Makefile 2005-10-11 23:26:41.000000000 +0200 +++ xml-light-2.2/Makefile 2005-10-11 23:28:00.000000000 +0200 @@ -11,8 +11,11 @@ opt: xml-light.cmxa test_opt.exe -install: all opt - cp xml-light.cmxa xml-light.a xml-light.cma xml.mli xmlParser.mli dtd.mli xml.cmi xmlParser.cmi dtd.cmi xml.cmx dtd.cmx xmlParser.cmx $(INSTALLDIR) +install: all + cp xml-light.cma xml.mli xmlParser.mli dtd.mli xml.cmi xmlParser.cmi dtd.cmi $(INSTALLDIR) + +installopt: opt all + cp xml-light.a xml-light.cmxa xml.cmx dtd.cmx xmlParser.cmx $(INSTALLDIR) doc: mkdir doc debian/patches/06_CVE-2012-3514.diff0000644000000000000000000001072212174411320013342 0ustar --- a/dtd.ml +++ b/dtd.ml @@ -93,16 +93,18 @@ type dtd = dtd_item list -type ('a,'b) hash = ('a,'b) Hashtbl.t +module StringMap = Map.Make(String) + +type 'a map = 'a StringMap.t ref type checked = { - c_elements : (string,dtd_element_type) hash; - c_attribs : (string,(string,(dtd_attr_type * dtd_attr_default)) hash) hash; + c_elements : dtd_element_type map; + c_attribs : (dtd_attr_type * dtd_attr_default) map map; } type dtd_state = { - elements : (string,dtd_element_type) hash; - attribs : (string,(string,(dtd_attr_type * dtd_attr_default)) hash) hash; + elements : dtd_element_type map; + attribs : (dtd_attr_type * dtd_attr_default) map map; mutable current : dtd_element_type; mutable curtag : string; state : (string * dtd_element_type) Stack.t; @@ -113,7 +115,21 @@ let _raises e = file_not_found := e -let empty_hash = Hashtbl.create 0 +let create_map() = ref StringMap.empty + +let empty_map = create_map() + +let find_map m k = StringMap.find k (!m) + +let set_map m k v = m := StringMap.add k v (!m) + +let unset_map m k = m := StringMap.remove k (!m) + +let iter_map f m = StringMap.iter f (!m) + +let fold_map f m = StringMap.fold f (!m) + +let mem_map m k = StringMap.mem k (!m) let pos source = let line, lstart, min, max = Xml_lexer.pos source in @@ -158,45 +174,45 @@ raise e let check dtd = - let attribs = Hashtbl.create 0 in - let hdone = Hashtbl.create 0 in - let htodo = Hashtbl.create 0 in + let attribs = create_map () in + let hdone = create_map () in + let htodo = create_map () in let ftodo tag from = try - ignore(Hashtbl.find hdone tag); + ignore(find_map hdone tag); with Not_found -> try - match Hashtbl.find htodo tag with - | None -> Hashtbl.replace htodo tag from + match find_map htodo tag with + | None -> set_map htodo tag from | Some _ -> () with Not_found -> - Hashtbl.add htodo tag from + set_map htodo tag from in let fdone tag edata = try - ignore(Hashtbl.find hdone tag); + ignore(find_map hdone tag); raise (Check_error (ElementDefinedTwice tag)); with Not_found -> - Hashtbl.remove htodo tag; - Hashtbl.add hdone tag edata + unset_map htodo tag; + set_map hdone tag edata in let fattrib tag aname adata = let h = (try - Hashtbl.find attribs tag + find_map attribs tag with Not_found -> - let h = Hashtbl.create 1 in - Hashtbl.add attribs tag h; + let h = create_map () in + set_map attribs tag h; h) in try - ignore(Hashtbl.find h aname); + ignore(find_map h aname); raise (Check_error (AttributeDefinedTwice (tag,aname))); with Not_found -> - Hashtbl.add h aname adata + set_map h aname adata in let check_item = function | DTDAttribute (tag,aname,atype,adef) -> @@ -229,7 +245,7 @@ check_type etype in List.iter check_item dtd; - Hashtbl.iter (fun t from -> + iter_map (fun t from -> match from with | None -> raise (Check_error (ElementNotDeclared t)) | Some tag -> raise (Check_error (ElementReferenced (t,tag))) @@ -248,7 +264,7 @@ curtag = "_root"; } in try - ignore(Hashtbl.find d.elements (String.uppercase root)); + ignore(find_map d.elements (String.uppercase root)); d with Not_found -> raise (Check_error (ElementNotDeclared root)) @@ -365,7 +381,7 @@ let check_attrib ahash (aname,_) = try - ignore(Hashtbl.find ahash aname); + ignore(find_map ahash aname); with Not_found -> raise (Prove_error (UnexpectedAttribute aname)) @@ -378,12 +394,12 @@ let uattr = List.map (fun (aname,aval) -> String.uppercase aname , aval) attr in prove_child dtd (Some utag); Stack.push (dtd.curtag,dtd.current) dtd.state; - let elt = (try Hashtbl.find dtd.elements utag with Not_found -> raise (Prove_error (UnexpectedTag tag))) in - let ahash = (try Hashtbl.find dtd.attribs utag with Not_found -> empty_hash) in + let elt = (try find_map dtd.elements utag with Not_found -> raise (Prove_error (UnexpectedTag tag))) in + let ahash = (try find_map dtd.attribs utag with Not_found -> empty_map) in dtd.curtag <- tag; dtd.current <- elt; List.iter (check_attrib ahash) uattr; - let attr = Hashtbl.fold (prove_attrib dtd uattr) ahash [] in + let attr = fold_map (prove_attrib dtd uattr) ahash [] in let childs = ref (List.map (do_prove dtd) childs) in (match dtd.current with | DTDAny debian/patches/03_cflags.diff0000755000000000000000000000270512174411320013212 0ustar diff -urNad xml-light-2.2~/Makefile xml-light-2.2/Makefile --- xml-light-2.2~/Makefile 2006-10-26 00:22:41.000000000 +0200 +++ xml-light-2.2/Makefile 2006-10-26 00:24:45.000000000 +0200 @@ -3,8 +3,8 @@ .SUFFIXES : .ml .mli .cmo .cmx .cmi .mll .mly INSTALLDIR=`ocamlc -where` -CFLAGS= -LFLAGS= -a +XML_LIGHT_OCAML_CFLAGS= $(OCAML_CFLAGS) +XML_LIGHT_OCAML_LFLAGS= $(OCAML_LFLAGS) -a LIBS= all: xml-light.cma test.exe doc @@ -28,10 +28,10 @@ ocamlopt xml-light.cmxa test.ml -o test_opt.exe xml-light.cma: xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo - ocamlc -o xml-light.cma $(LFLAGS) $(LIBS) xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo + ocamlc -o xml-light.cma $(XML_LIGHT_OCAML_LFLAGS) $(LIBS) xml_parser.cmo xml_lexer.cmo dtd.cmo xmlParser.cmo xml.cmo xml-light.cmxa: xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx - ocamlopt -o xml-light.cmxa $(LFLAGS) $(LIBS) xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx + ocamlopt -o xml-light.cmxa $(XML_LIGHT_OCAML_LFLAGS) $(LIBS) xml_parser.cmx xml_lexer.cmx dtd.cmx xmlParser.cmx xml.cmx dtd.cmo: xml.cmi xml_lexer.cmi dtd.cmi @@ -71,13 +71,13 @@ # SUFFIXES .ml.cmo: - ocamlc $(CFLAGS) -c $< + ocamlc $(XML_LIGHT_OCAML_CFLAGS) -c $< .ml.cmx: - ocamlopt $(CFLAGS) -c $< + ocamlopt $(XML_LIGHT_OCAML_CFLAGS) -c $< .mli.cmi: - ocamlc $(CFLAGS) $< + ocamlc $(XML_LIGHT_OCAML_CFLAGS) $< .mll.ml: ocamllex $< debian/patches/02_cmi_depends.diff0000755000000000000000000000043312174411320014220 0ustar diff -urNad xml-light-2.2~/Makefile xml-light-2.2/Makefile --- xml-light-2.2~/Makefile 2006-01-03 17:34:23.000000000 +0100 +++ xml-light-2.2/Makefile 2006-01-03 17:35:04.000000000 +0100 @@ -82,6 +82,6 @@ .mll.ml: ocamllex $< -.mly.ml: +%.mli %.ml: %.mly ocamlyacc $< debian/patches/04_dtd_trace.diff0000755000000000000000000000107512174411320013704 0ustar diff -urNad xml-light-2.2~/dtd.ml xml-light-2.2/dtd.ml --- xml-light-2.2~/dtd.ml 2005-02-18 10:01:54.000000000 +0100 +++ xml-light-2.2/dtd.ml 2006-10-26 23:22:25.000000000 +0200 @@ -267,7 +267,7 @@ exception TmpResult of dtd_result let prove_child dtd tag = - trace dtd tag; + (*trace dtd tag;*) match dtd.current with | DTDEmpty -> raise (Prove_error EmptyExpected) | DTDAny -> () @@ -505,4 +505,4 @@ sprintf "" tag (etype_to_string etype) ;; -to_string_ref := to_string \ No newline at end of file +to_string_ref := to_string debian/patches/series0000644000000000000000000000016212174411320012024 0ustar 01_installopt.diff 02_cmi_depends.diff 03_cflags.diff 04_dtd_trace.diff 05_cmxs_plugin.diff 06_CVE-2012-3514.diff debian/libxml-light-ocaml-dev.ocamldoc0000644000000000000000000000002312174411320015120 0ustar # dh_ocamldoc file debian/libxml-light-ocaml-dev.examples0000644000000000000000000000001012174411320015151 0ustar test.ml