This is an automated email from the git hooks/post-receive script.

josch pushed a commit to branch master
in repository dose3.

commit a042fb5717adc4aa103881e8325364dfdd4dbcf6
Author: Johannes Schauer <jo...@debian.org>
Date:   Thu Sep 8 23:01:41 2016 +0200

    Add patches 0001-check_request_using-can-return-discording-result-bet.patch 
and 0002-tentative-fix-for-missing-essential-problem-apt-cudf.patch
---
 debian/changelog                                   |   5 +
 ...st_using-can-return-discording-result-bet.patch |  47 ++++++++
 ...ix-for-missing-essential-problem-apt-cudf.patch | 132 +++++++++++++++++++++
 debian/patches/series                              |   2 +
 4 files changed, 186 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index d1475c3..47d92d9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,11 @@ dose3 (5.0.1-1) UNRELEASED; urgency=medium
   * new upstream release
   * remove patches distcheck-fg-bg and getrealname as they have been
     incorporated upstream
+  * backport patches
+    0001-check_request_using-can-return-discording-result-bet.patch and
+    0002-tentative-fix-for-missing-essential-problem-apt-cudf.patch from
+    upstream git to fix missing Essential:yes packages when invoking external
+    solvers
 
  -- Johannes Schauer <jo...@debian.org>  Thu, 08 Sep 2016 22:50:19 +0200
 
diff --git 
a/debian/patches/0001-check_request_using-can-return-discording-result-bet.patch
 
b/debian/patches/0001-check_request_using-can-return-discording-result-bet.patch
new file mode 100644
index 0000000..3ede757
--- /dev/null
+++ 
b/debian/patches/0001-check_request_using-can-return-discording-result-bet.patch
@@ -0,0 +1,47 @@
+From 4f355af62b6fed07d077f1f52b9762af092b79b9 Mon Sep 17 00:00:00 2001
+From: Pietro Abate <pietro.ab...@pps.univ-paris-diderot.fr>
+Date: Tue, 6 Sep 2016 14:09:50 +0200
+Subject: [PATCH 1/2] check_request_using can return discording result between
+ internal and external solver
+
+---
+ algo/depsolver.ml | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/algo/depsolver.ml b/algo/depsolver.ml
+index 2f05f51..a3d2f44 100644
+--- a/algo/depsolver.ml
++++ b/algo/depsolver.ml
+@@ -463,19 +463,24 @@ let check_request_using
+     let universe = Cudf.load_universe (dummy::pkglist) in
+     (dummy,edos_install universe dummy)
+   in
+-  match call_solver with
+-  | None ->
+-    let (dummy,d) = intSolver universe request in
++  let callIntSolver ?(explain=false) (universe,request) =
++    let (dummy,d) = intSolver ~explain universe request in
+     if Diagnostic.is_solution d then
+       let is = List.remove (Diagnostic.get_installationset d) dummy in
+       Sat (Some pre,Cudf.load_universe is)
+     else
+       if explain then Unsat (Some d) else Unsat None
++  in
++  match call_solver with
++  | None -> callIntSolver (universe,request)
+   | Some call_solver ->
+     try Sat(call_solver (pre,universe,request)) with
+     |CudfSolver.Unsat when not explain -> Unsat None
+-    |CudfSolver.Unsat when explain ->
+-        Unsat (Some (snd(intSolver ~explain universe request)))
++    |CudfSolver.Unsat when explain -> begin
++        let sol = callIntSolver ~explain (universe,request) in
++        match sol with
++        |Sat _ -> warning "External and Internal Solver do not agree." ; sol
++        |_ -> sol end
+     |CudfSolver.Error s -> Error s
+ ;;
+ 
+-- 
+2.9.3
+
diff --git 
a/debian/patches/0002-tentative-fix-for-missing-essential-problem-apt-cudf.patch
 
