Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r--lib/libalpm/sync.c146
1 files changed, 73 insertions, 73 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 7f6067ae..cec0b427 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -48,7 +48,7 @@
extern pmhandle_t *handle;
-pmsyncpkg_t *sync_new(int type, pmpkg_t *spkg, void *data)
+pmsyncpkg_t *_alpm_sync_new(int type, pmpkg_t *spkg, void *data)
{
pmsyncpkg_t *sync;
@@ -63,7 +63,7 @@ pmsyncpkg_t *sync_new(int type, pmpkg_t *spkg, void *data)
return(sync);
}
-void sync_free(pmsyncpkg_t *sync)
+void _alpm_sync_free(pmsyncpkg_t *sync)
{
if(sync == NULL) {
return;
@@ -102,7 +102,7 @@ static pmsyncpkg_t *find_pkginsync(char *needle, PMList *haystack)
/* It returns a PMList of packages extracted from the given archive
* (the archive must have been generated by gensync)
*/
-PMList *sync_load_dbarchive(char *archive)
+PMList *_alpm_sync_load_dbarchive(char *archive)
{
PMList *lp = NULL;
DIR *dir = NULL;
@@ -137,22 +137,22 @@ error:
return(NULL);
}
-int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
+int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
{
PMList *i, *j, *k;
/* check for "recommended" package replacements */
_alpm_log(PM_LOG_FLOW1, "checking for package replacements");
for(i = dbs_sync; i; i = i->next) {
- for(j = db_get_pkgcache(i->data); j; j = j->next) {
+ for(j = _alpm_db_get_pkgcache(i->data); j; j = j->next) {
pmpkg_t *spkg = j->data;
for(k = spkg->replaces; k; k = k->next) {
PMList *m;
- for(m = db_get_pkgcache(db_local); m; m = m->next) {
+ for(m = _alpm_db_get_pkgcache(db_local); m; m = m->next) {
pmpkg_t *lpkg = m->data;
if(!strcmp(k->data, lpkg->name)) {
_alpm_log(PM_LOG_DEBUG, "checking replacement '%s' for package '%s'", k->data, spkg->name);
- if(pm_list_is_strin(lpkg->name, handle->ignorepkg)) {
+ if(_alpm_list_is_strin(lpkg->name, handle->ignorepkg)) {
_alpm_log(PM_LOG_WARNING, "%s-%s: ignoring package upgrade (to be replaced by %s-%s)",
lpkg->name, lpkg->version, spkg->name, spkg->version);
} else {
@@ -165,7 +165,7 @@ int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
* the package to replace.
*/
pmsyncpkg_t *sync;
- pmpkg_t *dummy = pkg_new(lpkg->name, NULL);
+ pmpkg_t *dummy = _alpm_pkg_new(lpkg->name, NULL);
if(dummy == NULL) {
pm_errno = PM_ERR_MEMORY;
goto error;
@@ -175,17 +175,17 @@ int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
sync = find_pkginsync(spkg->name, trans->packages);
if(sync) {
/* found it -- just append to the replaces list */
- sync->data = pm_list_add(sync->data, dummy);
+ sync->data = _alpm_list_add(sync->data, dummy);
} else {
/* none found -- enter pkg into the final sync list */
- sync = sync_new(PM_SYNC_TYPE_REPLACE, spkg, NULL);
+ sync = _alpm_sync_new(PM_SYNC_TYPE_REPLACE, spkg, NULL);
if(sync == NULL) {
FREEPKG(dummy);
pm_errno = PM_ERR_MEMORY;
goto error;
}
- sync->data = pm_list_add(NULL, dummy);
- trans->packages = pm_list_add(trans->packages, sync);
+ sync->data = _alpm_list_add(NULL, dummy);
+ trans->packages = _alpm_list_add(trans->packages, sync);
}
_alpm_log(PM_LOG_FLOW2, "%s-%s elected for upgrade (to be replaced by %s-%s)",
lpkg->name, lpkg->version, spkg->name, spkg->version);
@@ -200,7 +200,7 @@ int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
/* match installed packages with the sync dbs and compare versions */
_alpm_log(PM_LOG_FLOW1, "checking for package upgrades");
- for(i = db_get_pkgcache(db_local); i; i = i->next) {
+ for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) {
int cmp;
int replace = 0;
pmpkg_t *local = i->data;
@@ -208,7 +208,7 @@ int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
pmsyncpkg_t *sync;
for(j = dbs_sync; !spkg && j; j = j->next) {
- spkg = db_get_pkgfromcache(j->data, local->name);
+ spkg = _alpm_db_get_pkgfromcache(j->data, local->name);
}
if(spkg == NULL) {
_alpm_log(PM_LOG_DEBUG, "'%s' not found in sync db -- skipping", local->name);
@@ -219,7 +219,7 @@ int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
for(j = trans->packages; j && !replace; j = j->next) {
sync = j->data;
if(sync->type == PM_SYNC_TYPE_REPLACE) {
- if(pkg_isin(spkg->name, sync->data)) {
+ if(_alpm_pkg_isin(spkg->name, sync->data)) {
replace = 1;
}
}
@@ -231,14 +231,14 @@ int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
}
/* compare versions and see if we need to upgrade */
- cmp = versioncmp(local->version, spkg->version);
+ cmp = _alpm_versioncmp(local->version, spkg->version);
if(cmp > 0 && !spkg->force) {
/* local version is newer */
_alpm_log(PM_LOG_WARNING, "%s-%s: local version is newer",
local->name, local->version);
} else if(cmp == 0) {
/* versions are identical */
- } else if(pm_list_is_strin(i->data, handle->ignorepkg)) {
+ } else if(_alpm_list_is_strin(i->data, handle->ignorepkg)) {
/* package should be ignored (IgnorePkg) */
_alpm_log(PM_LOG_WARNING, "%s-%s: ignoring package upgrade (%s)",
local->name, local->version, spkg->version);
@@ -246,14 +246,14 @@ int sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync)
_alpm_log(PM_LOG_FLOW2, "%s-%s elected for upgrade (%s => %s)",
local->name, local->version, local->version, spkg->version);
if(!find_pkginsync(spkg->name, trans->packages)) {
- pmpkg_t *dummy = pkg_new(local->name, local->version);
- sync = sync_new(PM_SYNC_TYPE_UPGRADE, spkg, dummy);
+ pmpkg_t *dummy = _alpm_pkg_new(local->name, local->version);
+ sync = _alpm_sync_new(PM_SYNC_TYPE_UPGRADE, spkg, dummy);
if(sync == NULL) {
FREEPKG(dummy);
pm_errno = PM_ERR_MEMORY;
goto error;
}
- trans->packages = pm_list_add(trans->packages, sync);
+ trans->packages = _alpm_list_add(trans->packages, sync);
} else {
/* spkg->name is already in the packages list -- just ignore it */
}
@@ -266,7 +266,7 @@ error:
return(-1);
}
-int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *name)
+int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *name)
{
char targline[PKG_FULLNAME_LEN];
char *targ;
@@ -288,7 +288,7 @@ int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *n
for(j = dbs_sync; j && !spkg; j = j->next) {
pmdb_t *dbs = j->data;
if(strcmp(dbs->treename, targline) == 0) {
- spkg = db_get_pkgfromcache(dbs, targ);
+ spkg = _alpm_db_get_pkgfromcache(dbs, targ);
if(spkg == NULL) {
/* Search provides */
PMList *p;
@@ -298,7 +298,7 @@ int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *n
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
}
_alpm_log(PM_LOG_DEBUG, "found '%s' as a provision for '%s'", p->data, targ);
- spkg = db_get_pkgfromcache(dbs, p->data);
+ spkg = _alpm_db_get_pkgfromcache(dbs, p->data);
FREELISTPTR(p);
}
}
@@ -307,7 +307,7 @@ int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *n
targ = targline;
for(j = dbs_sync; j && !spkg; j = j->next) {
pmdb_t *dbs = j->data;
- spkg = db_get_pkgfromcache(dbs, targ);
+ spkg = _alpm_db_get_pkgfromcache(dbs, targ);
}
if(spkg == NULL) {
/* Search provides */
@@ -317,7 +317,7 @@ int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *n
PMList *p = _alpm_db_whatprovides(dbs, targ);
if(p) {
_alpm_log(PM_LOG_DEBUG, "found '%s' as a provision for '%s'", p->data, targ);
- spkg = db_get_pkgfromcache(dbs, p->data);
+ spkg = _alpm_db_get_pkgfromcache(dbs, p->data);
FREELISTPTR(p);
}
}
@@ -327,9 +327,9 @@ int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *n
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
}
- local = db_get_pkgfromcache(db_local, spkg->name);
+ local = _alpm_db_get_pkgfromcache(db_local, spkg->name);
if(local) {
- cmp = versioncmp(local->version, spkg->version);
+ cmp = _alpm_versioncmp(local->version, spkg->version);
if(cmp > 0) {
/* local version is newer -- get confirmation before adding */
int resp = 0;
@@ -353,18 +353,18 @@ int sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, char *n
if(!find_pkginsync(spkg->name, trans->packages)) {
pmpkg_t *dummy = NULL;
if(local) {
- dummy = pkg_new(local->name, local->version);
+ dummy = _alpm_pkg_new(local->name, local->version);
if(dummy == NULL) {
RET_ERR(PM_ERR_MEMORY, -1);
}
}
- sync = sync_new(PM_SYNC_TYPE_UPGRADE, spkg, dummy);
+ sync = _alpm_sync_new(PM_SYNC_TYPE_UPGRADE, spkg, dummy);
if(sync == NULL) {
FREEPKG(dummy);
RET_ERR(PM_ERR_MEMORY, -1);
}
_alpm_log(PM_LOG_FLOW2, "adding target '%s' to the transaction set", spkg->name);
- trans->packages = pm_list_add(trans->packages, sync);
+ trans->packages = _alpm_list_add(trans->packages, sync);
}
return(0);
@@ -377,7 +377,7 @@ static int ptr_cmp(const void *s1, const void *s2)
return(strcmp(((pmsyncpkg_t *)s1)->pkg->name, ((pmsyncpkg_t *)s2)->pkg->name));
}
-int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **data)
+int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **data)
{
PMList *deps = NULL;
PMList *list = NULL; /* list allowing checkdeps usage with data from trans->packages */
@@ -395,7 +395,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
for(i = trans->packages; i; i = i->next) {
pmsyncpkg_t *sync = i->data;
- list = pm_list_add(list, sync->pkg);
+ list = _alpm_list_add(list, sync->pkg);
}
trail = _alpm_list_new();
@@ -404,7 +404,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
_alpm_log(PM_LOG_FLOW1, "resolving targets dependencies");
for(i = trans->packages; i; i = i->next) {
pmpkg_t *spkg = ((pmsyncpkg_t *)i->data)->pkg;
- if(resolvedeps(db_local, dbs_sync, spkg, list, trail, trans, data) == -1) {
+ if(_alpm_resolvedeps(db_local, dbs_sync, spkg, list, trail, trans, data) == -1) {
/* pm_errno is set by resolvedeps */
goto error;
}
@@ -413,11 +413,11 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
/* add the dependencies found by resolvedeps to the transaction set */
pmpkg_t *spkg = i->data;
if(!find_pkginsync(spkg->name, trans->packages)) {
- pmsyncpkg_t *sync = sync_new(PM_SYNC_TYPE_DEPEND, spkg, NULL);
+ pmsyncpkg_t *sync = _alpm_sync_new(PM_SYNC_TYPE_DEPEND, spkg, NULL);
if(sync == NULL) {
goto error;
}
- trans->packages = pm_list_add(trans->packages, sync);
+ trans->packages = _alpm_list_add(trans->packages, sync);
_alpm_log(PM_LOG_FLOW2, "adding package %s-%s to the transaction targets",
spkg->name, spkg->version);
}
@@ -428,7 +428,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL);
_alpm_log(PM_LOG_FLOW1, "looking for unresolvable dependencies");
- deps = checkdeps(db_local, PM_TRANS_TYPE_UPGRADE, list);
+ deps = _alpm_checkdeps(db_local, PM_TRANS_TYPE_UPGRADE, list);
if(deps) {
if(data) {
*data = deps;
@@ -440,7 +440,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
/* no unresolvable deps, so look for conflicts */
_alpm_log(PM_LOG_FLOW1, "looking for conflicts");
- deps = checkconflicts(db_local, list);
+ deps = _alpm_checkconflicts(db_local, list);
if(deps) {
int errorout = 0;
@@ -459,7 +459,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
for(j = trans->packages; j && !found; j = j->next) {
sync = j->data;
if(sync->type == PM_SYNC_TYPE_REPLACE) {
- if(pkg_isin(miss->depend.name, sync->data)) {
+ if(_alpm_pkg_isin(miss->depend.name, sync->data)) {
found = 1;
}
}
@@ -471,11 +471,11 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
}
sync = find_pkginsync(miss->target, trans->packages);
- local = db_get_pkgfromcache(db_local, miss->depend.name);
+ local = _alpm_db_get_pkgfromcache(db_local, miss->depend.name);
/* check if this package also "provides" the package it's conflicting with
*/
- if(pm_list_is_strin(miss->depend.name, sync->pkg->provides)) {
+ if(_alpm_list_is_strin(miss->depend.name, sync->pkg->provides)) {
/* so just treat it like a "replaces" item so the REQUIREDBY
* fields are inherited properly.
*/
@@ -499,8 +499,8 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
/* figure out which one was requested in targets. If they both were,
* then it's still an unresolvable conflict. */
- target = pm_list_is_strin(miss->target, trans->targets);
- depend = pm_list_is_strin(miss->depend.name, trans->targets);
+ target = _alpm_list_is_strin(miss->target, trans->targets);
+ depend = _alpm_list_is_strin(miss->depend.name, trans->targets);
if(depend && !target) {
_alpm_log(PM_LOG_DEBUG, "'%s' is in the target list -- keeping it",
miss->depend.name);
@@ -530,12 +530,12 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
_alpm_log(PM_LOG_DEBUG, "resolving package '%s' conflict", miss->target);
if(local) {
int doremove = 0;
- if(!pm_list_is_strin(miss->depend.name, asked)) {
+ if(!_alpm_list_is_strin(miss->depend.name, asked)) {
QUESTION(trans, PM_TRANS_CONV_CONFLICT_PKG, miss->target, miss->depend.name, NULL, &doremove);
- asked = pm_list_add(asked, strdup(miss->depend.name));
+ asked = _alpm_list_add(asked, strdup(miss->depend.name));
if(doremove) {
pmsyncpkg_t *rsync = find_pkginsync(miss->depend.name, trans->packages);
- pmpkg_t *q = pkg_new(miss->depend.name, NULL);
+ pmpkg_t *q = _alpm_pkg_new(miss->depend.name, NULL);
if(q == NULL) {
if(data) {
FREELIST(*data);
@@ -550,7 +550,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
}
/* append to the replaces list */
_alpm_log(PM_LOG_FLOW2, "electing '%s' for removal", miss->depend.name);
- sync->data = pm_list_add(sync->data, q);
+ sync->data = _alpm_list_add(sync->data, q);
if(rsync) {
/* remove it from the target list */
pmsyncpkg_t *spkg = NULL;
@@ -569,7 +569,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
goto error;
}
*miss = *(pmdepmissing_t *)i->data;
- *data = pm_list_add(*data, miss);
+ *data = _alpm_list_add(*data, miss);
}
}
}
@@ -583,7 +583,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
goto error;
}
*miss = *(pmdepmissing_t *)i->data;
- *data = pm_list_add(*data, miss);
+ *data = _alpm_list_add(*data, miss);
}
}
}
@@ -617,13 +617,13 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
pmsyncpkg_t *sync = i->data;
if(sync->type == PM_SYNC_TYPE_REPLACE) {
for(j = sync->data; j; j = j->next) {
- list = pm_list_add(list, j->data);
+ list = _alpm_list_add(list, j->data);
}
}
}
if(list) {
_alpm_log(PM_LOG_FLOW1, "checking dependencies of packages designated for removal");
- deps = checkdeps(db_local, PM_TRANS_TYPE_REMOVE, list);
+ deps = _alpm_checkdeps(db_local, PM_TRANS_TYPE_REMOVE, list);
if(deps) {
int errorout = 0;
for(i = deps; i; i = i->next) {
@@ -633,8 +633,8 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
PMList *k;
/* If miss->depend.name depends on something that miss->target and a
* package in final both provide, then it's okay... */
- pmpkg_t *leavingp = db_get_pkgfromcache(db_local, miss->target);
- pmpkg_t *conflictp = db_get_pkgfromcache(db_local, miss->depend.name);
+ pmpkg_t *leavingp = _alpm_db_get_pkgfromcache(db_local, miss->target);
+ pmpkg_t *conflictp = _alpm_db_get_pkgfromcache(db_local, miss->depend.name);
if(!leavingp || !conflictp) {
_alpm_log(PM_LOG_ERROR, "something has gone horribly wrong");
goto error;
@@ -674,7 +674,7 @@ int sync_prepare(pmtrans_t *trans, pmdb_t *db_local, PMList *dbs_sync, PMList **
goto error;
}
*miss = *(pmdepmissing_t *)i->data;
- *data = pm_list_add(*data, miss);
+ *data = _alpm_list_add(*data, miss);
}
}
}
@@ -700,7 +700,7 @@ error:
return(-1);
}
-int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
+int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
{
PMList *i;
pmtrans_t *tr = NULL;
@@ -710,14 +710,15 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1));
/* remove conflicting and to-be-replaced packages */
- tr = trans_new();
+ tr = _alpm_trans_new();
if(tr == NULL) {
_alpm_log(PM_LOG_ERROR, "could not create removal transaction");
pm_errno = PM_ERR_MEMORY;
goto error;
}
- if(trans_init(tr, PM_TRANS_TYPE_REMOVE, PM_TRANS_FLAG_NODEPS, NULL, NULL) == -1) {
+ if(_alpm_trans_init(tr, PM_TRANS_TYPE_REMOVE, PM_TRANS_FLAG_NODEPS,
+ trans->cb_event, trans->cb_conv) == -1) {
_alpm_log(PM_LOG_ERROR, "could not initialize the removal transaction");
goto error;
}
@@ -728,8 +729,8 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
PMList *j;
for(j = sync->data; j; j = j->next) {
pmpkg_t *pkg = j->data;
- if(!pkg_isin(pkg->name, tr->packages)) {
- if(trans_addtarget(tr, pkg->name) == -1) {
+ if(!_alpm_pkg_isin(pkg->name, tr->packages)) {
+ if(_alpm_trans_addtarget(tr, pkg->name) == -1) {
goto error;
}
replaces++;
@@ -739,13 +740,13 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
}
if(replaces) {
_alpm_log(PM_LOG_FLOW1, "removing conflicting and to-be-replaced packages");
- if(trans_prepare(tr, data) == -1) {
+ if(_alpm_trans_prepare(tr, data) == -1) {
_alpm_log(PM_LOG_ERROR, "could not prepare removal transaction");
goto error;
}
/* we want the frontend to be aware of commit details */
tr->cb_event = trans->cb_event;
- if(trans_commit(tr, NULL) == -1) {
+ if(_alpm_trans_commit(tr, NULL) == -1) {
_alpm_log(PM_LOG_ERROR, "could not commit removal transaction");
goto error;
}
@@ -754,13 +755,14 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
/* install targets */
_alpm_log(PM_LOG_FLOW1, "installing packages");
- tr = trans_new();
+ tr = _alpm_trans_new();
if(tr == NULL) {
_alpm_log(PM_LOG_ERROR, "could not create transaction");
pm_errno = PM_ERR_MEMORY;
goto error;
}
- if(trans_init(tr, PM_TRANS_TYPE_UPGRADE, trans->flags | PM_TRANS_FLAG_NODEPS, NULL, NULL) == -1) {
+ if(_alpm_trans_init(tr, PM_TRANS_TYPE_UPGRADE, trans->flags | PM_TRANS_FLAG_NODEPS,
+ trans->cb_event, trans->cb_conv) == -1) {
_alpm_log(PM_LOG_ERROR, "could not initialize transaction");
goto error;
}
@@ -769,7 +771,7 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
pmpkg_t *spkg = sync->pkg;
char str[PATH_MAX];
snprintf(str, PATH_MAX, "%s%s/%s-%s" PM_EXT_PKG, handle->root, handle->cachedir, spkg->name, spkg->version);
- if(trans_addtarget(tr, str) == -1) {
+ if(_alpm_trans_addtarget(tr, str) == -1) {
goto error;
}
/* using _alpm_list_last() is ok because addtarget() adds the new target at the
@@ -779,13 +781,11 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
spkg->reason = PM_PKG_REASON_DEPEND;
}
}
- if(trans_prepare(tr, data) == -1) {
+ if(_alpm_trans_prepare(tr, data) == -1) {
_alpm_log(PM_LOG_ERROR, "could not prepare transaction");
goto error;
}
- /* we want the frontend to be aware of commit details */
- tr->cb_event = trans->cb_event;
- if(trans_commit(tr, NULL) == -1) {
+ if(_alpm_trans_commit(tr, NULL) == -1) {
_alpm_log(PM_LOG_ERROR, "could not commit transaction");
goto error;
}
@@ -798,16 +798,16 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
pmsyncpkg_t *sync = i->data;
if(sync->type == PM_SYNC_TYPE_REPLACE) {
PMList *j;
- pmpkg_t *new = db_get_pkgfromcache(db_local, sync->pkg->name);
+ pmpkg_t *new = _alpm_db_get_pkgfromcache(db_local, sync->pkg->name);
for(j = sync->data; j; j = j->next) {
PMList *k;
pmpkg_t *old = j->data;
/* merge lists */
for(k = old->requiredby; k; k = k->next) {
- if(!pm_list_is_strin(k->data, new->requiredby)) {
+ if(!_alpm_list_is_strin(k->data, new->requiredby)) {
/* replace old's name with new's name in the requiredby's dependency list */
PMList *m;
- pmpkg_t *depender = db_get_pkgfromcache(db_local, k->data);
+ pmpkg_t *depender = _alpm_db_get_pkgfromcache(db_local, k->data);
if(depender == NULL) {
/* If the depending package no longer exists in the local db,
* then it must have ALSO conflicted with sync->pkg. If
@@ -821,16 +821,16 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data)
m->data = strdup(new->name);
}
}
- if(db_write(db_local, depender, INFRQ_DEPENDS) == -1) {
+ if(_alpm_db_write(db_local, depender, INFRQ_DEPENDS) == -1) {
_alpm_log(PM_LOG_ERROR, "could not update requiredby for database entry %s-%s",
new->name, new->version);
}
/* add the new requiredby */
- new->requiredby = pm_list_add(new->requiredby, strdup(k->data));
+ new->requiredby = _alpm_list_add(new->requiredby, strdup(k->data));
}
}
}
- if(db_write(db_local, new, INFRQ_DEPENDS) == -1) {
+ if(_alpm_db_write(db_local, new, INFRQ_DEPENDS) == -1) {
_alpm_log(PM_LOG_ERROR, "could not update new database entry %s-%s",
new->name, new->version);
}