[Pkg-ocaml-maint-commits] [SCM] pkglab packaging branch, master, updated. debian/1.4.2-9-3-gbcb49d9

Ralf Treinen treinen at free.fr
Mon Apr 19 21:04:53 UTC 2010


The following commit has been merged in the master branch:
commit add7fe893633b1197f22b619a06e5734efa76850
Author: Ralf Treinen <treinen at free.fr>
Date:   Sun Mar 21 12:37:12 2010 +0100

    escape xml characters in version numbers

diff --git a/debian/changelog b/debian/changelog
index 8b2d63d..997bd78 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,8 +6,11 @@ pkglab (1.4.2-9) UNRELEASED; urgency=low
   * Do not use asterisk to start an entry in edos-distheck.NEWS
   * add-soucrces.py: Print correctly stanzas containing non-ascii
     characters (Patch provided by Zack - thanks!)
+  * distcheck/common.ml: escape < and > in version numbers in order to
+    produce valid xml output even when the Packages file contains rubbish
+    version numbers.
 
- -- Ralf Treinen <treinen at debian.org>  Sat, 20 Mar 2010 09:21:58 +0100
+ -- Ralf Treinen <treinen at debian.org>  Sun, 21 Mar 2010 12:36:53 +0100
 
 pkglab (1.4.2-8) unstable; urgency=low
 
diff --git a/debian/contrib/add-sources.py b/debian/contrib/add-sources.py
index 8172ead..e9f41f2 100755
--- a/debian/contrib/add-sources.py
+++ b/debian/contrib/add-sources.py
@@ -21,7 +21,6 @@ buildessentials = ['apt', 'binutils', 'cpio', 'cpp', 'dpkg-dev',
                    'g++', 'gcc', 'libc6-dev', 'make', 'patch',
                    'perl', 'perl-modules']
 
-
 import string
 import sys
 
diff --git a/distcheck/Makefile b/distcheck/Makefile
index 15e0899..90d25ae 100644
--- a/distcheck/Makefile
+++ b/distcheck/Makefile
@@ -4,7 +4,7 @@ SRCS=	common.ml
 OBJS= $(SRCS:.ml=.cmo)
 XBJS=	$(SRCS:.ml=.cmx)
 
-PACKAGES=	dose2.packetology,dose2.rapids
+PACKAGES=	dose2.packetology,dose2.rapids,str
 
 OCAMLC=		ocamlfind ocamlc -package $(PACKAGES)
 OCAMLOPT=	ocamlfind ocamlopt -package $(PACKAGES)
diff --git a/distcheck/common.ml b/distcheck/common.ml
index f1a4ced..17e04e9 100644
--- a/distcheck/common.ml
+++ b/distcheck/common.ml
@@ -7,6 +7,7 @@ open Diagnosis
 open Napkin
 open Rapids
 open Waterway
+open Str
 
 let show_successes = ref true
 and show_failures = ref true
@@ -125,6 +126,12 @@ let pkg_xml_of p_id =
 		| None -> ""
 		| Some rn -> "-" ^ rn);;
 
+(* xmlesc escapes some special caracters into XML *)
+let xmlesc s =
+  global_replace (regexp_string ">") "&gt;"
+    (global replace (regexp_string "<")y "&lt; s)
+;;
+
 let spec_string s =
   let version_string (v, r) =
     let vn = Version_index.get_version v
@@ -134,11 +141,11 @@ let spec_string s =
     then
       match s with
 	| Sel_ANY -> ""
-	| Sel_LT v -> Printf.sprintf " (&lt; %s)" (version_string v) 
-	| Sel_LEQ v -> Printf.sprintf " (&lt;= %s)" (version_string v) 
-	| Sel_EQ v -> Printf.sprintf " (= %s)" (version_string v) 
-	| Sel_GEQ v -> Printf.sprintf " (&gt;= %s)" (version_string v) 
-	| Sel_GT v -> Printf.sprintf " (&gt; %s)"  (version_string v) 
+	| Sel_LT v -> Printf.sprintf " (&lt; %s)" (xmlesc (version_string v)) 
+	| Sel_LEQ v -> Printf.sprintf " (&lt;= %s)" (xmlesc (version_string v))
+	| Sel_EQ v -> Printf.sprintf " (= %s)" (xmlesc (version_string v)) 
+	| Sel_GEQ v -> Printf.sprintf " (&gt;= %s)" (xmlesc (version_string v)) 
+	| Sel_GT v -> Printf.sprintf " (&gt; %s)"  (xmlesc (version_string v)) 
     else
       match s with
 	| Sel_ANY -> ""

-- 
pkglab packaging



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