b/debian/patches/0002-tentative-fix-for-missing-essential-problem-apt-cudf.patch
new file mode 100644
index 0000000..0b013a6
--- /dev/null
+++ 
b/debian/patches/0002-tentative-fix-for-missing-essential-problem-apt-cudf.patch
@@ -0,0 +1,132 @@
+From 64098ce1a7dfec991ccc61f1033f8daf547d1e76 Mon Sep 17 00:00:00 2001
+From: Pietro Abate <pietro.ab...@pps.univ-paris-diderot.fr>
+Date: Tue, 6 Sep 2016 18:17:23 +0200
+Subject: [PATCH 2/2] tentative fix for missing essential problem apt-cudf
+
+---
+ algo/depsolver.ml        | 57 +++++++++++++++++++++++++++++++++---------------
+ applications/apt-cudf.ml | 16 ++++++++++----
+ 2 files changed, 52 insertions(+), 21 deletions(-)
+
+diff --git a/algo/depsolver.ml b/algo/depsolver.ml
+index a3d2f44..52b3762 100644
+--- a/algo/depsolver.ml
++++ b/algo/depsolver.ml
+@@ -431,8 +431,8 @@ let upgrade_constr universe name =
+       in (name,Some(`Geq,p.Cudf.version))
+ 
+ let check_request_using
+-  ?call_solver ?criteria ?(dummy=dummy_request) ?(explain=false) 
(pre,universe,request) =
+-  let intSolver ?(explain=false) universe request =
++  ?call_solver ?criteria ?dummy ?(explain=false) (pre,universe,request) =
++  let add_dummy universe request dummy =
+     let deps = 
+       let il = request.Cudf.install in
+       (* we preserve the user defined constraints, while adding the upgrade 
constraint *)
+@@ -461,27 +461,50 @@ let check_request_using
+     (* XXX it should be possible to add a package to a cudf document ! *)
+     let pkglist = Cudf.get_packages universe in
+     let universe = Cudf.load_universe (dummy::pkglist) in
+-    (dummy,edos_install universe dummy)
++    (universe,dummy)
+   in
+-  let callIntSolver ?(explain=false) (universe,request) =
+-    let (dummy,d) = intSolver ~explain universe request in
++  let remove_dummy ?(explain=false) (dummy,d) =
+     if Diagnostic.is_solution d then
+-      let is = List.remove (Diagnostic.get_installationset d) dummy in
++      let is = List.remove_if (Cudf.(=%) dummy) 
(Diagnostic.get_installationset d) in
+       Sat (Some pre,Cudf.load_universe is)
+     else
+       if explain then Unsat (Some d) else Unsat None
+   in
+-  match call_solver with
+-  | None -> callIntSolver (universe,request)
+-  | Some call_solver ->
+-    try Sat(call_solver (pre,universe,request)) with
+-    |CudfSolver.Unsat when not explain -> Unsat None
+-    |CudfSolver.Unsat when explain -> begin
+-        let sol = callIntSolver ~explain (universe,request) in
+-        match sol with
+-        |Sat _ -> warning "External and Internal Solver do not agree." ; sol
+-        |_ -> sol end
+-    |CudfSolver.Error s -> Error s
++  match call_solver,dummy with
++  |None,None ->
++      let (u,r) = add_dummy universe request dummy_request in
++      remove_dummy (r,edos_install u r)
++  |None,Some dummy ->
++      let (u,r) = add_dummy universe request dummy in
++      remove_dummy (r,edos_install u r)
++  |Some call_solver,None -> begin
++      try
++        let (presol,sol) = call_solver (pre,universe,request) in
++        Sat(presol,sol)
++      with
++      |CudfSolver.Unsat when not explain -> Unsat None
++      |CudfSolver.Unsat when explain ->
++          let (u,r) = add_dummy universe request dummy_request in
++          remove_dummy (r,edos_install u r)
++      end
++  |Some call_solver,Some dummy -> begin
++      let (u,dr) = add_dummy universe request dummy in
++      let dr_constr = (dr.Cudf.package,Some (`Eq,dr.Cudf.version)) in
++      let r = { request with Cudf.install = dr_constr::request.Cudf.install } 
in
++      try
++        let (presol,sol) = call_solver (pre,u,r) in
++        let is = List.remove_if (Cudf.(=%) dr) (Cudf.get_packages sol) in
++        Sat(presol,Cudf.load_universe is)
++      with
++        |CudfSolver.Unsat when not explain -> Unsat None
++        |CudfSolver.Unsat when explain -> begin
++            let (u,r) = add_dummy universe request dummy in
++            match remove_dummy (r,edos_install u r) with
++            |Sat _ as sol ->
++                warning "External and Internal Solver do not agree." ; sol
++            |sol -> sol end
++        |CudfSolver.Error s -> Error s
++      end
+ ;;
+ 
+ (** check if a cudf request is satisfiable. we do not care about
+diff --git a/applications/apt-cudf.ml b/applications/apt-cudf.ml
+index 90b980d..5ab782f 100644
+--- a/applications/apt-cudf.ml
++++ b/applications/apt-cudf.ml
+@@ -98,7 +98,9 @@ let pp_pkg fmt (p,univ) =
+     Format.fprintf fmt "Package: %s\n" pkg#name;
+     Format.fprintf fmt "Version: %s\n" pkg#version;
+     Format.fprintf fmt "Architecture: %s\n" pkg#architecture;
+-  with Not_found -> fatal "apt-cudf internal error"
++  with Not_found -> 
++    fatal "apt-cudf internal error (Not found : %s)"
++      (Printf.sprintf "%s=%d" p.Cudf.package p.Cudf.version)
+ 
+ let pp_pkg_list fmt (l,univ) =
+   try 
+@@ -106,13 +108,19 @@ let pp_pkg_list fmt (l,univ) =
+       String.concat ", "
+       (List.map (fun p ->
+         let pkg = Hashtbl.find univ (p.Cudf.package,p.Cudf.version) in
+-        Printf.sprintf "%s=%s/%s" 
+-        pkg#name 
++        Printf.sprintf "%s=%s/%s"
++        pkg#name
+         pkg#version
+         pkg#architecture
+       ) l)
+     )
+-  with Not_found -> fatal "apt-cudf internal error"
++  with Not_found ->
++    fatal "apt-cudf internal error (Not found : [%s])"
++      (String.concat ", "
++        (List.map (fun p ->
++          Printf.sprintf "%s=%d" p.Cudf.package p.Cudf.version
++        ) l)
++      )
+ ;;
+ 
+ let pp_pkg_list_tran fmt (l,univ) = pp_pkg_list fmt (List.map snd l,univ) ;;
+-- 
+2.9.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 9dceec7..9c1cf73 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,3 @@
 binaries-prefix-edos
+0001-check_request_using-can-return-discording-result-bet.patch
+0002-tentative-fix-for-missing-essential-problem-apt-cudf.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-ocaml-maint/packages/dose3.git

_______________________________________________
Pkg-ocaml-maint-commits mailing list
Pkg-ocaml-maint-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ocaml-maint-commits

Reply via email to