From 78cbc045c129ca7767b13127e1e17c400b112770 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 3 Jun 2011 11:48:24 -0500 Subject: Remove ALPM_LOG_FUNC macro The usefulness of this is rather limited due to it not being compiled into production builds. When you do choose to see the output, it is often overwhelming and not helpful. The best bet is to use a debugger and/or well-placed fprintf() statements. Signed-off-by: Dan McGee --- lib/libalpm/add.c | 6 ----- lib/libalpm/alpm.c | 2 -- lib/libalpm/backup.c | 2 -- lib/libalpm/be_local.c | 19 --------------- lib/libalpm/be_package.c | 8 ------- lib/libalpm/be_sync.c | 7 ------ lib/libalpm/conflict.c | 24 ------------------- lib/libalpm/db.c | 60 ------------------------------------------------ lib/libalpm/delta.c | 2 -- lib/libalpm/deps.c | 24 ------------------- lib/libalpm/dload.c | 2 -- lib/libalpm/group.c | 8 ------- lib/libalpm/handle.c | 12 ---------- lib/libalpm/log.c | 2 -- lib/libalpm/log.h | 7 ------ lib/libalpm/package.c | 16 ------------- lib/libalpm/pkghash.c | 2 -- lib/libalpm/remove.c | 14 ----------- lib/libalpm/signing.c | 7 ------ lib/libalpm/sync.c | 6 ----- lib/libalpm/trans.c | 16 ------------- lib/libalpm/util.c | 6 ----- 22 files changed, 252 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index ee56e876..e9dc7dcd 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -55,8 +55,6 @@ int SYMEXPORT alpm_add_pkg(pmpkg_t *pkg) pmdb_t *db_local; pmpkg_t *local; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); @@ -474,8 +472,6 @@ static int commit_single_pkg(pmpkg_t *newpkg, size_t pkg_current, int is_upgrade = 0; pmpkg_t *oldpkg = NULL; - ALPM_LOG_FUNC; - ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); snprintf(scriptlet, PATH_MAX, "%s%s-%s/install", @@ -708,8 +704,6 @@ int _alpm_upgrade_packages(pmtrans_t *trans, pmdb_t *db) int skip_ldconfig = 0, ret = 0; alpm_list_t *targ; - ALPM_LOG_FUNC; - ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index bafd922b..a13d653a 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -79,8 +79,6 @@ int SYMEXPORT alpm_release(void) { pmdb_t *db; - ALPM_LOG_FUNC; - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); /* close local database */ diff --git a/lib/libalpm/backup.c b/lib/libalpm/backup.c index 7df97471..6431b286 100644 --- a/lib/libalpm/backup.c +++ b/lib/libalpm/backup.c @@ -83,8 +83,6 @@ char *_alpm_needbackup(const char *file, const alpm_list_t *backup) { const alpm_list_t *lp; - ALPM_LOG_FUNC; - if(file == NULL || backup == NULL) { return NULL; } diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index 36105452..fc138e39 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -44,7 +44,6 @@ #define LAZY_LOAD(info, errret) \ do { \ - ALPM_LOG_FUNC; \ ASSERT(handle != NULL, return (errret)); \ if(pkg->origin != PKG_FROM_FILE && !(pkg->infolevel & info)) { \ _alpm_local_db_read(pkg->origin_data.db, pkg, info); \ @@ -138,8 +137,6 @@ static alpm_list_t *_cache_get_groups(pmpkg_t *pkg) static int _cache_has_scriptlet(pmpkg_t *pkg) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return -1); @@ -187,8 +184,6 @@ static alpm_list_t *_cache_get_deltas(pmpkg_t UNUSED *pkg) static alpm_list_t *_cache_get_files(pmpkg_t *pkg) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); @@ -201,8 +196,6 @@ static alpm_list_t *_cache_get_files(pmpkg_t *pkg) static alpm_list_t *_cache_get_backup(pmpkg_t *pkg) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); @@ -221,8 +214,6 @@ static alpm_list_t *_cache_get_backup(pmpkg_t *pkg) */ static void *_cache_changelog_open(pmpkg_t *pkg) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); @@ -346,8 +337,6 @@ static int local_db_populate(pmdb_t *db) const char *dbpath; DIR *dbdir; - ALPM_LOG_FUNC; - ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); dbpath = _alpm_db_path(db); @@ -473,8 +462,6 @@ int _alpm_local_db_read(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) char line[1024]; char *pkgpath = NULL; - ALPM_LOG_FUNC; - if(db == NULL) { RET_ERR(PM_ERR_DB_NULL, -1); } @@ -721,8 +708,6 @@ int _alpm_local_db_write(pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq) int retval = 0; char *pkgpath = NULL; - ALPM_LOG_FUNC; - if(db == NULL || info == NULL) { return -1; } @@ -884,8 +869,6 @@ int _alpm_local_db_remove(pmdb_t *db, pmpkg_t *info) int ret = 0; char *pkgpath = NULL; - ALPM_LOG_FUNC; - if(db == NULL || info == NULL) { RET_ERR(PM_ERR_DB_NULL, -1); } @@ -962,8 +945,6 @@ pmdb_t *_alpm_db_register_local(void) { pmdb_t *db; - ALPM_LOG_FUNC; - _alpm_log(PM_LOG_DEBUG, "registering local database\n"); db = _alpm_db_new("local", 1); diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 9e59d69a..8da317fc 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -43,8 +43,6 @@ */ static void *_package_changelog_open(pmpkg_t *pkg) { - ALPM_LOG_FUNC; - ASSERT(pkg != NULL, return NULL); struct archive *archive = NULL; @@ -144,8 +142,6 @@ static int parse_descfile(struct archive *a, pmpkg_t *newpkg) int linenum = 0; struct archive_read_buffer buf; - ALPM_LOG_FUNC; - memset(&buf, 0, sizeof(buf)); /* 512K for a line length seems reasonable */ buf.max_line_size = 512 * 1024; @@ -236,8 +232,6 @@ pmpkg_t *_alpm_pkg_load_internal(const char *pkgfile, int full, pmpkg_t *newpkg = NULL; struct stat st; - ALPM_LOG_FUNC; - if(pkgfile == NULL || strlen(pkgfile) == 0) { RET_ERR(PM_ERR_WRONG_ARGS, NULL); } @@ -383,8 +377,6 @@ error: int SYMEXPORT alpm_pkg_load(const char *filename, int full, pgp_verify_t check_sig, pmpkg_t **pkg) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 9d85a454..77c9207d 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -87,8 +87,6 @@ int SYMEXPORT alpm_db_update(int force, pmdb_t *db) mode_t oldmask; pgp_verify_t check_sig; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(db != NULL && db != handle->db_local, RET_ERR(PM_ERR_WRONG_ARGS, -1)); @@ -242,8 +240,6 @@ static int sync_db_populate(pmdb_t *db) struct archive_entry *entry; pmpkg_t *pkg = NULL; - ALPM_LOG_FUNC; - ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); if((archive = archive_read_new()) == NULL) { @@ -360,8 +356,6 @@ static int sync_db_read(pmdb_t *db, struct archive *archive, pmpkg_t *pkg; struct archive_read_buffer buf; - ALPM_LOG_FUNC; - if(db == NULL) { RET_ERR(PM_ERR_DB_NULL, -1); } @@ -512,7 +506,6 @@ pmdb_t *_alpm_db_register_sync(const char *treename) { pmdb_t *db; - ALPM_LOG_FUNC; _alpm_log(PM_LOG_DEBUG, "registering sync database '%s'\n", treename); db = _alpm_db_new(treename, 0); diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index fbc988bd..995c6cb7 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -45,8 +45,6 @@ pmconflict_t *_alpm_conflict_new(const char *package1, const char *package2, { pmconflict_t *conflict; - ALPM_LOG_FUNC; - MALLOC(conflict, sizeof(pmconflict_t), RET_ERR(PM_ERR_MEMORY, NULL)); STRDUP(conflict->package1, package1, RET_ERR(PM_ERR_MEMORY, NULL)); @@ -82,8 +80,6 @@ static int conflict_isin(pmconflict_t *needle, alpm_list_t *haystack) const char *npkg1 = needle->package1; const char *npkg2 = needle->package2; - ALPM_LOG_FUNC; - for(i = haystack; i; i = i->next) { pmconflict_t *conflict = i->data; const char *cpkg1 = conflict->package1; @@ -168,8 +164,6 @@ alpm_list_t *_alpm_innerconflicts(alpm_list_t *packages) { alpm_list_t *baddeps = NULL; - ALPM_LOG_FUNC; - _alpm_log(PM_LOG_DEBUG, "check targets vs targets\n"); check_conflict(packages, packages, &baddeps, 0); @@ -184,8 +178,6 @@ alpm_list_t *_alpm_outerconflicts(pmdb_t *db, alpm_list_t *packages) { alpm_list_t *baddeps = NULL; - ALPM_LOG_FUNC; - if(db == NULL) { return NULL; } @@ -359,8 +351,6 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, size_t numtargs = alpm_list_count(upgrade); size_t current; - ALPM_LOG_FUNC; - if(db == NULL || upgrade == NULL || trans == NULL) { return NULL; } @@ -517,8 +507,6 @@ alpm_list_t *_alpm_db_find_fileconflicts(pmdb_t *db, pmtrans_t *trans, const char SYMEXPORT *alpm_conflict_get_package1(pmconflict_t *conflict) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(conflict != NULL, return NULL); @@ -528,8 +516,6 @@ const char SYMEXPORT *alpm_conflict_get_package1(pmconflict_t *conflict) const char SYMEXPORT *alpm_conflict_get_package2(pmconflict_t *conflict) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(conflict != NULL, return NULL); @@ -539,8 +525,6 @@ const char SYMEXPORT *alpm_conflict_get_package2(pmconflict_t *conflict) const char SYMEXPORT *alpm_conflict_get_reason(pmconflict_t *conflict) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(conflict != NULL, return NULL); @@ -550,8 +534,6 @@ const char SYMEXPORT *alpm_conflict_get_reason(pmconflict_t *conflict) const char SYMEXPORT *alpm_fileconflict_get_target(pmfileconflict_t *conflict) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(conflict != NULL, return NULL); @@ -561,8 +543,6 @@ const char SYMEXPORT *alpm_fileconflict_get_target(pmfileconflict_t *conflict) pmfileconflicttype_t SYMEXPORT alpm_fileconflict_get_type(pmfileconflict_t *conflict) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return -1); ASSERT(conflict != NULL, return -1); @@ -572,8 +552,6 @@ pmfileconflicttype_t SYMEXPORT alpm_fileconflict_get_type(pmfileconflict_t *conf const char SYMEXPORT *alpm_fileconflict_get_file(pmfileconflict_t *conflict) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(conflict != NULL, return NULL); @@ -583,8 +561,6 @@ const char SYMEXPORT *alpm_fileconflict_get_file(pmfileconflict_t *conflict) const char SYMEXPORT *alpm_fileconflict_get_ctarget(pmfileconflict_t *conflict) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(conflict != NULL, return NULL); diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 31336144..94173a26 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -47,8 +47,6 @@ /** Register a sync database of packages. */ pmdb_t SYMEXPORT *alpm_db_register_sync(const char *treename) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, NULL)); ASSERT(treename != NULL && strlen(treename) != 0, RET_ERR(PM_ERR_WRONG_ARGS, NULL)); @@ -75,8 +73,6 @@ int SYMEXPORT alpm_db_unregister_all(void) alpm_list_t *i; pmdb_t *db; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); /* Do not unregister a database if a transaction is on-going */ @@ -97,8 +93,6 @@ int SYMEXPORT alpm_db_unregister(pmdb_t *db) { int found = 0; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(db != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); @@ -132,8 +126,6 @@ int SYMEXPORT alpm_db_unregister(pmdb_t *db) /** Get the serverlist of a database. */ alpm_list_t SYMEXPORT *alpm_db_get_servers(const pmdb_t *db) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, NULL)); @@ -143,8 +135,6 @@ alpm_list_t SYMEXPORT *alpm_db_get_servers(const pmdb_t *db) /** Set the serverlist of a database. */ int SYMEXPORT alpm_db_set_servers(pmdb_t *db, alpm_list_t *servers) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); @@ -175,8 +165,6 @@ int SYMEXPORT alpm_db_add_server(pmdb_t *db, const char *url) { char *newurl; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(url != NULL && strlen(url) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1)); @@ -202,8 +190,6 @@ int SYMEXPORT alpm_db_remove_server(pmdb_t *db, const char *url) { char *newurl, *vdata = NULL; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(url != NULL && strlen(url) != 0, RET_ERR(PM_ERR_WRONG_ARGS, -1)); @@ -230,8 +216,6 @@ int SYMEXPORT alpm_db_remove_server(pmdb_t *db, const char *url) */ int SYMEXPORT alpm_db_set_pgp_verify(pmdb_t *db, pgp_verify_t verify) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); @@ -245,8 +229,6 @@ int SYMEXPORT alpm_db_set_pgp_verify(pmdb_t *db, pgp_verify_t verify) /** Get the name of a package database. */ const char SYMEXPORT *alpm_db_get_name(const pmdb_t *db) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(db != NULL, return NULL); @@ -259,8 +241,6 @@ const char SYMEXPORT *alpm_db_get_url(const pmdb_t *db) { char *url; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(db != NULL, return NULL); @@ -275,8 +255,6 @@ const char SYMEXPORT *alpm_db_get_url(const pmdb_t *db) /** Get a package entry from a package database. */ pmpkg_t SYMEXPORT *alpm_db_get_pkg(pmdb_t *db, const char *name) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(db != NULL, return NULL); @@ -288,8 +266,6 @@ pmpkg_t SYMEXPORT *alpm_db_get_pkg(pmdb_t *db, const char *name) /** Get the package cache of a package database. */ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(pmdb_t *db) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(db != NULL, return NULL); @@ -300,8 +276,6 @@ alpm_list_t SYMEXPORT *alpm_db_get_pkgcache(pmdb_t *db) /** Get a group entry from a package database. */ pmgrp_t SYMEXPORT *alpm_db_readgrp(pmdb_t *db, const char *name) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(db != NULL, return NULL); @@ -313,8 +287,6 @@ pmgrp_t SYMEXPORT *alpm_db_readgrp(pmdb_t *db, const char *name) /** Get the group cache of a package database. */ alpm_list_t SYMEXPORT *alpm_db_get_grpcache(pmdb_t *db) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(db != NULL, return NULL); @@ -325,8 +297,6 @@ alpm_list_t SYMEXPORT *alpm_db_get_grpcache(pmdb_t *db) /** Searches a database. */ alpm_list_t SYMEXPORT *alpm_db_search(pmdb_t *db, const alpm_list_t* needles) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, return NULL); ASSERT(db != NULL, return NULL); @@ -337,8 +307,6 @@ alpm_list_t SYMEXPORT *alpm_db_search(pmdb_t *db, const alpm_list_t* needles) /** Set install reason for a package in db. */ int SYMEXPORT alpm_db_set_pkgreason(pmdb_t *db, const char *name, pmpkgreason_t reason) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(db != NULL && name != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); @@ -369,8 +337,6 @@ pmdb_t *_alpm_db_new(const char *treename, int is_local) { pmdb_t *db; - ALPM_LOG_FUNC; - CALLOC(db, 1, sizeof(pmdb_t), RET_ERR(PM_ERR_MEMORY, NULL)); STRDUP(db->treename, treename, RET_ERR(PM_ERR_MEMORY, NULL)); db->is_local = is_local; @@ -380,8 +346,6 @@ pmdb_t *_alpm_db_new(const char *treename, int is_local) void _alpm_db_free(pmdb_t *db) { - ALPM_LOG_FUNC; - /* cleanup pkgcache */ _alpm_db_free_pkgcache(db); /* cleanup server list */ @@ -446,8 +410,6 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles) /* copy the pkgcache- we will free the list var after each needle */ alpm_list_t *list = alpm_list_copy(_alpm_db_get_pkgcache(db)); - ALPM_LOG_FUNC; - for(i = needles; i; i = i->next) { char *targ; regex_t reg; @@ -520,8 +482,6 @@ alpm_list_t *_alpm_db_search(pmdb_t *db, const alpm_list_t *needles) */ int _alpm_db_load_pkgcache(pmdb_t *db) { - ALPM_LOG_FUNC; - if(db == NULL) { return -1; } @@ -541,8 +501,6 @@ int _alpm_db_load_pkgcache(pmdb_t *db) void _alpm_db_free_pkgcache(pmdb_t *db) { - ALPM_LOG_FUNC; - if(db == NULL || !db->pkgcache_loaded) { return; } @@ -560,8 +518,6 @@ void _alpm_db_free_pkgcache(pmdb_t *db) pmpkghash_t *_alpm_db_get_pkgcache_hash(pmdb_t *db) { - ALPM_LOG_FUNC; - if(db == NULL) { return NULL; } @@ -580,8 +536,6 @@ pmpkghash_t *_alpm_db_get_pkgcache_hash(pmdb_t *db) alpm_list_t *_alpm_db_get_pkgcache(pmdb_t *db) { - ALPM_LOG_FUNC; - pmpkghash_t *hash = _alpm_db_get_pkgcache_hash(db); if(hash == NULL) { @@ -596,8 +550,6 @@ int _alpm_db_add_pkgincache(pmdb_t *db, pmpkg_t *pkg) { pmpkg_t *newpkg; - ALPM_LOG_FUNC; - if(db == NULL || !db->pkgcache_loaded || pkg == NULL) { return -1; } @@ -620,8 +572,6 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg) { pmpkg_t *data = NULL; - ALPM_LOG_FUNC; - if(db == NULL || !db->pkgcache_loaded || pkg == NULL) { return -1; } @@ -646,8 +596,6 @@ int _alpm_db_remove_pkgfromcache(pmdb_t *db, pmpkg_t *pkg) pmpkg_t *_alpm_db_get_pkgfromcache(pmdb_t *db, const char *target) { - ALPM_LOG_FUNC; - if(db == NULL) { return NULL; } @@ -668,8 +616,6 @@ int _alpm_db_load_grpcache(pmdb_t *db) { alpm_list_t *lp; - ALPM_LOG_FUNC; - if(db == NULL) { return -1; } @@ -716,8 +662,6 @@ void _alpm_db_free_grpcache(pmdb_t *db) { alpm_list_t *lg; - ALPM_LOG_FUNC; - if(db == NULL || !db->grpcache_loaded) { return; } @@ -735,8 +679,6 @@ void _alpm_db_free_grpcache(pmdb_t *db) alpm_list_t *_alpm_db_get_grpcache(pmdb_t *db) { - ALPM_LOG_FUNC; - if(db == NULL) { return NULL; } @@ -752,8 +694,6 @@ pmgrp_t *_alpm_db_get_grpfromcache(pmdb_t *db, const char *target) { alpm_list_t *i; - ALPM_LOG_FUNC; - if(db == NULL || target == NULL || strlen(target) == 0) { return NULL; } diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index d3213fd1..cd234874 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -225,8 +225,6 @@ off_t _alpm_shortest_delta_path(alpm_list_t *deltas, alpm_list_t *vertices; off_t bestsize = LONG_MAX; - ALPM_LOG_FUNC; - if(deltas == NULL) { *path = NULL; return bestsize; diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index c5fb92ef..2d6b5b32 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -48,8 +48,6 @@ static pmdepmissing_t *depmiss_new(const char *target, pmdepend_t *dep, { pmdepmissing_t *miss; - ALPM_LOG_FUNC; - MALLOC(miss, sizeof(pmdepmissing_t), RET_ERR(PM_ERR_MEMORY, NULL)); STRDUP(miss->target, target, RET_ERR(PM_ERR_MEMORY, NULL)); @@ -134,8 +132,6 @@ alpm_list_t *_alpm_sortbydeps(alpm_list_t *targets, int reverse) alpm_list_t *vptr; pmgraph_t *vertex; - ALPM_LOG_FUNC; - if(targets == NULL) { return NULL; } @@ -271,8 +267,6 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_list_t *pkglist, int reversedeps, alpm_list_t *baddeps = NULL; int nodepversion; - ALPM_LOG_FUNC; - targets = alpm_list_join(alpm_list_copy(remove), alpm_list_copy(upgrade)); for(i = pkglist; i; i = i->next) { pmpkg_t *pkg = i->data; @@ -521,8 +515,6 @@ void _alpm_recursedeps(pmdb_t *db, alpm_list_t *targs, int include_explicit) { alpm_list_t *i, *j; - ALPM_LOG_FUNC; - if(db == NULL || targs == NULL) { return; } @@ -696,8 +688,6 @@ int _alpm_resolvedeps(alpm_list_t *localpkgs, alpm_list_t *dbs_sync, pmpkg_t *pk alpm_list_t *deps = NULL; alpm_list_t *packages_copy; - ALPM_LOG_FUNC; - if(_alpm_pkg_find(*packages, pkg->name) != NULL) { return 0; } @@ -765,8 +755,6 @@ int _alpm_resolvedeps(alpm_list_t *localpkgs, alpm_list_t *dbs_sync, pmpkg_t *pk const char SYMEXPORT *alpm_miss_get_target(const pmdepmissing_t *miss) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(miss != NULL, return NULL); @@ -775,8 +763,6 @@ const char SYMEXPORT *alpm_miss_get_target(const pmdepmissing_t *miss) const char SYMEXPORT *alpm_miss_get_causingpkg(const pmdepmissing_t *miss) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(miss != NULL, return NULL); @@ -785,8 +771,6 @@ const char SYMEXPORT *alpm_miss_get_causingpkg(const pmdepmissing_t *miss) pmdepend_t SYMEXPORT *alpm_miss_get_dep(pmdepmissing_t *miss) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(miss != NULL, return NULL); @@ -795,8 +779,6 @@ pmdepend_t SYMEXPORT *alpm_miss_get_dep(pmdepmissing_t *miss) pmdepmod_t SYMEXPORT alpm_dep_get_mod(const pmdepend_t *dep) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(dep != NULL, return -1); @@ -805,8 +787,6 @@ pmdepmod_t SYMEXPORT alpm_dep_get_mod(const pmdepend_t *dep) const char SYMEXPORT *alpm_dep_get_name(const pmdepend_t *dep) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(dep != NULL, return NULL); @@ -815,8 +795,6 @@ const char SYMEXPORT *alpm_dep_get_name(const pmdepend_t *dep) const char SYMEXPORT *alpm_dep_get_version(const pmdepend_t *dep) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(dep != NULL, return NULL); @@ -834,8 +812,6 @@ char SYMEXPORT *alpm_dep_compute_string(const pmdepend_t *dep) char *str; size_t len; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(dep != NULL, return NULL); diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 1825eed5..9583b363 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -335,8 +335,6 @@ char SYMEXPORT *alpm_fetch_pkgurl(const char *url) const char *filename, *cachedir; int ret; - ALPM_LOG_FUNC; - filename = get_filename(url); /* find a valid cache dir to download to */ diff --git a/lib/libalpm/group.c b/lib/libalpm/group.c index dbcc7554..383d0163 100644 --- a/lib/libalpm/group.c +++ b/lib/libalpm/group.c @@ -34,8 +34,6 @@ pmgrp_t *_alpm_grp_new(const char *name) { pmgrp_t* grp; - ALPM_LOG_FUNC; - CALLOC(grp, 1, sizeof(pmgrp_t), RET_ERR(PM_ERR_MEMORY, NULL)); STRDUP(grp->name, name, RET_ERR(PM_ERR_MEMORY, NULL)); @@ -44,8 +42,6 @@ pmgrp_t *_alpm_grp_new(const char *name) void _alpm_grp_free(pmgrp_t *grp) { - ALPM_LOG_FUNC; - if(grp == NULL) { return; } @@ -58,8 +54,6 @@ void _alpm_grp_free(pmgrp_t *grp) const char SYMEXPORT *alpm_grp_get_name(const pmgrp_t *grp) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(grp != NULL, return NULL); @@ -68,8 +62,6 @@ const char SYMEXPORT *alpm_grp_get_name(const pmgrp_t *grp) alpm_list_t SYMEXPORT *alpm_grp_get_pkgs(const pmgrp_t *grp) { - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(grp != NULL, return NULL); diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 39b3b600..e94528f9 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -53,8 +53,6 @@ pmhandle_t *_alpm_handle_new() void _alpm_handle_free(pmhandle_t *handle) { - ALPM_LOG_FUNC; - if(handle == NULL) { return; } @@ -306,8 +304,6 @@ int SYMEXPORT alpm_option_set_root(const char *root) char *realroot; size_t rootlen; - ALPM_LOG_FUNC; - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); if(!root) { @@ -348,8 +344,6 @@ int SYMEXPORT alpm_option_set_dbpath(const char *dbpath) size_t dbpathlen, lockfilelen; const char *lf = "db.lck"; - ALPM_LOG_FUNC; - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); if(!dbpath) { pm_errno = PM_ERR_WRONG_ARGS; @@ -387,8 +381,6 @@ int SYMEXPORT alpm_option_add_cachedir(const char *cachedir) char *newcachedir; size_t cachedirlen; - ALPM_LOG_FUNC; - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); if(!cachedir) { pm_errno = PM_ERR_WRONG_ARGS; @@ -445,8 +437,6 @@ int SYMEXPORT alpm_option_set_logfile(const char *logfile) { char *oldlogfile = handle->logfile; - ALPM_LOG_FUNC; - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); if(!logfile) { pm_errno = PM_ERR_WRONG_ARGS; @@ -470,8 +460,6 @@ int SYMEXPORT alpm_option_set_logfile(const char *logfile) int SYMEXPORT alpm_option_set_signaturedir(const char *signaturedir) { - ALPM_LOG_FUNC; - if(!signaturedir) { pm_errno = PM_ERR_WRONG_ARGS; return -1; diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index 9093af7b..f500754d 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -44,8 +44,6 @@ int SYMEXPORT alpm_logaction(const char *fmt, ...) int ret; va_list args; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); diff --git a/lib/libalpm/log.h b/lib/libalpm/log.h index 9a2961fb..1fd66a6d 100644 --- a/lib/libalpm/log.h +++ b/lib/libalpm/log.h @@ -22,13 +22,6 @@ #include "alpm.h" -#ifdef PACMAN_DEBUG -/* Log funtion entry points if debugging is enabled */ -#define ALPM_LOG_FUNC _alpm_log(PM_LOG_FUNCTION, "Enter %s\n", __func__) -#else -#define ALPM_LOG_FUNC -#endif - void _alpm_log(pmloglevel_t flag, const char *fmt, ...) __attribute__((format(printf,2,3))); #endif /* _ALPM_LOG_H */ diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 990f532d..205bc103 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -45,8 +45,6 @@ /** Free a package. */ int SYMEXPORT alpm_pkg_free(pmpkg_t *pkg) { - ALPM_LOG_FUNC; - ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); /* Only free packages loaded in user space */ @@ -63,8 +61,6 @@ int SYMEXPORT alpm_pkg_checkmd5sum(pmpkg_t *pkg) char *fpath; int retval; - ALPM_LOG_FUNC; - ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); /* We only inspect packages from sync repositories */ ASSERT(pkg->origin == PKG_FROM_SYNCDB, RET_ERR(PM_ERR_PKG_INVALID, -1)); @@ -370,8 +366,6 @@ pmpkg_t *_alpm_pkg_new(void) { pmpkg_t* pkg; - ALPM_LOG_FUNC; - CALLOC(pkg, 1, sizeof(pmpkg_t), RET_ERR(PM_ERR_MEMORY, NULL)); return pkg; @@ -382,8 +376,6 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg) pmpkg_t *newpkg; alpm_list_t *i; - ALPM_LOG_FUNC; - CALLOC(newpkg, 1, sizeof(pmpkg_t), RET_ERR(PM_ERR_MEMORY, NULL)); newpkg->name_hash = pkg->name_hash; @@ -430,8 +422,6 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg) void _alpm_pkg_free(pmpkg_t *pkg) { - ALPM_LOG_FUNC; - if(pkg == NULL) { return; } @@ -473,8 +463,6 @@ void _alpm_pkg_free(pmpkg_t *pkg) */ void _alpm_pkg_free_trans(pmpkg_t *pkg) { - ALPM_LOG_FUNC; - if(pkg == NULL) { return; } @@ -491,8 +479,6 @@ void _alpm_pkg_free_trans(pmpkg_t *pkg) /* Is spkg an upgrade for localpkg? */ int _alpm_pkg_compare_versions(pmpkg_t *spkg, pmpkg_t *localpkg) { - ALPM_LOG_FUNC; - return alpm_pkg_vercmp(alpm_pkg_get_version(spkg), alpm_pkg_get_version(localpkg)); } @@ -514,8 +500,6 @@ pmpkg_t *_alpm_pkg_find(alpm_list_t *haystack, const char *needle) alpm_list_t *lp; unsigned long needle_hash; - ALPM_LOG_FUNC; - if(needle == NULL || haystack == NULL) { return NULL; } diff --git a/lib/libalpm/pkghash.c b/lib/libalpm/pkghash.c index f4153300..7e5e1fce 100644 --- a/lib/libalpm/pkghash.c +++ b/lib/libalpm/pkghash.c @@ -304,8 +304,6 @@ pmpkg_t *_alpm_pkghash_find(pmpkghash_t *hash, const char *name) unsigned long name_hash; size_t position; - ALPM_LOG_FUNC; - if(name == NULL || hash == NULL) { return NULL; } diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 2d840ceb..48348fa2 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -49,8 +49,6 @@ int SYMEXPORT alpm_remove_pkg(pmpkg_t *pkg) pmtrans_t *trans; const char *pkgname; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(pkg != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); @@ -74,8 +72,6 @@ int SYMEXPORT alpm_remove_pkg(pmpkg_t *pkg) static void remove_prepare_cascade(pmtrans_t *trans, pmdb_t *db, alpm_list_t *lp) { - ALPM_LOG_FUNC; - while(lp) { alpm_list_t *i; for(i = lp; i; i = i->next) { @@ -101,8 +97,6 @@ static void remove_prepare_cascade(pmtrans_t *trans, pmdb_t *db, static void remove_prepare_keep_needed(pmtrans_t *trans, pmdb_t *db, alpm_list_t *lp) { - ALPM_LOG_FUNC; - /* Remove needed packages (which break dependencies) from target list */ while(lp != NULL) { alpm_list_t *i; @@ -140,8 +134,6 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data) { alpm_list_t *lp; - ALPM_LOG_FUNC; - ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); @@ -227,8 +219,6 @@ static void unlink_file(pmpkg_t *info, char *filename, alpm_list_t *skip_remove, struct stat buf; char file[PATH_MAX+1]; - ALPM_LOG_FUNC; - snprintf(file, PATH_MAX, "%s%s", handle->root, filename); /* check the remove skip list before removing the file. @@ -297,8 +287,6 @@ int _alpm_upgraderemove_package(pmpkg_t *oldpkg, pmpkg_t *newpkg, alpm_list_t *files = alpm_pkg_get_files(oldpkg); const char *pkgname = alpm_pkg_get_name(oldpkg); - ALPM_LOG_FUNC; - _alpm_log(PM_LOG_DEBUG, "removing old package first (%s-%s)\n", oldpkg->name, oldpkg->version); @@ -367,8 +355,6 @@ int _alpm_remove_packages(pmtrans_t *trans, pmdb_t *db) alpm_list_t *targ, *lp; size_t pkg_count; - ALPM_LOG_FUNC; - ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 9bb9d0ad..f6a5a1ae 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -111,8 +111,6 @@ static int gpgme_init(void) gpgme_error_t err; gpgme_engine_info_t enginfo; - ALPM_LOG_FUNC; - if(init) { /* we already successfully initialized the library */ return 0; @@ -213,8 +211,6 @@ int _alpm_gpgme_checksig(const char *path, const char *base64_sig) unsigned char *decoded_sigdata = NULL; FILE *file = NULL, *sigfile = NULL; - ALPM_LOG_FUNC; - if(!path || access(path, R_OK) != 0) { RET_ERR(PM_ERR_NOT_A_FILE, -1); } @@ -371,7 +367,6 @@ int _alpm_gpgme_checksig(const char *path, const char *base64_sig) */ pgp_verify_t _alpm_db_get_sigverify_level(pmdb_t *db) { - ALPM_LOG_FUNC; ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, PM_PGP_VERIFY_UNKNOWN)); if(db->pgp_verify != PM_PGP_VERIFY_UNKNOWN) { @@ -388,7 +383,6 @@ pgp_verify_t _alpm_db_get_sigverify_level(pmdb_t *db) */ int SYMEXPORT alpm_pkg_check_pgp_signature(pmpkg_t *pkg) { - ALPM_LOG_FUNC; ASSERT(pkg != NULL, return 0); return _alpm_gpgme_checksig(alpm_pkg_get_filename(pkg), pkg->base64_sig); @@ -401,7 +395,6 @@ int SYMEXPORT alpm_pkg_check_pgp_signature(pmpkg_t *pkg) */ int SYMEXPORT alpm_db_check_pgp_signature(pmdb_t *db) { - ALPM_LOG_FUNC; ASSERT(db != NULL, return 0); return _alpm_gpgme_checksig(_alpm_db_path(db), NULL); diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 8dd51aaa..b84d6256 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -89,8 +89,6 @@ int SYMEXPORT alpm_sync_sysupgrade(int enable_downgrade) pmdb_t *db_local; alpm_list_t *dbs_sync; - ALPM_LOG_FUNC; - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); trans = handle->trans; db_local = handle->db_local; @@ -307,8 +305,6 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync alpm_list_t *remove = NULL; 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)); @@ -840,8 +836,6 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) size_t numtargs, current = 0, replaces = 0; int errors; - ALPM_LOG_FUNC; - ASSERT(trans != NULL, RET_ERR(PM_ERR_TRANS_NULL, -1)); if(download_files(trans, &deltas)) { diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 5ffb5df2..31c5885c 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -104,8 +104,6 @@ int SYMEXPORT alpm_trans_init(pmtransflag_t flags, const int required_db_version = 2; int db_version; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1)); @@ -173,8 +171,6 @@ int SYMEXPORT alpm_trans_prepare(alpm_list_t **data) { pmtrans_t *trans; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); ASSERT(data != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1)); @@ -219,8 +215,6 @@ int SYMEXPORT alpm_trans_commit(alpm_list_t **data) { pmtrans_t *trans; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); @@ -260,8 +254,6 @@ int SYMEXPORT alpm_trans_interrupt(void) { pmtrans_t *trans; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); @@ -280,8 +272,6 @@ int SYMEXPORT alpm_trans_release(void) { pmtrans_t *trans; - ALPM_LOG_FUNC; - /* Sanity checks */ ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); @@ -313,8 +303,6 @@ pmtrans_t *_alpm_trans_new(void) { pmtrans_t *trans; - ALPM_LOG_FUNC; - CALLOC(trans, 1, sizeof(pmtrans_t), RET_ERR(PM_ERR_MEMORY, NULL)); trans->state = STATE_IDLE; @@ -323,8 +311,6 @@ pmtrans_t *_alpm_trans_new(void) void _alpm_trans_free(pmtrans_t *trans) { - ALPM_LOG_FUNC; - if(trans == NULL) { return; } @@ -377,8 +363,6 @@ int _alpm_runscriptlet(const char *root, const char *installfn, int clean_tmpdir = 0; int retval = 0; - ALPM_LOG_FUNC; - if(access(installfn, R_OK)) { /* not found */ _alpm_log(PM_LOG_DEBUG, "scriptlet '%s' not found\n", installfn); diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 99dd3bea..19186312 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -252,8 +252,6 @@ int _alpm_unpack(const char *archive, const char *prefix, alpm_list_t *list, int char cwd[PATH_MAX]; int restore_cwd = 0; - ALPM_LOG_FUNC; - if((_archive = archive_read_new()) == NULL) RET_ERR(PM_ERR_LIBARCHIVE, 1); @@ -425,8 +423,6 @@ int _alpm_run_chroot(const char *root, const char *path, char *const argv[]) int restore_cwd = 0; int retval = 0; - ALPM_LOG_FUNC; - /* save the cwd so we can restore it later */ if(getcwd(cwd, PATH_MAX) == NULL) { _alpm_log(PM_LOG_ERROR, _("could not get current working directory\n")); @@ -690,8 +686,6 @@ char SYMEXPORT *alpm_compute_md5sum(const char *filename) char *md5sum; int ret, i; - ALPM_LOG_FUNC; - ASSERT(filename != NULL, return NULL); /* allocate 32 chars plus 1 for null */ -- cgit v1.2.3-70-g09d2