--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: ben: please allow to specify affected, good and bad packages on the command line
- From: Johannes Schauer <j.schauer@email.de>
- Date: Mon, 12 May 2014 17:48:41 +0200
- Message-id: <20140512154841.5096.8328.reportbug@hoothoot>
Package: ben
Version: 0.6.11
Severity: wishlist
Tags: patch
Hi,
the "monitor" subcommand currently requires a configuration file to read
the query strings for affected, good and bad packages. If those values
could be given on the commandline, then I would not have to create a
temporary configuration file anymore.
The attached patch series solves this problem.
cheers, josch
>From 021edc6eb08f9c943fb3e23f4cc5297587d78c70 Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Mon, 12 May 2014 17:15:26 +0200
Subject: [PATCH 1/3] add set_config to benl_clflags
---
lib/benl_clflags.ml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/benl_clflags.ml b/lib/benl_clflags.ml
index ad2ad9f..bfc7b34 100644
--- a/lib/benl_clflags.ml
+++ b/lib/benl_clflags.ml
@@ -49,6 +49,10 @@ let get_config key =
try List.assoc key !config
with Not_found -> raise (Missing_configuration_item key)
+let set_config key value =
+ let cnf = List.remove_assoc key !config in
+ config := (key,value)::cnf
+
let get_cache_file ?(name = !cache_file) () =
if Sys.file_exists name
then name
--
1.9.2
>From fdc9fe6bdec506710238b0c1e14c8858466b890f Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Mon, 12 May 2014 17:45:21 +0200
Subject: [PATCH 2/3] add parse_expression to benl_utils
---
lib/benl_utils.ml | 11 +++++++++++
lib/benl_utils.mli | 2 ++
2 files changed, 13 insertions(+)
diff --git a/lib/benl_utils.ml b/lib/benl_utils.ml
index cb546f9..c899701 100644
--- a/lib/benl_utils.ml
+++ b/lib/benl_utils.ml
@@ -40,6 +40,17 @@ let parse_control_file kind filename keep f accu =
parse_control_in_channel kind base ic keep f accu
end
+let parse_expression expression =
+ let lexbuf = from_string expression in
+ try
+ Benl_parser.full_expr Benl_lexer.token lexbuf
+ with Benl_parser.Error ->
+ let pos = Lexing.lexeme_start_p lexbuf in
+ raise (Parsing_error
+ (pos.pos_fname,
+ pos.pos_lnum,
+ pos.pos_cnum-pos.pos_bol))
+
let parse_config_file filename =
with_in_file filename begin fun ic ->
let lexbuf = from_channel ic in
diff --git a/lib/benl_utils.mli b/lib/benl_utils.mli
index ecde4e0..3aec701 100644
--- a/lib/benl_utils.mli
+++ b/lib/benl_utils.mli
@@ -29,6 +29,8 @@ val parse_control_file :
('a Package.Name.t -> 'a Package.t -> 'b -> 'b) ->
'b -> 'b
+val parse_expression : string -> Benl_types.expr
+
val parse_config_file : string -> Benl_types.config
val file_content : string -> string
--
1.9.2
>From a1f7c765f7d226c5fcd5549d2a2e73f48a991b6b Mon Sep 17 00:00:00 2001
From: josch <j.schauer@email.de>
Date: Mon, 12 May 2014 17:15:50 +0200
Subject: [PATCH 3/3] add --is-affected, --is-good and --is-bad to ben_monitor
---
frontends/ben_monitor.ml | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/frontends/ben_monitor.ml b/frontends/ben_monitor.ml
index 30e8c2d..640bb1d 100644
--- a/frontends/ben_monitor.ml
+++ b/frontends/ben_monitor.ml
@@ -101,6 +101,15 @@ let rec parse_local_args = function
| "--template"::template::xs ->
Benl_templates.load_template template;
parse_local_args xs
+ | "--is-affected"::str::xs ->
+ Benl_clflags.set_config "is_affected" (Benl_utils.parse_expression str);
+ parse_local_args xs
+ | "--is-good"::str::xs ->
+ Benl_clflags.set_config "is_good" (Benl_utils.parse_expression str);
+ parse_local_args xs
+ | "--is-bad"::str::xs ->
+ Benl_clflags.set_config "is_bad" (Benl_utils.parse_expression str);
+ parse_local_args xs
| x::xs -> x::(parse_local_args xs)
| [] -> []
@@ -116,6 +125,9 @@ let help () =
"--html", "Select HTML output format";
"--output|-o", "Select output file";
"--template", "Select an HTML template";
+ "--is-affected", "Criteria of affected packages";
+ "--is-good", "Criteria of a good package";
+ "--is-bad", "Criteria of a bad package";
]
let check_media_dir base =
--
1.9.2
--- End Message ---
--- Begin Message ---
Source: ben
Source-Version: 0.7.0
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 747887@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, 25 Oct 2014 15:59:23 +0200
Source: ben
Binary: libben-ocaml-dev libben-ocaml ben
Architecture: source amd64
Version: 0.7.0
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: 730619 747879 747887 750327
Changes:
ben (0.7.0) unstable; urgency=medium
.
* Add --no-clean to "ben tracker" to leave unknown generated
HTML files.
* "ben tracker" will clean up the HTML directory by default from
now on.
* Add ability to read uncompressed files by specifying "plain",
"no" or "none" as a compression format.
* Remove --output-type from "ben tracker". Support for other output
types didn't exist anyway and is not planned.
* Simplify queries so that processing is, a bit, faster.
* Make templates directory configurable through BEN_TEMPLATES_DIR
environment variable.
* Automatically set correct date and revision when generating refman.
* Bump magic number to BENA0902 because of change in internal format
of cache file. This requires regeneration of .cache files.
* Ben should not define any of the modules exported by its library.
Update the nodefined-map for Ben accordingly.
* Add libocamlnet-ocaml-dev to Build-Depends, needed by Ben_monitor
through usage of Netencoding (Closes: #750327).
* Using -stdin, ben monitor will read its input file from the
standard input (Closes: #747887).
* Document how ben query makes the difference between Packages and
Sources files (Closes: #747879).
* Use Arg module to process CLI arguments.
* Parallelize (using ParMap) ben's processing in all frontends, except
query.
- Add libparmap-ocaml-dev to Build-Depends.
* Use Re.Pcre instead of Pcre in a few places to be able to parallelize
since this requires serializing a few data structures.
* Add a collision detector in ben tracker (Closes: #730619).
* Read and show explanations given by dose-debcheck.
- Add libextlib-ocaml-dev to Build-Depends.
* Suppose no ignored architectures when ignored item is missing in
the configuration file.
Checksums-Sha1:
028b0d2e28e9bf6dde99d28e0f8995209d44e0a4 2121 ben_0.7.0.dsc
fa14032ab77e1da465a379c70365bcfa9ce955eb 63580 ben_0.7.0.tar.xz
6e6fe3893494a2e6491efd7b814f8dbf05f733df 137212 libben-ocaml-dev_0.7.0_amd64.deb
13619a57ec7f5849e8bd11b6e0089df026142361 136220 libben-ocaml_0.7.0_amd64.deb
ce98976aa473825d05d3e3b8e58ea663b0008750 980664 ben_0.7.0_amd64.deb
Checksums-Sha256:
bbaa06642d0167d27adaf055fa8716e46b7acdc975a15601798b8b9d02a69462 2121 ben_0.7.0.dsc
8148177b43866bb4b93f3f7727c36d2ab83ba98ad1baaabd0de14fbb35a55af3 63580 ben_0.7.0.tar.xz
80a48a3c006dd41db267783f16c6fca7ef6c1395733acbdc7195eb0af8ecc51f 137212 libben-ocaml-dev_0.7.0_amd64.deb
81d1cb80721cc285eb562beefe6214104ee8c69d5a12b6f9e73cbf536ab4d6fe 136220 libben-ocaml_0.7.0_amd64.deb
a8970931eac5fe07740107df4492d7a77d20706939dade6ea5e0b9477db961df 980664 ben_0.7.0_amd64.deb
Files:
c72baf3268cf9f4b557e1b88d04d84d2 2121 ocaml optional ben_0.7.0.dsc
d3ebde8868395fbfb4ec1ba5f4b20f09 63580 ocaml optional ben_0.7.0.tar.xz
a737e86f4709d3348e36d157d22a6ca5 137212 ocaml optional libben-ocaml-dev_0.7.0_amd64.deb
f7d69567f7b6d67153fc442248e13c93 136220 ocaml optional libben-ocaml_0.7.0_amd64.deb
173f4e0f6fe28158424992fdca9463af 980664 ocaml optional ben_0.7.0_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAEBCAAGBQJUS7EeAAoJEDO+GgqMLtj/fFsP/ixxkLIup4990amHenJ4b4YM
6veTo3gjHCNYjrhLW56VkWormwzNWegMisTWCnF6++BhdV58K2ZZLoxBEQL1fDyX
vzkAVnI0zXUoE+ELsHPAIxZK4Gu9yEGsxiXQdpOQ9/FgzzmmARlQSahPVprkbSjd
wMBUxFjwklwYM7csEWqhgTSHkP5X+7m04XOAIqsXJ1hBzB26tf4iy04hdbIbuK0C
xTzqbQJ9/s/LwBoVh/sm7iKDgqMdDhvAXu3yqnWqtlGt8b9RUQNtYRUzIrHBvAOr
whpRbbFBMV0ICCZiTEQo8Uv5VjnyznJcXrlQKTLqK4yjHetbYQ7pBJ3ckclqVzjr
IkMZfXrUYuLrKtMoHWEkdU/agv53F9pABv5kU4axHYuYFCnAOz0CR/u7DC6PT0dl
YGTIhWdrlxVv4m6ZqVog0W2bqr2ZFAr0gay3nHfY8R5LLWhoFoSWP3MLmIBEflo7
s3JA9GqwsddME70abD3917JJsow7RJzGid9oNTBa9wA5/E2BKWnM6RiV15fIO+9C
pxb+i8+b43O83/B1+4/y7YscSQfm9hPJBMaft+BIQC3P/OZRPJhmHRBHFYrKiAwy
4syusR8xRo7qGqbLLkShz4Hx3MC0O8KQeRu+ci9B/fW/sRa9FZuMkuV96TIcpwG0
D1avLk8yyUESVt8fpFgq
=RRM9
-----END PGP SIGNATURE-----
--- End Message ---