Skip to content

Commit 1a80998

Browse files
author
Pietro Abate
committed
Fix yaml problem with failures related to essential packages
1 parent 48d2194 commit 1a80998

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

CHANGES

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ dose3 (4.2) UNRELEASED; urgency=low
55
* the new yaml format also drops the architecture suffix in the package and
66
unsat-dependency fields
77
* Add new function Depsolver.is_consistent and Debian.Debcudf.get_real_name
8+
* Expose Diagnostic.request and Diagnostic.result
89
* Update the yaml output of outdated (no more cudf-related cruft in package names)
910
* bump yaml output-version to 1.1
1011

TODO

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
- add test cases for format822 (fielnames in particular)
3+
24
- add --deb-output822 to DistcheckOptions to output 822 package list
35
for distcheck, buildcheck etc of installable packages
46

algo/diagnostic.ml

+6-2
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ let build_explanation_graph ?(addmissing=false) root l =
240240
)
241241
in
242242
let gr = G.create () in
243+
(* we add the root, there might be a problem on related to packages
244+
not related to the root, but failing to install because of a
245+
global constraint (like conflitting essential packages) *)
246+
G.add_vertex gr (add_node root);
243247
let c = ref 0 in
244248
(* remove duplicate dependencies/reasons. XXX with long
245249
list of packages Hashtbl.hash could give wrong results *)
@@ -544,8 +548,8 @@ let print_error ?(condense=false) ?(minimal=false) pp root fmt l =
544548
Format.fprintf fmt "unsat-conflict: %a@]@," (CudfAdd.pp_vpkglist pp) [vpkg];
545549
Format.fprintf fmt "@[<v 1>pkg2:@,%a@]" (pp_package_list ~source:true pp) j;
546550
if not minimal then begin
547-
let (pl1,_) = try DJ.shortest_path gr vroot vi with Not_found -> assert false in
548-
let (pl2,_) = try DJ.shortest_path gr vroot vj with Not_found -> assert false in
551+
let pl1 = try fst(DJ.shortest_path gr vroot vi) with Not_found -> [] in
552+
let pl2 = try fst(DJ.shortest_path gr vroot vj) with Not_found -> [] in
549553
if pl1 <> [] then
550554
Format.fprintf fmt "@,@[<v 1>depchain1:@,%a@]" (pp_dependencies pp) pl1;
551555
if pl2 <> [] then

algo/diagnostic.mli

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
(* library, see the COPYING file for more information. *)
1111
(**************************************************************************************)
1212

13+
(** {2 Un-installability reasons} *)
14+
1315
(** The request provided to the solver *)
1416
type request = Cudf.package list
1517

16-
(** {2 Un-installability reasons} *)
1718
type reason =
1819
|Dependency of (Cudf.package * Cudf_types.vpkg list * Cudf.package list)
1920
(** Not strictly a un-installability, Dependency (a,vpkglist,pkglist) is used
@@ -53,7 +54,8 @@ type result_int =
5354

5455
type request_int = (int option * int list)
5556

56-
(** {2 Helpers Functions } *)
57+
(** {3 Helpers Functions } *)
58+
5759
(** Turn an integer result into a cudf result *)
5860
val diagnosis : Common.Util.projection -> Cudf.universe ->
5961
result_int -> request_int -> diagnosis
@@ -64,6 +66,8 @@ val result : Common.Util.projection -> Cudf.universe -> result_int -> result
6466
(** Turn an integer request into a cudf request *)
6567
val request : Cudf.universe -> 'a * int list -> Cudf.package list
6668

69+
(** {2 Pretty Priting Functions } *)
70+
6771
module ResultHash : Hashtbl.S with type key = reason
6872

6973
(** Collect aggregate information about not installable packages *)

common/cudfAdd.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ val hash : Cudf.package -> int
1616
(** Sort function: sorts a CUDF packages list using the standard CUDF comparison operator in ascending order *)
1717
val sort : Cudf.package list -> Cudf.package list
1818

19-
(** Data structures: *)
19+
(** {2 Data structures} *)
2020

2121
(** Specialized hashtable for CUDF packages. *)
2222
module Cudf_hashtbl : (Hashtbl.S with type key = Cudf.package)

0 commit comments

Comments
 (0)