[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#747883: marked as done (ben: please let "ben monitor" output in a more machine readable format)



Your message dated Fri, 14 Aug 2015 22:48:50 +0000
with message-id <E1ZQNmM-0000Wj-DA@franck.debian.org>
and subject line Bug#747883: fixed in ben 0.7.1
has caused the Debian Bug report #747883,
regarding ben: please let "ben monitor" output in a more machine readable format
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
747883: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=747883
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: ben
Version: 0.6.11
Severity: wishlist
Tags: patch

Hi,

while the Levels and Text format are already quite parsable, it would be
nice if consumers of "ben monitor" output would not have to create a
specific parser for either format or trust in the format not
unexpectedly changing in the future. It would thus be nice if an
existing format like json, yaml, csv or xml could be used. Attached
please find a patch that enables json output.

cheers, josch
>From f1f4462f110161029a886fb14e50504074888a1b Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Mon, 12 May 2014 16:16:53 +0200
Subject: [PATCH] add json support

---
 frontends/ben_monitor.ml | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/frontends/ben_monitor.ml b/frontends/ben_monitor.ml
index 30e8c2d..16bb005 100644
--- a/frontends/ben_monitor.ml
+++ b/frontends/ben_monitor.ml
@@ -30,8 +30,8 @@ let use_colors = ref false
 let output_file = ref None
 let baseurl = ref "file:///.."
 
-type output_type = Text | Xhtml | Levels
-let output_type = ref Levels
+type output_type = Text | Xhtml | Levels | Json
+let output_type = ref Json
 
 let p = Benl_clflags.progress
 let ( // ) = Filename.concat
@@ -92,6 +92,9 @@ let rec parse_local_args = function
   | "--html"::xs ->
       output_type := Xhtml;
       parse_local_args xs
+  | "--json"::xs ->
+      output_type := Json;
+      parse_local_args xs
   | "--use-projectb"::xs ->
       Benl_data.use_projectb := true;
       parse_local_args xs
@@ -114,6 +117,7 @@ let help () =
       "--color", "Color if text output";
       "--text", "Select text output format";
       "--html", "Select HTML output format";
+      "--json", "Select JSON output format";
       "--output|-o", "Select output file";
       "--template", "Select an HTML template";
     ]
@@ -527,6 +531,14 @@ let print_dependency_levels dep_graph rounds =
     end packages
   end rounds
 
+let print_json_monitor rounds = begin
+  printf "[%s]\n%!" begin String.concat "," begin List.map begin fun xs ->
+      let packages = List.sort (fun x y -> compare !!!x !!!y) xs in
+      let strpkgs = List.map begin fun src -> "\""^(!!!src)^"\"" end packages in
+      "["^(String.concat "," strpkgs)^"]"
+    end rounds end end
+end
+
 let compute_graph () =
   let {src_map = sources; bin_map = binaries} = get_data is_affected in
   let src_of_bin : ([`binary], [`source] Package.Name.t) M.t =
@@ -548,6 +560,7 @@ let main args =
   match !output_type with
     | Levels -> print_dependency_levels dep_graph rounds
     | Text -> print_text_monitor sources binaries rounds
+    | Json -> print_json_monitor rounds
     | Xhtml ->
       let template = Benl_templates.get_registered_template () in
       let (_, _, _, output) =
-- 
1.9.2


--- End Message ---
--- Begin Message ---
Source: ben
Source-Version: 0.7.1

We believe that the bug you reported is fixed in the latest version of
ben, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 747883@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mehdi Dogguy <mehdi@debian.org> (supplier of updated ben package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 15 Aug 2015 00:17:37 +0000
Source: ben
Binary: libben-ocaml-dev libben-ocaml ben
Architecture: source amd64
Version: 0.7.1
Distribution: unstable
Urgency: medium
Maintainer: Debian OCaml Maintainers <debian-ocaml-maint@lists.debian.org>
Changed-By: Mehdi Dogguy <mehdi@debian.org>
Description:
 ben        - toolbox for Debian maintainers
 libben-ocaml - OCaml libraries for Debian maintainers (runtime package)
 libben-ocaml-dev - OCaml libraries for Debian maintainers (development package)
Closes: 747875 747883 792054 795314
Changes:
 ben (0.7.1) unstable; urgency=medium
 .
   [ Paul Wise ]
   * cdn.debian.net has been deprecated, replace it with http.debian.net
 .
   [ Mehdi Dogguy ]
   * Ignore potential errors when deleting lock file
   * Use FileUtil.rm instead of calling /bin/rm
   * Replaces uses of Benl_core.list_iteri with List.iteri, which requires
     OCaml >= 4.0.
   * Call dose-debcheck with --deb-native-arch
   * Make build reproducible (Closes: #792054)
   * Add a note about order of command-line flags in documentation (Closes: #747875)
   * Add Json output format in monitor (Closes: #747883)
   * Drop --text, --xhtml and --color in favor of --output-format|-f
 .
   [ Emilio Pozuelo Monfort ]
   * Fix buildd.debian.org compact links
 .
   [ Simon McVittie ]
   * Add a new Partial category for packages that are both good and bad
     (Closes: #795314).
Checksums-Sha1:
 23270a91b7ff56eb7fd998da2b8e48971c0d697c 2097 ben_0.7.1.dsc
 a245f1c9a8275986c50baa21b4de2e6742ff0c10 84456 ben_0.7.1.tar.xz
 5b2c0107b60084f7ec52004350574b93379d431a 982740 ben_0.7.1_amd64.deb
 38eeacad017bb9aa33cad2ecb6ea193ce923ffd0 137702 libben-ocaml-dev_0.7.1_amd64.deb
 6b383949b2e5538c2492057e79506e5df46b290f 136712 libben-ocaml_0.7.1_amd64.deb
Checksums-Sha256:
 0130ef2d0c4adb566119ff1055dca43c8aba7a5432fed797b6b38f8a0893657b 2097 ben_0.7.1.dsc
 eefb983a9b3f776688ff09854567c97613f5c17640a150808db502b17a770087 84456 ben_0.7.1.tar.xz
 f9e08aa462ceb2861a439cbc7fe77f44bfd247dcdabed769ae23493a09a06a35 982740 ben_0.7.1_amd64.deb
 fc1afe7f31c0ca234c3c04dc87d5f0794cb8948ff5db271a73b0bbdaf50f556f 137702 libben-ocaml-dev_0.7.1_amd64.deb
 12864dbb2ca551e7bb374e7de69e2946aef3819768ac4b708ee95aae66c9c7e2 136712 libben-ocaml_0.7.1_amd64.deb
Files:
 305220a3c24c9a6d8979e2164528f01f 2097 ocaml optional ben_0.7.1.dsc
 265b3ac7402a704bb6fe3aa95eaed497 84456 ocaml optional ben_0.7.1.tar.xz
 4c012e41218a11478338723f5e851107 982740 ocaml optional ben_0.7.1_amd64.deb
 179e9f8300a2586c4a30f5fac31b9639 137702 ocaml optional libben-ocaml-dev_0.7.1_amd64.deb
 6cb8d3901226d25a7f9c34518e264910 136712 ocaml optional libben-ocaml_0.7.1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJVzooPAAoJEDO+GgqMLtj/Y7YQAIaev6H3pJEjFcilYcZjL0G0
s0ZbYUsezKEBmkRMrfUC7oA/WIf4WLruuL5sQ7e8cWv9oPMT+Ux8VdGp8TI/aMEe
p7MDXUHTxRozlNqpPjDF/dUzPcxHyf5IzmqFqoi1UMtctri8J+E0iP5B4AnfOLCa
Lq3yeYIv7MttTmI5Nr/bTpEA7K+3qWC3V5+LES7h6rikA5+8HQVK43BveN+02z8k
D3n57HAbPIGTi5Jan/uriAOQVJiGeyTBZatwnbSe2YxlDxmrhr+WiegQuar/Z+08
+pvnmStC9U55ADxFvndM0pIhmeOCyCQI6/Bfruz3Vd63GCueaXRriT+Y9W0GQzCn
u4UWiwBihyUsI+hiootK/FCEZE8b3uOSVsAFgQWPedAPfqt/vOfQ0SW2MFgxMUtH
5YJi/jLGaJ3wCd2T27yuflhWLdki4eIqpHh9AJ/U+iyeadnIPq8g3gufLuevocWy
iJEpaZ2DWUkU7yGeMgstPQ4ebYFUmBvYuV53sE7/CgUKVIDWX6LlazxdRclndpZ/
nunMulsIh3aIo5NWa4+e8NNOaJ9dOliRsAiqRjmQ4Jp0gbQ+lP5/dk7iUPce/xl4
3msFCziwWbTKSzVc24cbN/zubqmGcbx8cq1Ws2IMDGuTCd1O1owpcUfpl8R5EnTg
wesc2ksvG8fDtlQmigMu
=mCVi
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: