From 1557467b48b1f431357ebfa62348a3dc20256c5e Mon Sep 17 00:00:00 2001 From: Priyesh Padmavilasom Date: Thu, 14 Jan 2016 18:24:41 +0000 Subject: [PATCH 1/2] Fix error codes for install existing, update-check. Add tests for the same --- client/api.c | 4 ++++ tests/install.at | 10 ++++++++++ tests/testsuite.at | 1 + tests/update.at | 32 ++++++++++++++++++++++++++++++++ tools/cli/installcmd.c | 3 ++- 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/update.at diff --git a/client/api.c b/client/api.c index 5b50005b..099905fc 100644 --- a/client/api.c +++ b/client/api.c @@ -184,6 +184,10 @@ TDNFCheckUpdates( ppszPackageNameSpecs, ppPkgInfo, pdwCount); + if(dwError == ERROR_TDNF_NO_MATCH) + { + dwError = 0; + } cleanup: return dwError; diff --git a/tests/install.at b/tests/install.at index 66301b40..ffc3c17e 100644 --- a/tests/install.at +++ b/tests/install.at @@ -21,6 +21,16 @@ TDNF_CLI_W_CHROOT install tdnf-test-one -y [ignore]) AT_CLEANUP +AT_SETUP([install existing]) +AT_KEYWORDS([install]) +AT_CHECK([ +TDNF_CLI_W_CHROOT install tdnf-test-one -y +], +[0], +[ignore], +[ignore]) +AT_CLEANUP + AT_SETUP([install non existent]) AT_KEYWORDS([install]) AT_CHECK([ diff --git a/tests/testsuite.at b/tests/testsuite.at index 6f8b4362..f632ab90 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -10,3 +10,4 @@ m4_include([version.at]) m4_include([list.at]) m4_include([install.at]) m4_include([erase.at]) +m4_include([update.at]) diff --git a/tests/update.at b/tests/update.at new file mode 100644 index 00000000..165dc392 --- /dev/null +++ b/tests/update.at @@ -0,0 +1,32 @@ +# +# Copyright (C) 2015 VMware, Inc. All Rights Reserved. +# +# Licensed under the GNU Lesser General Public License v2.1 (the "License"); +# you may not use this file except in compliance with the License. The terms +# of the License are located in the COPYING file of this distribution. +# + +AT_BANNER(tdnf update tests) + +AT_SETUP([update check]) +AT_KEYWORDS([update]) +AT_CHECK([ +TDNF_CHROOT_CLEAN +TDNF_CHROOT_INIT +TDNF_BUILD_INSTALL_RPMS +TDNF_CLI_W_CHROOT check-update +], +[0], +[ignore], +[ignore]) +AT_CLEANUP + +AT_SETUP([update all]) +AT_KEYWORDS([update]) +AT_CHECK([ +TDNF_CLI_W_CHROOT update -y +], +[0], +[ignore], +[ignore]) +AT_CLEANUP diff --git a/tools/cli/installcmd.c b/tools/cli/installcmd.c index 691fc523..1ababe6a 100644 --- a/tools/cli/installcmd.c +++ b/tools/cli/installcmd.c @@ -197,7 +197,8 @@ TDNFCliAlterCommand( { dwError = ERROR_TDNF_CLI_NOTHING_TO_DO; //If there are unresolved, error with no match - if(pSolvedPkgInfo->ppszPkgsNotResolved) + if(pSolvedPkgInfo->ppszPkgsNotResolved && + *pSolvedPkgInfo->ppszPkgsNotResolved) { dwError = ERROR_TDNF_NO_MATCH; } From 9c92b3c4f861d252ad408c1813ea1aaf9a1f62d3 Mon Sep 17 00:00:00 2001 From: Priyesh Padmavilasom Date: Fri, 15 Jan 2016 04:04:11 +0000 Subject: [PATCH 2/2] update version to 1.0.7 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5c061530..bbad1a1e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(tdnf, 1.0.6) +AC_INIT(tdnf, 1.0.7) AC_MSG_NOTICE([tdnf configuration]) AC_CANONICAL_SYSTEM