[libsolv] preliminary fix for JOB resons in solver_describe_decision().

Ales Kozumplik akozumpl at fedoraproject.org
Mon Jul 16 09:54:40 UTC 2012


commit 4e8aed5e08b83c8b892672f1e5858bbbb57be3d1
Author: Ales Kozumplik <ales at redhat.com>
Date:   Mon Jul 16 11:04:08 2012 +0200

    preliminary fix for JOB resons in solver_describe_decision().

 .gitignore                |    1 +
 libsolv-job-reasons.patch |   29 +++++++++++++++++++++++++++++
 libsolv.spec              |    7 ++++++-
 3 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 0f133dd..78984b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
 /libsolv-8cf7650.tar.xz
 /libsolv-d39a42b.tar.xz
 /libsolv-1617994.tar.xz
+/libsolv-1617994.tar.xz
diff --git a/libsolv-job-reasons.patch b/libsolv-job-reasons.patch
new file mode 100644
index 0000000..23986be
--- /dev/null
+++ b/libsolv-job-reasons.patch
@@ -0,0 +1,29 @@
+From 021e309f4f32642b8f53e3c8a162c4af150e269e Mon Sep 17 00:00:00 2001
+From: Ales Kozumplik <ales at redhat.com>
+Date: Tue, 10 Jul 2012 14:07:02 +0200
+Subject: [PATCH] preliminary fix for JOB resons in
+ solver_describe_decision().
+
+This makes the function return SOLVER_REASON_RESOLVE_JOB for some unit
+rules too. Discussion is ongoing with the libsolv upstream whether this is
+a good solution.
+---
+ src/solver.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/solver.c b/src/solver.c
+index 68ff49f..16a0ff8 100644
+--- a/src/solver.c
++++ b/src/solver.c
+@@ -3437,6 +3437,8 @@ solver_describe_decision(Solver *solv, Id p, Id *infop)
+     {
+       if (infop)
+ 	*infop = why;
++      if (why >= solv->jobrules && why < solv->jobrules_end)
++	return SOLVER_REASON_RESOLVE_JOB;
+       return SOLVER_REASON_UNIT_RULE;
+     }
+   why = -why;
+-- 
+1.7.10.2
+
diff --git a/libsolv.spec b/libsolv.spec
index 84c31da..bf419c5 100644
--- a/libsolv.spec
+++ b/libsolv.spec
@@ -7,13 +7,14 @@
 
 Name:		libsolv
 Version:	0.0.0
-Release:	12.git%{gitrev}%{?dist}
+Release:	13.git%{gitrev}%{?dist}
 License:	BSD
 Url:		https://github.com/openSUSE/libsolv
 # git clone https://github.com/openSUSE/libsolv.git
 # git archive %{gitrev} --prefix=libsolv/ | xz > libsolv-%{gitrev}.tar.xz
 Source:		libsolv-%{gitrev}.tar.xz
 Patch0:		libsolv-rubyinclude.patch
+Patch1:		libsolv-job-reasons.patch
 Group:		Development/Libraries
 Summary:	Package dependency solver
 BuildRequires:	cmake libdb-devel expat-devel rpm-devel zlib-devel
@@ -82,6 +83,7 @@ Perl bindings for sat solver.
 %prep
 %setup -q -n libsolv
 %patch0 -p1 -b .rubyinclude
+%patch1 -p1 -b .jobreasons
 
 %build
 %cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@@ -141,6 +143,9 @@ rm $RPM_BUILD_ROOT/usr/bin/testsolv
 %{python_sitearch}/*
 
 %changelog
+* Mon Jul 16 2012 Aleš Kozumplik <akozumpl at redhat.com> - 0.0.0-13.git1617994%{?dist}
+- preliminary fix for JOB resons in solver_describe_decision().
+
 * Sun Jul 1 2012 Aleš Kozumplik <akozumpl at redhat.com> - 0.0.0-12.git1617994%{?dist}
 - Rebase to upstream 1617994.
 - Support for RPM_ADD_WITH_HDRID.


More information about the scm-commits mailing list