Browse code

tdnf: Fix to address issues when no repos are enabled.

Change-Id: I73d828de29a697d7eae1ef4ef41dae497db4e80e
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6720
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Keerthana K <keerthanak@vmware.com>

Keerthana K authored on 2019/02/14 18:24:06
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,36 @@
0
+From 355b46fb6f1d850f264f7554bef39df56791d18c Mon Sep 17 00:00:00 2001
1
+From: Keerthana K <keerthanak@vmware.com>
2
+Date: Mon, 11 Feb 2019 09:59:55 +0000
3
+Subject: [PATCH] Fix to address errors when no repos are enabled.
4
+
5
+pool_createwhatprovides is moved to InitSack() from InitRepo().
6
+When no repos are enabled createwhatprovides is not set due to which
7
+commands fail.
8
+
9
+Change-Id: I3fc15022a9e6bfbcaec88c62343c856dba873861
10
+---
11
+
12
+diff --git a/solv/tdnfpool.c b/solv/tdnfpool.c
13
+index 65bdce1..b22de1d 100644
14
+--- a/solv/tdnfpool.c
15
+@@ -113,6 +113,7 @@
16
+     BAIL_ON_TDNF_LIBSOLV_ERROR(dwError);
17
+ 
18
+     pool_set_installed(pPool, pRepo);
19
++    pool_createwhatprovides(pPool);
20
+ 
21
+     pSack->pPool = pPool;
22
+     *ppSack = pSack;
23
+diff --git a/solv/tdnfquery.c b/solv/tdnfquery.c
24
+index b4eb9a9..a75276f 100644
25
+--- a/solv/tdnfquery.c
26
+@@ -815,7 +815,6 @@
27
+     queue_init(&queueSel);
28
+     queue_init(&queueResult);
29
+     pPool = pQuery->pSack->pPool;
30
+-    pool_createwhatprovides(pPool);
31
+ 
32
+     for(nIndex = dwStartIndex; nIndex < dwEndIndex; nIndex++)
33
+     {
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        dnf/yum equivalent using C libs
5 5
 Name:           tdnf
6 6
 Version:        2.0.0
7
-Release:        6%{?dist}
7
+Release:        7%{?dist}
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10 10
 License:        LGPLv2.1,GPLv2
... ...
@@ -38,6 +38,7 @@ Patch2:         tdnf-list-available.patch
38 38
 Patch3:         tdnf-updateinfo-cmd-updates.patch
39 39
 Patch4:         tdnf-fix-mem-leak.patch
40 40
 Patch5:         tdnf-fix-curl-status-type.patch
41
+Patch6:         tdnf-fix-error-no-repo.patch
41 42
 
42 43
 %description
43 44
 tdnf is a yum/dnf equivalent which uses libsolv and libcurl
... ...
@@ -66,6 +67,7 @@ Library providing cli libs for tdnf like clients.
66 66
 %patch3 -p1
67 67
 %patch4 -p1
68 68
 %patch5 -p1
69
+%patch6 -p1
69 70
 
70 71
 %build
71 72
 autoreconf -i
... ...
@@ -166,6 +168,8 @@ systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
166 166
     %{_libdir}/libtdnfcli.so.*
167 167
 
168 168
 %changelog
169
+*   Thu Feb 14 2019 Keerthana K <keerthanak@vmware.com> 2.0.0-7
170
+-   Fix to address issues when no repos are enabled.
169 171
 *   Wed Jan 23 2019 Keerthana K <keerthanak@vmware.com> 2.0.0-6
170 172
 -   Fix Memory leak and curl status type.
171 173
 *   Wed Jan 02 2019 Keerthana K <keerthanak@vmware.com> 2.0.0-5