When sorting packages also look for virtual packages.
A new function xbps_find_virtual_pkg_in_dict() has been made public to the API to make this find duplicate packages in the transaction when updating packages.
This commit is contained in:
@@ -63,9 +63,14 @@ pkgdep_find(const char *name)
|
||||
{
|
||||
struct pkgdep *pd = NULL;
|
||||
|
||||
TAILQ_FOREACH(pd, &pkgdep_list, pkgdep_entries)
|
||||
TAILQ_FOREACH(pd, &pkgdep_list, pkgdep_entries) {
|
||||
if (strcmp(pd->name, name) == 0)
|
||||
return pd;
|
||||
if (pd->d == NULL)
|
||||
continue;
|
||||
if (xbps_find_virtual_pkg_in_dict(pd->d, name, false))
|
||||
return pd;
|
||||
}
|
||||
|
||||
/* not found */
|
||||
return NULL;
|
||||
@@ -80,6 +85,10 @@ pkgdep_find_idx(const char *name)
|
||||
TAILQ_FOREACH(pd, &pkgdep_list, pkgdep_entries) {
|
||||
if (strcmp(pd->name, name) == 0)
|
||||
return idx;
|
||||
if (pd->d == NULL)
|
||||
continue;
|
||||
if (xbps_find_virtual_pkg_in_dict(pd->d, name, false))
|
||||
return idx;
|
||||
|
||||
idx++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user