[Pkg-ocaml-maint-commits] r6265 - /trunk/tools/ocaml_transition_monitor/ocaml_transition_monitor.mll

glondu-guest at users.alioth.debian.org glondu-guest at users.alioth.debian.org
Thu Feb 26 14:36:32 UTC 2009


Author: glondu-guest
Date: Thu Feb 26 14:36:32 2009
New Revision: 6265

URL: http://svn.debian.org/wsvn/?sc=1&rev=6265
Log:
Show source versions, and compute a status for them

Modified:
    trunk/tools/ocaml_transition_monitor/ocaml_transition_monitor.mll

Modified: trunk/tools/ocaml_transition_monitor/ocaml_transition_monitor.mll
URL: http://svn.debian.org/wsvn/trunk/tools/ocaml_transition_monitor/ocaml_transition_monitor.mll?rev=6265&op=diff
==============================================================================
--- trunk/tools/ocaml_transition_monitor/ocaml_transition_monitor.mll (original)
+++ trunk/tools/ocaml_transition_monitor/ocaml_transition_monitor.mll Thu Feb 26 14:36:32 2009
@@ -198,10 +198,19 @@
   let a_link href contents =
     a ~a:[a_href (uri_of_string href)] [pcdata contents]
 
+  let source_status xs =
+    let rec aux accu = function
+      | [] -> accu
+      | Up_to_date::_ -> Up_to_date
+      | Outdated::xs -> aux Outdated xs
+      | Unknown::xs -> aux accu xs
+    in aux Unknown xs
+
   let main () =
     let all_binaries = List.map get_arch_status architectures in
+    let sources_map = get_sources () in
     let all_sources = List.sort compare
-      (M.fold (fun k _ accu -> k::accu) (get_sources ()) [])
+      (M.fold (fun k _ accu -> k::accu) sources_map [])
     in
     let status pkg = List.map
       (fun x ->
@@ -211,17 +220,22 @@
     let status = List.map (fun pkg -> (pkg, status pkg)) all_sources in
     let all_sources = List.map
       (fun (pkg, status) -> tr
-         (td [a ~a:[a_href (uri_of_string ("http://packages.qa.debian.org/"^pkg))] [pcdata pkg];
-              br ();
-              small [pcdata "[";
-                     a ~a:[a_href (uri_of_string ("http://buildd.debian.org/~luk/status/package.php?p="^pkg))] [pcdata "buildd"];
-                     pcdata "]";
-                    ]])
-         (List.map (fun x -> let x = string_of_status x in td ~a:[a_class [x]] [pcdata x]) status))
+         (td ~a:[a_class [string_of_status (source_status status)]]
+            [a ~a:[a_href (uri_of_string ("http://packages.qa.debian.org/"^pkg))] [pcdata pkg];
+             br ();
+             small [pcdata (sprintf "(%s)" ((M.find pkg sources_map).sversion))];
+             br ();
+             small [pcdata "[";
+                    a ~a:[a_href (uri_of_string ("http://buildd.debian.org/~luk/status/package.php?p="^pkg))]
+                      [pcdata "buildd"];
+                    pcdata "]";
+                   ]])
+         ((*(td ~a:[a_class [string_of_status (source_status status)]] [pcdata ((M.find pkg sources_map).sversion)])
+          ::*)(List.map (fun x -> let x = string_of_status x in td ~a:[a_class [x]] [pcdata x]) status)))
       status
     in
     let summary = tablex
-      ~thead:(thead (tr (th [pcdata "Source package"]) (List.map (fun arch -> th [pcdata arch]) architectures)) [])
+      ~thead:(thead (tr (th [pcdata "source"]) (List.map (fun arch -> th [pcdata arch]) architectures)) [])
       (match all_sources with x::xs -> tbody x xs | _ -> invalid_arg "there must be at least one package")
       []
     in




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