Skip to content

Commit

Permalink
remove validate.c
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverkurth committed Apr 26, 2022
1 parent b42bf38 commit cf8a27d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 59 deletions.
1 change: 0 additions & 1 deletion client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ add_library(${LIB_TDNF} SHARED
rpmtrans.c
updateinfo.c
utils.c
validate.c
metalink.c
list.c
)
Expand Down
14 changes: 11 additions & 3 deletions client/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1563,6 +1563,17 @@ TDNFResolve(
BAIL_ON_TDNF_ERROR(dwError);
}

if (nAlterType == ALTER_INSTALL ||
nAlterType == ALTER_REINSTALL ||
nAlterType == ALTER_ERASE)
{
if(pTdnf->pArgs->nCmdCount <= 1)
{
dwError = ERROR_TDNF_PACKAGE_REQUIRED;
BAIL_ON_TDNF_ERROR(dwError);
}
}

queue_init(&queueGoal);

if(nAlterType == ALTER_INSTALL || nAlterType == ALTER_REINSTALL)
Expand All @@ -1574,9 +1585,6 @@ TDNFResolve(
dwError = TDNFRefresh(pTdnf);
BAIL_ON_TDNF_ERROR(dwError);

dwError = TDNFValidateCmdArgs(pTdnf);
BAIL_ON_TDNF_ERROR(dwError);

dwError = TDNFAllocateMemory(
pTdnf->pArgs->nCmdCount,
sizeof(char*),
Expand Down
54 changes: 0 additions & 54 deletions client/validate.c

This file was deleted.

2 changes: 1 addition & 1 deletion pytests/tests/test_erase.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def teardown_test(utils):

def test_erase_no_arg(utils):
ret = utils.run(['tdnf', 'erase'])
assert(ret['stderr'][0] == 'Nothing to do.')
assert(ret['retval'] == 1001)


def test_erase_invalid_package(utils):
Expand Down

0 comments on commit cf8a27d

Please sign in to comment.