From d9849a8637a75e4e225fe1f4ac554abdd399ccbc Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Mon, 10 Apr 2023 22:24:58 +0000 Subject: [PATCH 1/4] Mandatory space in list output --- tools/cli/lib/api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cli/lib/api.c b/tools/cli/lib/api.c index 0770ad86..ef70b303 100644 --- a/tools/cli/lib/api.c +++ b/tools/cli/lib/api.c @@ -187,7 +187,7 @@ TDNFCliListPackagesPrint( if(snprintf( szNameAndArch, MAX_COL_LEN, - "%s.%s", + "%s.%s ", pPkg->pszName, pPkg->pszArch) < 0) { @@ -199,7 +199,7 @@ TDNFCliListPackagesPrint( if(snprintf( szVersionAndRelease, MAX_COL_LEN, - "%s-%s", + "%s-%s ", pPkg->pszVersion, pPkg->pszRelease) < 0) { From c22627238019dc9f3c0951519ba68e46d850bb11 Mon Sep 17 00:00:00 2001 From: Sam Meluch Date: Thu, 15 Jun 2023 16:14:13 -0700 Subject: [PATCH 2/4] add SELECTION_DOTARCH to solv to restore functionality --- solv/tdnfquery.c | 1 + 1 file changed, 1 insertion(+) diff --git a/solv/tdnfquery.c b/solv/tdnfquery.c index e5d9144b..78b83f47 100644 --- a/solv/tdnfquery.c +++ b/solv/tdnfquery.c @@ -606,6 +606,7 @@ SolvApplyListQuery( SELECTION_PROVIDES | SELECTION_GLOB | /* foo* */ SELECTION_CANON | /* foo-1.2-3.ph4.noarch */ + SELECTION_DOTARCH | /* foo.noarch */ SELECTION_REL; /* foo>=1.2-3 */ if (pQuery->nScope == SCOPE_SOURCE) { From 4968ef95d5d85a397080c70821543ae1c65f2c30 Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Tue, 1 Aug 2023 14:55:37 -0700 Subject: [PATCH 3/4] Supress printing linefeeds when downloading and progress output is disabled, for example when printing to an non-tty. --- client/remoterepo.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/remoterepo.c b/client/remoterepo.c index 60adbb03..fad15b5b 100644 --- a/client/remoterepo.c +++ b/client/remoterepo.c @@ -163,6 +163,7 @@ TDNFDownloadFile( /* lStatus reads CURLINFO_RESPONSE_CODE. Must be long */ long lStatus = 0; int i; + int nNoOutput = 1; /* TDNFFetchRemoteGPGKey sends pszProgressData as NULL */ if(!pTdnf || @@ -215,6 +216,7 @@ TDNFDownloadFile( { dwError = set_progress_cb(pCurl, pszProgressData); BAIL_ON_TDNF_ERROR(dwError); + nNoOutput = 0; } } @@ -253,6 +255,11 @@ TDNFDownloadFile( fclose(fp); fp = NULL; } + /* finish progress line output, + but only if progrees was enabled */ + if (!nNoOutput) { + pr_info("\n"); + } dwError = curl_easy_getinfo(pCurl, CURLINFO_RESPONSE_CODE, @@ -405,8 +412,6 @@ TDNFDownloadPackage( } BAIL_ON_TDNF_ERROR(dwError); - pr_info("\n"); - cleanup: TDNF_SAFE_FREE_MEMORY(pszCopyOfPackageLocation); TDNF_SAFE_FREE_MEMORY(pszPackageFile); From 05b8e4e758b2a80df0a3d821a8df32444cbe4ee8 Mon Sep 17 00:00:00 2001 From: Oliver Kurth Date: Tue, 1 Aug 2023 15:47:43 -0700 Subject: [PATCH 4/4] fix flake8 error 'E721 do not compare types,...' --- pytests/tests/test_json.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pytests/tests/test_json.py b/pytests/tests/test_json.py index 553736a3..8134e6cd 100644 --- a/pytests/tests/test_json.py +++ b/pytests/tests/test_json.py @@ -141,7 +141,7 @@ def test_erase_verbose(utils): def test_check_update(utils): ret = utils.run(['tdnf', '-j', 'check-update']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == list + assert type(d) is list def test_repolist(utils): @@ -160,25 +160,25 @@ def test_repolist(utils): def test_repoquery(utils): ret = utils.run(['tdnf', '-j', 'repoquery']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == list + assert type(d) is list def test_updateinfo(utils): ret = utils.run(['tdnf', '-j', 'updateinfo']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == dict + assert type(d) is dict def test_updateinfo_info(utils): ret = utils.run(['tdnf', '-j', 'updateinfo', '--info']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == list + assert type(d) is list def test_history_info(utils): ret = utils.run(['tdnf', '-j', 'history', '--info']) d = json.loads("\n".join(ret['stdout'])) - assert type(d) == list + assert type(d) is list def test_jsondump(utils):