Skip to content

Commit

Permalink
Merge pull request #443 from oliverkurth/topic/okurth/minor-annoyances
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
oliverkurth committed Aug 2, 2023
2 parents c68ff28 + 05b8e4e commit 433c34b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
9 changes: 7 additions & 2 deletions client/remoterepo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down Expand Up @@ -215,6 +216,7 @@ TDNFDownloadFile(
{
dwError = set_progress_cb(pCurl, pszProgressData);
BAIL_ON_TDNF_ERROR(dwError);
nNoOutput = 0;
}
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -405,8 +412,6 @@ TDNFDownloadPackage(
}
BAIL_ON_TDNF_ERROR(dwError);

pr_info("\n");

cleanup:
TDNF_SAFE_FREE_MEMORY(pszCopyOfPackageLocation);
TDNF_SAFE_FREE_MEMORY(pszPackageFile);
Expand Down
10 changes: 5 additions & 5 deletions pytests/tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
1 change: 1 addition & 0 deletions solv/tdnfquery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions tools/cli/lib/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ TDNFCliListPackagesPrint(
if(snprintf(
szNameAndArch,
MAX_COL_LEN,
"%s.%s",
"%s.%s ",
pPkg->pszName,
pPkg->pszArch) < 0)
{
Expand All @@ -199,7 +199,7 @@ TDNFCliListPackagesPrint(
if(snprintf(
szVersionAndRelease,
MAX_COL_LEN,
"%s-%s",
"%s-%s ",
pPkg->pszVersion,
pPkg->pszRelease) < 0)
{
Expand Down

0 comments on commit 433c34b

Please sign in to comment.