Browse code

tdnf : Set SOLVER_FLAG_ALLOW_DOWNGRADE to true for downgrade operation.

Change-Id: I0817011ef1a8e873be4cfdf66bceb95057fb75d0
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/4804
Reviewed-by: Dheeraj S Shetty <dheerajs@vmware.com>
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Priyesh Padmavilasom <ppadmavilasom@vmware.com>

Xiaolin Li authored on 2018/02/21 06:49:04
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,13 @@
0
+diff --git a/goal.c b/goal.c2
1
+index 1f197a3..f5b5669 100644
2
+--- a/src/goal.c
3
+@@ -221,6 +221,8 @@ init_solver(HyGoal goal, int flags)
4
+     solver_set_flag(solv, SOLVER_FLAG_BEST_OBEY_POLICY, 1);
5
+     /* support package splits via obsoletes */
6
+     solver_set_flag(solv, SOLVER_FLAG_YUM_OBSOLETES, 1);
7
++    if(goal->actions & HY_DOWNGRADE)
8
++        solver_set_flag(solv, SOLVER_FLAG_ALLOW_DOWNGRADE, 1);
9
+ 
10
+ #if defined(LIBSOLV_FLAG_URPMREORDER)
11
+     /* support urpm-like solution reordering */
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        Hawkey
5 5
 Name:           hawkey
6 6
 Version:        2017.1
7
-Release:        4%{?dist}
7
+Release:        5%{?dist}
8 8
 License:        LGPLv2+
9 9
 URL:            http://fedoraproject.org/wiki/Features/Hawkey
10 10
 Source0:        https://github.com/rpm-software-management/hawkey/archive/%{name}-%{version}.tar.gz
... ...
@@ -13,6 +13,7 @@ Group:          Development/Libraries
13 13
 Vendor:         VMware, Inc.
14 14
 Distribution:   Photon
15 15
 Patch0:         hawkey-corrupt-metadata.patch
16
+Patch1:         hawkey-allow-downgrade-flag.patch
16 17
 BuildRequires:  libsolv-devel
17 18
 BuildRequires:  check
18 19
 BuildRequires:  cmake
... ...
@@ -61,6 +62,7 @@ Python 3 bindings for the hawkey library.
61 61
 %prep
62 62
 %setup -qn hawkey-hawkey-0.6.4-1
63 63
 %patch0 -p1
64
+%patch1 -p1
64 65
 sed -i 's/ADD_SUBDIRECTORY (doc)//' CMakeLists.txt
65 66
 mkdir build
66 67
 mkdir build-py3
... ...
@@ -116,6 +118,8 @@ popd
116 116
 %exclude %{python_sitearch}/*
117 117
 
118 118
 %changelog
119
+*   Thu Feb 15 2018 Xiaolin Li <xiaolinl@vmware.com> 2017.1-5
120
+-   Set SOLVER_FLAG_ALLOW_DOWNGRADE to true for downgrade operation.
119 121
 *   Thu Sep 14 2017 Xiaolin Li <xiaolinl@vmware.com> 2017.1-4
120 122
 -   Fix core dump caused by corrupt metadata (repomd.xml).
121 123
 *   Wed Jun 07 2017 Xiaolin Li <xiaolinl@vmware.com> 2017.1-3
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        dnf/yum equivalent using C libs
5 5
 Name:           tdnf
6 6
 Version:        1.2.2
7
-Release:        2%{?dist}
7
+Release:        3%{?dist}
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10 10
 License:        LGPLv2.1,GPLv2
... ...
@@ -154,6 +154,9 @@ systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
154 154
     %{_libdir}/libtdnfcli.so.*
155 155
 
156 156
 %changelog
157
+*   Thu Feb 15 2018 Xiaolin Li <xiaolinl@vmware.com> 1.2.2-3
158
+-   Bump version after set SOLVER_FLAG_ALLOW_DOWNGRADE to
159
+-   true for downgrade in hawkey.
157 160
 *   Tue Oct 10 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-2
158 161
 -   Fix bug in obsolete protected packages.
159 162
 *   Wed Oct 4 2017 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.2-1