Added a utilty function to print only if quiet not set
Also print errors irrespective of quiet option
If a non-exisitng package is provided for install/update let's show the
name of the invalid package in error message
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
TDNFGoal() calls TDNFPkgsToExclude() in two places. One of these calls
is from within a loop that calls TDNFAddGoal(). Hoisting this call to
TDNFPkgsToExclude() and passing the ouptput to TDNFAddGoal() prevents
needless calls at each loop iteration.
Signed-off-by: Siddharth Chandrasekaran <csiddharth@vmware.com>
TDNFPrepareAllPackages() forces nAlterType to ALTER_UPGRADE for both
ALTER_UPGRADE and ALTER_UPGRADEALL when --security is passed.
Subsequently, when TDNFGoal() is called, the excludes are skipped from the
job queue in TDNFAddGoal() but are not marked in solver map as excludes
with a call to SolvAddExcludes() as it's gating condition only check for
nAlterType == ALTER_UPGRADEALL.
Fix this by allowing nAlterType == ALTER_UPGRADE to also call
SolvAddExcludes().
Signed-off-by: Siddharth Chandrasekaran <csiddharth@vmware.com>
tdnf check currently has options to skip conflicts & obsoletes.
However it reports error on providers even though the required packages
are available. This will fix that issue by adding an extra check on
providers.
Added a test script for the same
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
Option Added to check command:
------------------------------
--skipconflicts: "tdnf check --skipconflicts" will hide the
conflict problems from the report and display it.
--skipobsoletes: "tdnf check --skipobsoletes" will hide the
obsoletes problems from the report and display it
If both options are given to check command, then it will display
the problems except conflicts and obsoletes problems
Additional Change:
-----------------
* replaced existing getopt_long call with getopt_long_only
Issue with getopt_long:
----------------------
** "tdnf check --sk" , it will parse --sk as --skipconflicts
*** --skip also it will parse as --skipconflicts as it occurs first in list
Fix with getopt_long_only:
-------------------------
** "tdnf check --skip" will give command error
*** --skipc will parse as --skipconflicts
*** --skipo will parse as --skipobsoletes
To differentiate between --skipconflicts and --skipobsoletes
replaced getopt_long with getopt_long_only
Testing:
-------
1) Added check.at under tests directory for "make check"
2) Executed TDNF tests to verify the changes
3) Executed PMD tests to verify the chnages
Change-Id: I8055d0ea3de6d46f80b7d6c8144f2637413ae917
--security option is used to filter out the packages which have
the updates of security type.
--sec-severity option is used to filter out the packages which
has the update of type security and has a CVSS score greater than
the value mentioned in the opion value.
Change-Id: Ic83dd6fdb39d9037d303c69622de57a17c5751d8