Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2005-04-20 19:40:33 +0000
committerAurelien Foret <aurelien@archlinux.org>2005-04-20 19:40:33 +0000
commit77520f9d43ff94fc491b37f14922bb27408080e3 (patch)
tree62df10bc0047ec4549492471dab9bd60d7d37d09 /lib
parent3ad6393baf3a7c2d8182d871551ba8a24e950a4d (diff)
avoided a call to db_scan()
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/add.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 9ddf70de..64c06dc4 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -141,12 +141,12 @@ int add_prepare(pmtrans_t *trans, pmdb_t *db, PMList **data)
{
PMList *lp;
- *data = NULL;
-
ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1));
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
ASSERT(data != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+ *data = NULL;
+
/* 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);
/* 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
- in fact, there's only a need for "version", "backup" and "reason" fields,
- 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);
+ oldpkg->reason = info->reason;*/
/* pre_upgrade scriptlet */
if(info->scriptlet) {