[Pkg-ocaml-maint-commits] [SCM] pkglab packaging branch, master, updated. debian/1.4.2-1-2-g6bed820

Ralf Treinen treinen at free.fr
Tue Jun 16 18:53:24 UTC 2009


The following commit has been merged in the master branch:
commit bcb5d8e5033579c80c3435d9bbf92bd2af066362
Author: Ralf Treinen <treinen at free.fr>
Date:   Mon Jun 15 20:45:27 2009 +0200

    cleanup -checkonly option

diff --git a/debian/changelog b/debian/changelog
index e3f3273..72dc124 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,8 +7,9 @@ pkglab (1.4.2-1) unstable; urgency=low
     - Add symlinks for /usr/bin/edos-{deb,rpm}check.
     - Replaces, Conflicts and Provides edos-{rpm,deb}check
     - Add manpages for edos-{deb,rpm}check
+  * Patch distcheck/common.ml to accept an -checkonly option
 
- -- Ralf Treinen <treinen at debian.org>  Sun, 14 Jun 2009 18:31:15 +0200
+ -- Ralf Treinen <treinen at debian.org>  Mon, 15 Jun 2009 20:37:38 +0200
 
 pkglab (1.4.1-1) unstable; urgency=low
 
diff --git a/debian/edos-debcheck.1 b/debian/edos-debcheck.1
index 3dc9eff..478718d 100644
--- a/debian/edos-debcheck.1
+++ b/debian/edos-debcheck.1
@@ -42,6 +42,10 @@ actually in Debian.
 
 .SH OPTIONS
 .TP
+.BI -checkonly \ packages
+Check only for the packages whose names are in \fIpackages\fR,
+which is a comma-separated list of packages.
+.TP
 .B -check
 Double-check the results
 .TP
@@ -68,10 +72,10 @@ Check which packages in a particular distribution are not installable and why:
 where Packages is the file pertaining to that distribution, as for instance
 found in the directory \fI	/var/lib/apt/lists\fR.
 
-Check whether version 21.4.17-1 of the xemacs21 package is installable in a
-distribution described by the file Packages:
+Check whether the xemacs21 and the debehelper packages are installable
+in a distribution described by the file Packages:
 
-  edos-debcheck -explain xemacs=21.4.17-1 < Packages
+  edos-debcheck -explain xemacs,debhelper < Packages
 
 
 .SH AUTHOR
diff --git a/distcheck/common.ml b/distcheck/common.ml
index f2c9633..c748ed3 100644
--- a/distcheck/common.ml
+++ b/distcheck/common.ml
@@ -15,8 +15,7 @@ and quiet = ref false
 and output_xml= ref false
 and dist_type = ref `Debian
 and source_added = ref false
-and pkgs_to_check_only = ref Package_set.empty
-and pkgs_to_check_only_set = ref false;;
+and pkgs_to_check_only = ref [];;
 
 let db = create_database ();;
 let architecture_index = get_architecture_index db;;
@@ -57,7 +56,7 @@ begin
 end;;
 
 let unit_name_of u_id =
-	Unit_index.find unit_index u_id;;
+  Unit_index.find unit_index u_id;;
 
 let pkg_name_of p_id = 
 	let (_, pkg) = Package_index.find package_index p_id in
@@ -69,6 +68,10 @@ let pkg_name_of p_id =
 		| None -> ""
 		| Some rn -> "-" ^ rn);;
 
+let myunit_name_of p_id = 
+  let (_, pkg) = Package_index.find package_index p_id in
+    Unit_index.find unit_index pkg.pk_unit 
+
 let pkg_xml_of p_id =
 	let (_, pkg) = Package_index.find package_index p_id in
 	let unit_name = Unit_index.find unit_index pkg.pk_unit 
@@ -96,8 +99,15 @@ begin
 	| Sel_GT v -> Printf.sprintf " (&gt; %s)" (version_string v) 
 end;;
 
-let check () =
-let pkgs_to_check = ref (Package_set.diff (Functions.packages db) !not_to_check) in
+(* the check will be restricte to the packages whose names are in pkgs_only, in case pkgs_to_check_set is true *)
+let check pkgs_only =
+let pkgs_to_check =
+  if !pkgs_to_check_only = [] 
+  then ref (Package_set.diff (Functions.packages db) !not_to_check)
+  else ref (Package_set.filter
+	      (fun p -> List.mem  (myunit_name_of p) pkgs_only)
+	      (Functions.packages db))
+in
 let result_ht = Hashtbl.create (Package_set.cardinal !pkgs_to_check) in
 let progress =
 	if !quiet then Progress.dummy
@@ -193,25 +203,13 @@ begin
 	if !output_xml then print_endline "</results>";
 end;;
 
-let unit_id_of_string u =
-  try
-    Unit_index.search (get_unit_index db) u
-  with
-  | Not_found -> raise (Sorry(sf "Can't find unit %S" u))
-;;
-
-(* set the list of packages to check according to the set of packages denoted by a comma-separated list *)
-let set_pkgs_to_check pkgname =
-  pkgs_to_check_only := Functions.select db (Unit_version ((unit_id_of_string pkgname),Sel_ANY));
-  pkgs_to_check_only_set := true
-;;
-
 let speclist = [
 	("-explain", Set explain_results, "Explain the results");
 	("-failures", Clear show_successes, "Only show failures");
 	("-successes", Clear show_failures, "Only show successes");
-	("-base FILE", String (add_source false), "Additional binary package control file providing packages that are not checked but used for resolving dependencies");
-	("-checkonly LIST", String set_pkgs_to_check, "Check only these packages");
+	("-base", String (add_source false), "Additional binary package control file providing packages that are not checked but used for resolving dependencies");
+	("-checkonly", String (fun s -> pkgs_to_check_only := Util.split_at ',' s),
+	 "Check only these packages");
 	("-quiet", Set quiet, "Do not emit warnings nor progress/timing information");
 	("-xml", Set output_xml, "Output results in XML format");
 	("-", Unit (fun () -> add_source true "-"), "");
@@ -227,4 +225,4 @@ let _ =
 	else (Printf.eprintf "Warning: unknown name '%s', behaving like debcheck\n%!" Sys.argv.(0); dist_type := `Debian);
 	Arg.parse speclist (add_source true) "Distcheck v1.4.1";
   if not !source_added then add_source true "-";
-	show_results (check ());;
+	show_results (check !pkgs_to_check_only);;

-- 
pkglab packaging



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