Merge pull request #242 from oliverkurth/topic/okurth/no-fail-on-empty-list

don't fail if 'tdnf list <scope>' is empty unless it's a package spec, fixes issue #94
This commit is contained in:
Oliver Kurth 2021-06-23 11:29:46 -07:00 committed by GitHub
commit 55337af751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 17 deletions

View File

@ -629,20 +629,19 @@ TDNFList(
BAIL_ON_TDNF_ERROR(dwError);
dwError = SolvGetQueryResult(pQuery, &pPkgList);
BAIL_ON_TDNF_ERROR(dwError);
if (dwError == ERROR_TDNF_NO_MATCH && !*ppszPackageNameSpecs)
{
dwError = 0;
}
else if (dwError == 0)
{
dwError = TDNFPopulatePkgInfoArray(
pTdnf->pSack,
pPkgList,
DETAIL_LIST,
&pPkgInfo,
&dwCount);
if (dwError == ERROR_TDNF_NO_MATCH && !*ppszPackageNameSpecs)
{
dwError = 0;
}
BAIL_ON_TDNF_ERROR(dwError);
*ppPkgInfo = pPkgInfo;

View File

@ -53,13 +53,7 @@ def test_list_upgrades(utils):
spkg = utils.config["sglversion_pkgname"]
ret = utils.run([ 'tdnf', 'list', 'upgrades' ])
# TODO Fix this; see issue #94
if ret['retval'] == 1011 or ret['retval'] == 0:
result = True
else:
result = False
assert(result)
assert(ret['retval'] == 0)
utils.run([ 'tdnf', 'install', '-y', '--nogpgcheck', mpkg + '-' + mpkg_version ])
ret = utils.run([ 'tdnf', 'list', 'upgrades', mpkg ])