avoided a call to db_scan()
This commit is contained in:
parent
3ad6393baf
commit
77520f9d43
1 changed files with 7 additions and 6 deletions
|
@ -141,12 +141,12 @@ int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
|
||||||
{
|
{
|
||||||
PMList *lp;
|
PMList *lp;
|
||||||
|
|
||||||
*data = NULL;
|
|
||||||
|
|
||||||
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
|
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
|
||||||
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
|
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
|
||||||
ASSERT(data != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
|
ASSERT(data != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
|
||||||
|
|
||||||
|
*data = NULL;
|
||||||
|
|
||||||
/* Check dependencies
|
/* Check dependencies
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -272,11 +272,12 @@ int add_commit(pmtrans_t *trans, pmdb_t *db)
|
||||||
_alpm_log(PM_LOG_FLOW1, "upgrading package %s-%s", info->name, info->version);
|
_alpm_log(PM_LOG_FLOW1, "upgrading package %s-%s", info->name, info->version);
|
||||||
|
|
||||||
/* we'll need the full record for backup checks later */
|
/* we'll need the full record for backup checks later */
|
||||||
|
oldpkg = pkg_new();
|
||||||
|
STRNCPY(oldpkg->name, info->name, PKG_NAME_LEN);
|
||||||
|
STRNCPY(oldpkg->version, info->version, PKG_VERSION_LEN);
|
||||||
|
oldpkg->backup = _alpm_list_strdup(info->backup);
|
||||||
/* ORE
|
/* ORE
|
||||||
in fact, there's only a need for "version", "backup" and "reason" fields,
|
oldpkg->reason = info->reason;*/
|
||||||
so we should only copy them from the cache, and thus save a call
|
|
||||||
to db_scan(ALL) */
|
|
||||||
oldpkg = db_scan(db, info->name, INFRQ_ALL);
|
|
||||||
|
|
||||||
/* pre_upgrade scriptlet */
|
/* pre_upgrade scriptlet */
|
||||||
if(info->scriptlet) {
|
if(info->scriptlet) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue