Browse code

fix bug in tdnf download status type

Change-Id: Ifb168cfcf11749f74f1217c102bfb97f3449995e
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5696
Reviewed-by: Anish Swaminathan <anishs@vmware.com>
Tested-by: Anish Swaminathan <anishs@vmware.com>

Priyesh Padmavilasom authored on 2018/09/15 08:13:56
Showing 2 changed files
... ...
@@ -4,7 +4,7 @@
4 4
 Summary:        dnf/yum equivalent using C libs
5 5
 Name:           tdnf
6 6
 Version:        1.2.3
7
-Release:        3%{?dist}
7
+Release:        4%{?dist}
8 8
 Vendor:         VMware, Inc.
9 9
 Distribution:   Photon
10 10
 License:        LGPLv2.1,GPLv2
... ...
@@ -28,6 +28,7 @@ Source2:        cache-updateinfo.service
28 28
 Source3:        cache-updateinfo.timer
29 29
 Source4:        updateinfo.sh
30 30
 Patch0:         tdnf_add_retry_to_downloads.patch
31
+Patch1:         tdnf_fix_curl_getinfo_type.patch
31 32
 
32 33
 %description
33 34
 tdnf is a yum/dnf equivalent
... ...
@@ -52,6 +53,7 @@ Library providing cli libs for tdnf like clients.
52 52
 %prep
53 53
 %setup -q
54 54
 %patch0 -p1
55
+%patch1 -p1
55 56
 
56 57
 %build
57 58
 sed -i 's/tdnf, 1.2.0/tdnf, 1.2.3/' configure.ac
... ...
@@ -153,6 +155,8 @@ systemctl try-restart tdnf-cache-updateinfo.timer >/dev/null 2>&1 || :
153 153
     %{_libdir}/libtdnfcli.so.*
154 154
 
155 155
 %changelog
156
+*   Fri Sep 14 2018 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.3-4
157
+-   fix bug in download status type
156 158
 *   Wed Sep 12 2018 Priyesh Padmavilasom <ppadmavilasom@vmware.com> 1.2.3-3
157 159
 -   retry option for downloads. default retry on download failures to 10
158 160
 *   Fri Apr 27 2018 Xiaolin Li <xiaolinl@vmware.com> 1.2.3-2
159 161
new file mode 100644
... ...
@@ -0,0 +1,22 @@
0
+diff --git a/client/remoterepo.c b/client/remoterepo.c
1
+index 94d5e33..7829722 100644
2
+--- a/client/remoterepo.c
3
+@@ -99,7 +99,7 @@ _TDNFDownloadFile(
4
+     CURL *pCurl = NULL;
5
+     FILE *fp = NULL;
6
+     char *pszUserPass = NULL;
7
+-    uint32_t nStatus = 0;
8
++    long nStatus = 0;
9
+ 
10
+     if(!pTdnf ||
11
+        !pTdnf->pArgs ||
12
+@@ -169,7 +169,7 @@ _TDNFDownloadFile(
13
+     if(nStatus >= 400)
14
+     {
15
+         fprintf(stderr,
16
+-                "Error: %d when downloading %s\n. Please check repo url.\n",
17
++                "Error: %ld when downloading %s\n. Please check repo url.\n",
18
+                 nStatus,
19
+                 pszFileUrl);
20
+         dwError = ERROR_TDNF_INVALID_PARAMETER;