Search through package provides if no literal matches are found when scanning for targets with -S
This commit is contained in:
parent
25a9e070e8
commit
f3c5f9b4d1
2 changed files with 23 additions and 3 deletions
|
@ -647,7 +647,7 @@ int add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_alpm_log(PM_LOG_DEBUG, "adding '%s' in requiredby field for '%s'", tmpp->name, info->name);
|
_alpm_log(PM_LOG_DEBUG, "adding '%s' in requiredby field for '%s'", info->name, depinfo->name);
|
||||||
depinfo->requiredby = pm_list_add(depinfo->requiredby, strdup(info->name));
|
depinfo->requiredby = pm_list_add(depinfo->requiredby, strdup(info->name));
|
||||||
if(db_write(db, depinfo, INFRQ_DEPENDS)) {
|
if(db_write(db, depinfo, INFRQ_DEPENDS)) {
|
||||||
_alpm_log(PM_LOG_ERROR, "could not update 'requiredby' database entry '%s-%s'",
|
_alpm_log(PM_LOG_ERROR, "could not update 'requiredby' database entry '%s-%s'",
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "deps.h"
|
#include "deps.h"
|
||||||
#include "conflict.h"
|
#include "conflict.h"
|
||||||
|
#include "provide.h"
|
||||||
#include "trans.h"
|
#include "trans.h"
|
||||||
#include "sync.h"
|
#include "sync.h"
|
||||||
#include "versioncmp.h"
|
#include "versioncmp.h"
|
||||||
|
@ -285,8 +286,15 @@ int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *n
|
||||||
if(strcmp(dbs->treename, targline) == 0) {
|
if(strcmp(dbs->treename, targline) == 0) {
|
||||||
spkg = db_get_pkgfromcache(dbs, targ);
|
spkg = db_get_pkgfromcache(dbs, targ);
|
||||||
if(spkg == NULL) {
|
if(spkg == NULL) {
|
||||||
|
/* Search provides */
|
||||||
|
PMList *p = _alpm_db_whatprovides(dbs, targ);
|
||||||
|
if(p == NULL) {
|
||||||
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
|
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
|
||||||
}
|
}
|
||||||
|
spkg = db_get_pkgfromcache(dbs, p->data);
|
||||||
|
p->data = NULL;
|
||||||
|
FREELIST(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -295,12 +303,24 @@ int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *n
|
||||||
pmdb_t *dbs = j->data;
|
pmdb_t *dbs = j->data;
|
||||||
spkg = db_get_pkgfromcache(dbs, targ);
|
spkg = db_get_pkgfromcache(dbs, targ);
|
||||||
}
|
}
|
||||||
|
if(spkg == NULL) {
|
||||||
|
/* Search provides */
|
||||||
|
for(j = dbs_sync; j && !spkg; j = j->next) {
|
||||||
|
pmdb_t *dbs = j->data;
|
||||||
|
PMList *p = _alpm_db_whatprovides(dbs, targ);
|
||||||
|
if(p) {
|
||||||
|
spkg = db_get_pkgfromcache(dbs, p->data);
|
||||||
|
p->data = NULL;
|
||||||
|
FREELIST(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(spkg == NULL) {
|
if(spkg == NULL) {
|
||||||
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
|
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
local = db_get_pkgfromcache(db_local, name);
|
local = db_get_pkgfromcache(db_local, spkg->name);
|
||||||
if(local) {
|
if(local) {
|
||||||
cmp = versioncmp(local->version, spkg->version);
|
cmp = versioncmp(local->version, spkg->version);
|
||||||
if(cmp > 0) {
|
if(cmp > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue