mirror of https://github.com/vmware/tdnf.git
repoquery: add --upgrades option
This commit is contained in:
parent
c1fe2a0779
commit
d6394b165d
|
@ -1390,7 +1390,8 @@ TDNFRepoQuery(
|
|||
BAIL_ON_TDNF_ERROR(dwError);
|
||||
}
|
||||
|
||||
dwError = TDNFApplyScopeFilter(pQuery, SCOPE_ALL);
|
||||
dwError = TDNFApplyScopeFilter(pQuery,
|
||||
pRepoqueryArgs->nUpgrades ? SCOPE_UPGRADES : SCOPE_ALL);
|
||||
BAIL_ON_TDNF_ERROR(dwError);
|
||||
|
||||
if (pRepoqueryArgs->pszSpec)
|
||||
|
|
|
@ -380,6 +380,7 @@ typedef struct _TDNF_REPOQUERY_ARGS
|
|||
int anDeps[REPOQUERY_KEY_COUNT];
|
||||
int nRequiresPre;
|
||||
int nList;
|
||||
int nUpgrades;
|
||||
}TDNF_REPOQUERY_ARGS, *PTDNF_REPOQUERY_ARGS;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -53,6 +53,7 @@ static SetOptArgs OptValTable[] = {
|
|||
{CMDOPT_KEYVALUE, "enhances", "1"},
|
||||
{CMDOPT_KEYVALUE, "requires-pre", "1"},
|
||||
{CMDOPT_KEYVALUE, "list", "1"},
|
||||
{CMDOPT_KEYVALUE, "upgrades", "1"},
|
||||
{CMDOPT_KEYVALUE, "whatdepends", NULL},
|
||||
{CMDOPT_KEYVALUE, "whatprovides", NULL},
|
||||
{CMDOPT_KEYVALUE, "whatobsoletes", NULL},
|
||||
|
@ -143,6 +144,7 @@ static struct option pstOptions[] =
|
|||
{"enhances", no_argument, 0, 0},
|
||||
{"requires-pre", no_argument, 0, 0},
|
||||
{"list", no_argument, 0, 0},
|
||||
{"upgrades", no_argument, 0, 0},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
|
|
|
@ -100,6 +100,10 @@ TDNFCliParseRepoQueryArgs(
|
|||
{
|
||||
pRepoqueryArgs->nList = 1;
|
||||
}
|
||||
else if (strcasecmp(pSetOpt->pszOptName, "upgrades") == 0)
|
||||
{
|
||||
pRepoqueryArgs->nUpgrades = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
|
Loading…
Reference in New Issue