From da648bc24cebcf3fff9073693871183fd95d4c92 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 30 Jan 2007 08:14:10 +0000 Subject: K. Piche * ALPM_LOG_FUNCTION macro and all the great work to add this macro everywhere --- lib/libalpm/sync.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index a3e8e1fd..763a2087 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -59,6 +59,8 @@ pmsyncpkg_t *_alpm_sync_new(int type, pmpkg_t *spkg, void *data) { pmsyncpkg_t *sync; + ALPM_LOG_FUNC; + if((sync = (pmsyncpkg_t *)malloc(sizeof(pmsyncpkg_t))) == NULL) { _alpm_log(PM_LOG_ERROR, _("malloc failure: could not allocate %d bytes"), sizeof(pmsyncpkg_t)); return(NULL); @@ -75,6 +77,8 @@ void _alpm_sync_free(void *data) { pmsyncpkg_t *sync = data; + ALPM_LOG_FUNC; + if(sync == NULL) { return; } @@ -96,6 +100,8 @@ static pmsyncpkg_t *find_pkginsync(char *needle, alpm_list_t *haystack) pmsyncpkg_t *sync = NULL; int found = 0; + ALPM_LOG_FUNC; + for(i = haystack; i && !found; i = i->next) { sync = i->data; if(sync && !strcmp(sync->pkg->name, needle)) { @@ -112,6 +118,9 @@ static pmsyncpkg_t *find_pkginsync(char *needle, alpm_list_t *haystack) static int istoonew(pmpkg_t *pkg) { time_t t; + + ALPM_LOG_FUNC; + if (!handle->upgradedelay) return 0; time(&t); @@ -126,6 +135,8 @@ static int find_replacements(pmtrans_t *trans, pmdb_t *db_local, { alpm_list_t *i, *j, *k; + ALPM_LOG_FUNC; + /* check for "recommended" package replacements */ _alpm_log(PM_LOG_FLOW1, _("checking for package replacements")); for(i = dbs_sync; i; i = i->next) { @@ -191,6 +202,8 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s { alpm_list_t *i, *j; + ALPM_LOG_FUNC; + /* check for "recommended" package replacements */ _alpm_log(PM_LOG_FLOW1, _("checking for package replacements")); if( find_replacements(trans, db_local, dbs_sync) == 0 ) { @@ -281,6 +294,8 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy pmsyncpkg_t *sync; int cmp, repo_found = 0; + ALPM_LOG_FUNC; + ASSERT(db_local != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); ASSERT(name != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); @@ -403,6 +418,8 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync alpm_list_t *i, *j, *k, *l; int ret = 0; + ALPM_LOG_FUNC; + ASSERT(db_local != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); @@ -788,6 +805,8 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) char ldir[PATH_MAX]; int varcache = 1; + ALPM_LOG_FUNC; + ASSERT(db_local != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); -- cgit v1.2.3