summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-01-31 06:10:21 +0000
committerAaron Griffin <aaron@archlinux.org>2007-01-31 06:10:21 +0000
commit670319c2fb41f5ce5b446ad52bf2d8ddcf8c1548 (patch)
tree61fd4b3e50f695aa6887b39958f902dcf2708037 /lib/libalpm
parentf4340129d59377b32a7be64e09f71cb8faa3ac07 (diff)
downloadpacman-670319c2fb41f5ce5b446ad52bf2d8ddcf8c1548.tar.xz
Debug logging changes:
* The --debug params were goofy. New setup allows --debug without params, --debug=<level> where level 1=debug output, 2=debug and download output, 3=debug, download, and function tracing output. This seems more sane to me. * Removed PM_LOG_FLOW1 and PM_LOG_FLOW2. They were just confusing. When adding new functions, it is near impossible to determin if your output should be "flow1" or "flow2" without tracking all the way up the call chain. Rarely would one ever say "ok, lets just show "flow2" output. These have both been replaced with PM_LOG_DEBUG * Removed the need for the root parameter on alpm_initialize. it is now defaulted to PM_ROOT just like dbpath and cachedir. This allows alpm to be initialized BEFORE option parsing in the front end, saving us some duplicate variables in the frontend. * Cleaned up front end variables due to early alpm_initialize call.
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/add.c38
-rw-r--r--lib/libalpm/alpm.c24
-rw-r--r--lib/libalpm/alpm.h14
-rw-r--r--lib/libalpm/be_files.c2
-rw-r--r--lib/libalpm/db.c4
-rw-r--r--lib/libalpm/deps.c4
-rw-r--r--lib/libalpm/handle.c2
-rw-r--r--lib/libalpm/remove.c26
-rw-r--r--lib/libalpm/sync.c44
-rw-r--r--lib/libalpm/util.c2
10 files changed, 75 insertions, 85 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index f4b79572..d101f635 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -126,7 +126,7 @@ int SYMHIDDEN _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
return(add_faketarget(trans, name));
}
- _alpm_log(PM_LOG_FLOW2, _("loading target '%s'"), name);
+ _alpm_log(PM_LOG_DEBUG, _("loading target '%s'"), name);
/* TODO FS#5120 we need a better way to check if a package is a valid package,
* and read the metadata instead of relying on the filename for package name
@@ -188,7 +188,7 @@ int SYMHIDDEN _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
}
}
- _alpm_log(PM_LOG_FLOW2, _("reading '%s' metadata"), pkgname);
+ _alpm_log(PM_LOG_DEBUG, _("reading '%s' metadata"), pkgname);
info = _alpm_pkg_load(name);
if(info == NULL) {
/* pm_errno is already set by pkg_load() */
@@ -241,7 +241,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
/* look for unsatisfied dependencies */
- _alpm_log(PM_LOG_FLOW1, _("looking for unsatisfied dependencies"));
+ _alpm_log(PM_LOG_DEBUG, _("looking for unsatisfied dependencies"));
lp = _alpm_checkdeps(trans, db, trans->type, trans->packages);
if(lp != NULL) {
if(data) {
@@ -253,7 +253,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
}
/* no unsatisfied deps, so look for conflicts */
- _alpm_log(PM_LOG_FLOW1, _("looking for conflicts"));
+ _alpm_log(PM_LOG_DEBUG, _("looking for conflicts"));
lp = _alpm_checkconflicts(db, trans->packages);
for(i = lp; i; i = i->next) {
int skip_this = 0;
@@ -292,7 +292,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
}
/* re-order w.r.t. dependencies */
- _alpm_log(PM_LOG_FLOW1, _("sorting by dependencies"));
+ _alpm_log(PM_LOG_DEBUG, _("sorting by dependencies"));
lp = _alpm_sortbydeps(trans->packages, PM_TRANS_TYPE_ADD);
/* free the old alltargs */
FREELISTPTR(trans->packages);
@@ -304,7 +304,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
/* Cleaning up
*/
EVENT(trans, PM_TRANS_EVT_CLEANUP_START, NULL, NULL);
- _alpm_log(PM_LOG_FLOW1, _("cleaning up"));
+ _alpm_log(PM_LOG_DEBUG, _("cleaning up"));
for (lp=trans->packages; lp!=NULL; lp=lp->next) {
info=(pmpkg_t *)lp->data;
for (rmlist=info->removes; rmlist!=NULL; rmlist=rmlist->next) {
@@ -321,7 +321,7 @@ int _alpm_add_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL);
- _alpm_log(PM_LOG_FLOW1, _("looking for file conflicts"));
+ _alpm_log(PM_LOG_DEBUG, _("looking for file conflicts"));
lp = _alpm_db_find_conflicts(db, trans, handle->root, &skiplist);
if(lp != NULL) {
if(data) {
@@ -388,7 +388,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
if(local) {
EVENT(trans, PM_TRANS_EVT_UPGRADE_START, info, NULL);
cb_state = PM_TRANS_PROGRESS_UPGRADE_START;
- _alpm_log(PM_LOG_FLOW1, _("upgrading package %s-%s"), info->name, info->version);
+ _alpm_log(PM_LOG_DEBUG, _("upgrading package %s-%s"), info->name, info->version);
if((what = (char *)malloc(strlen(info->name)+1)) == NULL) {
RET_ERR(PM_ERR_MEMORY, -1);
}
@@ -420,7 +420,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
if(oldpkg) {
pmtrans_t *tr;
- _alpm_log(PM_LOG_FLOW1, _("removing old package first (%s-%s)"), oldpkg->name, oldpkg->version);
+ _alpm_log(PM_LOG_DEBUG, _("removing old package first (%s-%s)"), oldpkg->name, oldpkg->version);
tr = _alpm_trans_new();
if(tr == NULL) {
RET_ERR(PM_ERR_TRANS_ABORT, -1);
@@ -450,7 +450,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
if(!pmo_upgrade) {
EVENT(trans, PM_TRANS_EVT_ADD_START, info, NULL);
cb_state = PM_TRANS_PROGRESS_ADD_START;
- _alpm_log(PM_LOG_FLOW1, _("adding package %s-%s"), info->name, info->version);
+ _alpm_log(PM_LOG_DEBUG, _("adding package %s-%s"), info->name, info->version);
if((what = (char *)malloc(strlen(info->name)+1)) == NULL) {
RET_ERR(PM_ERR_MEMORY, -1);
}
@@ -461,11 +461,11 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
_alpm_runscriptlet(handle->root, info->data, "pre_install", info->version, NULL, trans);
}
} else {
- _alpm_log(PM_LOG_FLOW1, _("adding new package %s-%s"), info->name, info->version);
+ _alpm_log(PM_LOG_DEBUG, _("adding new package %s-%s"), info->name, info->version);
}
if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) {
- _alpm_log(PM_LOG_FLOW1, _("extracting files"));
+ _alpm_log(PM_LOG_DEBUG, _("extracting files"));
/* Extract the package */
if ((archive = archive_read_new ()) == NULL)
@@ -685,7 +685,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
}
if(installnew) {
- _alpm_log(PM_LOG_FLOW2, _("extracting %s"), pathname);
+ _alpm_log(PM_LOG_DEBUG, _("extracting %s"), pathname);
if(_alpm_copyfile(temp, expath)) {
_alpm_log(PM_LOG_ERROR, _("could not copy %s to %s (%s)"), temp, pathname, strerror(errno));
errors++;
@@ -705,9 +705,9 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
close(fd);
} else {
if(!notouch) {
- _alpm_log(PM_LOG_FLOW2, _("extracting %s"), pathname);
+ _alpm_log(PM_LOG_DEBUG, _("extracting %s"), pathname);
} else {
- _alpm_log(PM_LOG_FLOW2, _("%s is in NoUpgrade -- skipping"), pathname);
+ _alpm_log(PM_LOG_DEBUG, _("%s is in NoUpgrade -- skipping"), pathname);
strncat(expath, ".pacnew", PATH_MAX);
_alpm_log(PM_LOG_WARNING, _("extracting %s as %s.pacnew"), pathname, pathname);
alpm_logaction(_("warning: extracting %s%s as %s"), handle->root, pathname, expath);
@@ -800,8 +800,8 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
/* remove the extra line feed appended by asctime() */
info->installdate[strlen(info->installdate)-1] = 0;
- _alpm_log(PM_LOG_FLOW1, _("updating database"));
- _alpm_log(PM_LOG_FLOW2, _("adding database entry '%s'"), info->name);
+ _alpm_log(PM_LOG_DEBUG, _("updating database"));
+ _alpm_log(PM_LOG_DEBUG, _("adding database entry '%s'"), info->name);
if(_alpm_db_write(db, info, INFRQ_ALL)) {
_alpm_log(PM_LOG_ERROR, _("could not update database entry %s-%s"),
info->name, info->version);
@@ -815,7 +815,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
/* XXX: This is copy-pasta from remove.c - refactor */
/* update dependency packages' REQUIREDBY fields */
if(info->depends) {
- _alpm_log(PM_LOG_FLOW2, _("updating dependency packages 'requiredby' fields"));
+ _alpm_log(PM_LOG_DEBUG, _("updating dependency packages 'requiredby' fields"));
}
for(lp = info->depends; lp; lp = lp->next) {
pmpkg_t *depinfo;
@@ -875,7 +875,7 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db)
/* run ldconfig if it exists */
if(handle->trans->state != STATE_INTERRUPTED) {
- _alpm_log(PM_LOG_FLOW1, _("running \"ldconfig -r %s\""), handle->root);
+ _alpm_log(PM_LOG_DEBUG, _("running \"ldconfig -r %s\""), handle->root);
_alpm_ldconfig(handle->root);
}
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index 77c8f91b..de89fb21 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -72,13 +72,10 @@ enum _pmerrno_t pm_errno SYMEXPORT;
/** Initializes the library. This must be called before any other
* functions are called.
- * @param root the full path of the root we'll be installing to (usually /)
* @return 0 on success, -1 on error (pm_errno is set accordingly)
*/
-int SYMEXPORT alpm_initialize(const char *root)
+int SYMEXPORT alpm_initialize()
{
- char str[PATH_MAX];
-
ASSERT(handle == NULL, RET_ERR(PM_ERR_HANDLE_NOT_NULL, -1));
handle = _alpm_handle_new();
@@ -86,13 +83,6 @@ int SYMEXPORT alpm_initialize(const char *root)
RET_ERR(PM_ERR_MEMORY, -1);
}
- STRNCPY(str, (root) ? root : PM_ROOT, PATH_MAX);
- /* add a trailing '/' if there isn't one */
- if(str[strlen(str)-1] != '/') {
- strcat(str, "/");
- }
- handle->root = strdup(str);
-
return(0);
}
@@ -185,7 +175,7 @@ int alpm_db_unregister(pmdb_t *db)
RET_ERR(PM_ERR_DB_NOT_FOUND, -1);
}
- _alpm_log(PM_LOG_FLOW1, _("unregistering database '%s'"), db->treename);
+ _alpm_log(PM_LOG_DEBUG, _("unregistering database '%s'"), db->treename);
/* Cleanup */
_alpm_db_free_pkgcache(db);
@@ -236,11 +226,11 @@ int alpm_db_setserver(pmdb_t *db, const char *url)
return(-1);
}
db->servers = alpm_list_add(db->servers, server);
- _alpm_log(PM_LOG_FLOW2, _("adding new server to database '%s': protocol '%s', server '%s', path '%s'"),
+ _alpm_log(PM_LOG_DEBUG, _("adding new server to database '%s': protocol '%s', server '%s', path '%s'"),
db->treename, server->s_url->scheme, server->s_url->host, server->s_url->doc);
} else {
FREELIST(db->servers);
- _alpm_log(PM_LOG_FLOW2, _("serverlist flushed for '%s'"), db->treename);
+ _alpm_log(PM_LOG_DEBUG, _("serverlist flushed for '%s'"), db->treename);
}
return(0);
@@ -312,7 +302,7 @@ int SYMEXPORT alpm_db_update(int force, pmdb_t *db)
snprintf(path, PATH_MAX, "%s%s/%s" PM_EXT_DB, handle->root, handle->dbpath, db->treename);
/* remove the old dir */
- _alpm_log(PM_LOG_FLOW2, _("flushing database %s/%s"), handle->dbpath, db->treename);
+ _alpm_log(PM_LOG_DEBUG, _("flushing database %s/%s"), handle->dbpath, db->treename);
for(lp = _alpm_db_get_pkgcache(db, INFRQ_NONE); lp; lp = lp->next) {
if(_alpm_db_remove(db, lp->data) == -1) {
if(lp->data) {
@@ -497,7 +487,7 @@ int alpm_pkg_checksha1sum(pmpkg_t *pkg)
}
if(strcmp(sha1sum, pkg->sha1sum) == 0) {
- _alpm_log(PM_LOG_FLOW1, _("checksums for package %s-%s are matching"),
+ _alpm_log(PM_LOG_DEBUG, _("checksums for package %s-%s are matching"),
pkg->name, pkg->version);
} else {
_alpm_log(PM_LOG_ERROR, _("sha1sums do not match for package %s-%s"),
@@ -546,7 +536,7 @@ int alpm_pkg_checkmd5sum(pmpkg_t *pkg)
}
if(strcmp(md5sum, pkg->md5sum) == 0) {
- _alpm_log(PM_LOG_FLOW1, _("checksums for package %s-%s are matching"),
+ _alpm_log(PM_LOG_DEBUG, _("checksums for package %s-%s are matching"),
pkg->name, pkg->version);
} else {
_alpm_log(PM_LOG_ERROR, _("md5sums do not match for package %s-%s"),
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index cff38311..15af82b1 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -63,7 +63,7 @@ typedef struct __pmconflict_t pmconflict_t;
* Library
*/
-int alpm_initialize(const char *root);
+int alpm_initialize();
int alpm_release(void);
/*
@@ -72,13 +72,11 @@ int alpm_release(void);
/* Levels */
typedef enum _pmloglevel_t {
- PM_LOG_DEBUG = 0x01,
- PM_LOG_ERROR = 0x02,
- PM_LOG_WARNING = 0x04,
- PM_LOG_FLOW1 = 0x08,
- PM_LOG_FLOW2 = 0x10,
- PM_LOG_FUNCTION = 0x20,
- PM_LOG_DOWNLOAD = 0x40
+ PM_LOG_ERROR = 0x01,
+ PM_LOG_WARNING = 0x02,
+ PM_LOG_DEBUG = 0x04,
+ PM_LOG_DOWNLOAD = 0x08,
+ PM_LOG_FUNCTION = 0x10
} pmloglevel_t;
typedef void (*alpm_cb_log)(unsigned short, char *);
diff --git a/lib/libalpm/be_files.c b/lib/libalpm/be_files.c
index 986d9189..5b54c79c 100644
--- a/lib/libalpm/be_files.c
+++ b/lib/libalpm/be_files.c
@@ -56,7 +56,7 @@ int _alpm_db_install(pmdb_t *db, const char *dbfile)
/* ORE
we should not simply unpack the archive, but better parse it and
db_write each entry (see sync_load_dbarchive to get archive content) */
- _alpm_log(PM_LOG_FLOW2, _("unpacking database '%s'"), dbfile);
+ _alpm_log(PM_LOG_DEBUG, _("unpacking database '%s'"), dbfile);
if(_alpm_unpack(dbfile, db->path, NULL)) {
RET_ERR(PM_ERR_SYSTEM, -1);
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index a4c5e198..3d2d1c8a 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -174,12 +174,12 @@ pmdb_t *_alpm_db_register(char *treename, alpm_cb_db_register callback)
}
}
- _alpm_log(PM_LOG_FLOW1, _("registering database '%s'"), treename);
+ _alpm_log(PM_LOG_DEBUG, _("registering database '%s'"), treename);
/* make sure the database directory exists */
snprintf(path, PATH_MAX, "%s%s/%s", handle->root, handle->dbpath, treename);
if(stat(path, &buf) != 0 || !S_ISDIR(buf.st_mode)) {
- _alpm_log(PM_LOG_FLOW1, _("database directory '%s' does not exist -- try creating it"), path);
+ _alpm_log(PM_LOG_DEBUG, _("database directory '%s' does not exist -- try creating it"), path);
if(_alpm_makepath(path) != 0) {
RET_ERR(PM_ERR_SYSTEM, NULL);
}
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 285031e7..c907ab69 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -495,7 +495,7 @@ alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs)
/* see if it was explicitly installed */
if(dep->reason == PM_PKG_REASON_EXPLICIT) {
- _alpm_log(PM_LOG_FLOW2, _("excluding %s -- explicitly installed"), dep->name);
+ _alpm_log(PM_LOG_DEBUG, _("excluding %s -- explicitly installed"), dep->name);
needed = 1;
}
@@ -515,7 +515,7 @@ alpm_list_t *_alpm_removedeps(pmdb_t *db, alpm_list_t *targs)
_alpm_log(PM_LOG_DEBUG, _("loading ALL info for '%s'"), pkg->name);
_alpm_db_read(db, INFRQ_ALL, pkg);
newtargs = alpm_list_add(newtargs, pkg);
- _alpm_log(PM_LOG_FLOW2, _("adding '%s' to the targets"), pkg->name);
+ _alpm_log(PM_LOG_DEBUG, _("adding '%s' to the targets"), pkg->name);
newtargs = _alpm_removedeps(db, newtargs);
}
}
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 140fe328..8407a237 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -77,8 +77,10 @@ pmhandle_t *_alpm_handle_new()
handle->access = PM_ACCESS_RW;
#endif
+ handle->root = strdup(PM_ROOT);
handle->dbpath = strdup(PM_DBPATH);
handle->cachedir = strdup(PM_CACHEDIR);
+ handle->logmask = PM_LOG_ERROR | PM_LOG_WARNING;
return(handle);
}
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 85e2043b..afe5532b 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -89,7 +89,7 @@ int _alpm_remove_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
}
}
- _alpm_log(PM_LOG_FLOW2, _("adding %s in the targets list"), info->name);
+ _alpm_log(PM_LOG_DEBUG, _("adding %s in the targets list"), info->name);
trans->packages = alpm_list_add(trans->packages, info);
return(0);
@@ -107,7 +107,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
if(!(trans->flags & (PM_TRANS_FLAG_NODEPS)) && (trans->type != PM_TRANS_TYPE_UPGRADE)) {
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
- _alpm_log(PM_LOG_FLOW1, _("looking for unsatisfied dependencies"));
+ _alpm_log(PM_LOG_DEBUG, _("looking for unsatisfied dependencies"));
lp = _alpm_checkdeps(trans, db, trans->type, trans->packages);
if(lp != NULL) {
if(trans->flags & PM_TRANS_FLAG_CASCADE) {
@@ -117,7 +117,7 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
pmdepmissing_t *miss = (pmdepmissing_t *)i->data;
pmpkg_t *info = _alpm_db_scan(db, miss->depend.name, INFRQ_ALL);
if(info) {
- _alpm_log(PM_LOG_FLOW2, _("pulling %s in the targets list"), info->name);
+ _alpm_log(PM_LOG_DEBUG, _("pulling %s in the targets list"), info->name);
trans->packages = alpm_list_add(trans->packages, info);
} else {
_alpm_log(PM_LOG_ERROR, _("could not find %s in database -- skipping"),
@@ -138,12 +138,12 @@ int _alpm_remove_prepare(pmtrans_t *trans, pmdb_t *db, alpm_list_t **data)
}
if(trans->flags & PM_TRANS_FLAG_RECURSE) {
- _alpm_log(PM_LOG_FLOW1, _("finding removable dependencies"));
+ _alpm_log(PM_LOG_DEBUG, _("finding removable dependencies"));
trans->packages = _alpm_removedeps(db, trans->packages);
}
/* re-order w.r.t. dependencies */
- _alpm_log(PM_LOG_FLOW1, _("sorting by dependencies"));
+ _alpm_log(PM_LOG_DEBUG, _("sorting by dependencies"));
lp = _alpm_sortbydeps(trans->packages, PM_TRANS_TYPE_REMOVE);
/* free the old alltargs */
FREELISTPTR(trans->packages);
@@ -212,7 +212,7 @@ static void unlink_file(pmpkg_t *info, alpm_list_t *lp, alpm_list_t *targ,
}
}
if ( skipit ) {
- _alpm_log(PM_LOG_FLOW2, _("skipping removal of %s as it has moved to another package"),
+ _alpm_log(PM_LOG_DEBUG, _("skipping removal of %s as it has moved to another package"),
line);
} else {
/* if the file is flagged, back it up to .pacsave */
@@ -228,7 +228,7 @@ static void unlink_file(pmpkg_t *info, alpm_list_t *lp, alpm_list_t *targ,
}
}
} else {
- _alpm_log(PM_LOG_FLOW2, _("unlinking %s"), line);
+ _alpm_log(PM_LOG_DEBUG, _("unlinking %s"), line);
int list_count = alpm_list_count(trans->packages); /* this way we don't have to call alpm_list_count twice during PROGRESS */
PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, (double)(percent * 100), list_count, (list_count - alpm_list_count(targ) + 1));
++(*position);
@@ -262,7 +262,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
if(trans->type != PM_TRANS_TYPE_UPGRADE) {
EVENT(trans, PM_TRANS_EVT_REMOVE_START, info, NULL);
- _alpm_log(PM_LOG_FLOW1, _("removing package %s-%s"), info->name, info->version);
+ _alpm_log(PM_LOG_DEBUG, _("removing package %s-%s"), info->name, info->version);
/* run the pre-remove scriptlet if it exists */
if(info->scriptlet && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
@@ -273,7 +273,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) {
int filenum = alpm_list_count(info->files);
- _alpm_log(PM_LOG_FLOW1, _("removing files"));
+ _alpm_log(PM_LOG_DEBUG, _("removing files"));
/* iterate through the list backwards, unlinking files */
for(lp = alpm_list_last(info->files); lp; lp = lp->prev) {
@@ -290,8 +290,8 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
}
/* remove the package from the database */
- _alpm_log(PM_LOG_FLOW1, _("updating database"));
- _alpm_log(PM_LOG_FLOW2, _("removing database entry '%s'"), info->name);
+ _alpm_log(PM_LOG_DEBUG, _("updating database"));
+ _alpm_log(PM_LOG_DEBUG, _("removing database entry '%s'"), info->name);
if(_alpm_db_remove(db, info) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not remove database entry %s-%s"), info->name, info->version);
}
@@ -300,7 +300,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
}
/* update dependency packages' REQUIREDBY fields */
- _alpm_log(PM_LOG_FLOW2, _("updating dependency packages 'requiredby' fields"));
+ _alpm_log(PM_LOG_DEBUG, _("updating dependency packages 'requiredby' fields"));
for(lp = info->depends; lp; lp = lp->next) {
pmpkg_t *depinfo = NULL;
pmdepend_t depend;
@@ -355,7 +355,7 @@ int _alpm_remove_commit(pmtrans_t *trans, pmdb_t *db)
/* run ldconfig if it exists */
if((trans->type != PM_TRANS_TYPE_UPGRADE) && (handle->trans->state != STATE_INTERRUPTED)) {
- _alpm_log(PM_LOG_FLOW1, _("running \"ldconfig -r %s\""), handle->root);
+ _alpm_log(PM_LOG_DEBUG, _("running \"ldconfig -r %s\""), handle->root);
_alpm_ldconfig(handle->root);
}
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 763a2087..5e4d5f60 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -138,7 +138,7 @@ static int find_replacements(pmtrans_t *trans, pmdb_t *db_local,
ALPM_LOG_FUNC;
/* check for "recommended" package replacements */
- _alpm_log(PM_LOG_FLOW1, _("checking for package replacements"));
+ _alpm_log(PM_LOG_DEBUG, _("checking for package replacements"));
for(i = dbs_sync; i; i = i->next) {
for(j = _alpm_db_get_pkgcache(i->data, INFRQ_DESC); j; j = j->next) {
pmpkg_t *spkg = j->data;
@@ -183,7 +183,7 @@ static int find_replacements(pmtrans_t *trans, pmdb_t *db_local,
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)"),
+ _alpm_log(PM_LOG_DEBUG, _("%s-%s elected for upgrade (to be replaced by %s-%s)"),
lpkg->name, lpkg->version, spkg->name, spkg->version);
}
}
@@ -205,10 +205,10 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s
ALPM_LOG_FUNC;
/* check for "recommended" package replacements */
- _alpm_log(PM_LOG_FLOW1, _("checking for package replacements"));
+ _alpm_log(PM_LOG_DEBUG, _("checking for package replacements"));
if( find_replacements(trans, db_local, dbs_sync) == 0 ) {
/* match installed packages with the sync dbs and compare versions */
- _alpm_log(PM_LOG_FLOW1, _("checking for package upgrades"));
+ _alpm_log(PM_LOG_DEBUG, _("checking for package upgrades"));
for(i = _alpm_db_get_pkgcache(db_local, INFRQ_NONE); i; i = i->next) {
int cmp;
int replace=0;
@@ -254,11 +254,11 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s
local->name, local->version, spkg->version);
} else if(istoonew(spkg)) {
/* package too new (UpgradeDelay) */
- _alpm_log(PM_LOG_FLOW1, _("%s-%s: delaying upgrade of package (%s)"),
+ _alpm_log(PM_LOG_DEBUG, _("%s-%s: delaying upgrade of package (%s)"),
local->name, local->version, spkg->version);
/* check if spkg->name is already in the packages list. */
} else {
- _alpm_log(PM_LOG_FLOW2, _("%s-%s elected for upgrade (%s => %s)"),
+ _alpm_log(PM_LOG_DEBUG, _("%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 = _alpm_pkg_new(local->name, local->version);
@@ -314,7 +314,7 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
if(spkg == NULL) {
/* Search provides */
alpm_list_t *p;
- _alpm_log(PM_LOG_FLOW2, _("target '%s' not found -- looking for provisions"), targ);
+ _alpm_log(PM_LOG_DEBUG, _("target '%s' not found -- looking for provisions"), targ);
p = _alpm_db_whatprovides(dbs, targ);
if(p == NULL) {
RET_ERR(PM_ERR_PKG_NOT_FOUND, -1);
@@ -337,7 +337,7 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
}
if(spkg == NULL) {
/* Search provides */
- _alpm_log(PM_LOG_FLOW2, _("target '%s' not found -- looking for provisions"), targ);
+ _alpm_log(PM_LOG_DEBUG, _("target '%s' not found -- looking for provisions"), targ);
for(j = dbs_sync; j && !spkg; j = j->next) {
pmdb_t *dbs = j->data;
alpm_list_t *p = _alpm_db_whatprovides(dbs, targ);
@@ -389,7 +389,7 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy
FREEPKG(dummy);
RET_ERR(PM_ERR_MEMORY, -1);
}
- _alpm_log(PM_LOG_FLOW2, _("adding target '%s' to the transaction set"), spkg->name);
+ _alpm_log(PM_LOG_DEBUG, _("adding target '%s' to the transaction set"), spkg->name);
trans->packages = alpm_list_add(trans->packages, sync);
}
@@ -437,7 +437,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
/* Resolve targets dependencies */
EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL);
- _alpm_log(PM_LOG_FLOW1, _("resolving target's dependencies"));
+ _alpm_log(PM_LOG_DEBUG, _("resolving target's dependencies"));
for(i = trans->packages; i; i = i->next) {
pmpkg_t *spkg = ((pmsyncpkg_t *)i->data)->pkg;
if(_alpm_resolvedeps(db_local, dbs_sync, spkg, list, trail, trans, data) == -1) {
@@ -457,7 +457,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
goto cleanup;
}
trans->packages = alpm_list_add(trans->packages, sync);
- _alpm_log(PM_LOG_FLOW2, _("adding package %s-%s to the transaction targets"),
+ _alpm_log(PM_LOG_DEBUG, _("adding package %s-%s to the transaction targets"),
spkg->name, spkg->version);
} else {
/* remove the original targets from the list if requested */
@@ -492,7 +492,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL);
- _alpm_log(PM_LOG_FLOW1, _("looking for unresolvable dependencies"));
+ _alpm_log(PM_LOG_DEBUG, _("looking for unresolvable dependencies"));
deps = _alpm_checkdeps(trans, db_local, PM_TRANS_TYPE_UPGRADE, list);
if(deps) {
if(data) {
@@ -512,7 +512,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
/* check for inter-conflicts and whatnot */
EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL);
- _alpm_log(PM_LOG_FLOW1, _("looking for conflicts"));
+ _alpm_log(PM_LOG_DEBUG, _("looking for conflicts"));
deps = _alpm_checkconflicts(db_local, list);
if(deps) {
int errorout = 0;
@@ -523,7 +523,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
pmsyncpkg_t *sync;
pmpkg_t *local;
- _alpm_log(PM_LOG_FLOW2, _("package '%s' is conflicting with '%s'"),
+ _alpm_log(PM_LOG_DEBUG, _("package '%s' is conflicting with '%s'"),
miss->target, miss->depend.name);
/* check if the conflicting package is one that's about to be removed/replaced.
@@ -596,7 +596,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
if(rmpkg) {
pmsyncpkg_t *rsync = find_pkginsync(rmpkg, trans->packages);
void *vpkg;
- _alpm_log(PM_LOG_FLOW2, _("removing '%s' from target list"), rmpkg);
+ _alpm_log(PM_LOG_DEBUG, _("removing '%s' from target list"), rmpkg);
trans->packages = alpm_list_remove(trans->packages, rsync, pkg_cmp, &vpkg);
FREESYNC(vpkg);
continue;
@@ -628,12 +628,12 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
FREEPKG(sync->data);
}
/* append to the replaces list */
- _alpm_log(PM_LOG_FLOW2, _("electing '%s' for removal"), miss->depend.name);
+ _alpm_log(PM_LOG_DEBUG, _("electing '%s' for removal"), miss->depend.name);
sync->data = alpm_list_add(sync->data, q);
if(rsync) {
/* remove it from the target list */
void *vpkg;
- _alpm_log(PM_LOG_FLOW2, _("removing '%s' from target list"), miss->depend.name);
+ _alpm_log(PM_LOG_DEBUG, _("removing '%s' from target list"), miss->depend.name);
trans->packages = alpm_list_remove(trans->packages, rsync, pkg_cmp, &vpkg);
FREESYNC(vpkg);
}
@@ -707,7 +707,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
}
}
if(list) {
- _alpm_log(PM_LOG_FLOW1, _("checking dependencies of packages designated for removal"));
+ _alpm_log(PM_LOG_DEBUG, _("checking dependencies of packages designated for removal"));
deps = _alpm_checkdeps(trans, db_local, PM_TRANS_TYPE_REMOVE, list);
if(deps) {
int errorout = 0;
@@ -740,7 +740,7 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync
for(o = sp->pkg->provides; o && !pfound; o = o->next) {
if(!strcmp(m->data, o->data)) {
/* found matching provisio -- we're good to go */
- _alpm_log(PM_LOG_FLOW2, _("found '%s' as a provision for '%s' -- conflict aborted"),
+ _alpm_log(PM_LOG_DEBUG, _("found '%s' as a provision for '%s' -- conflict aborted"),
sp->pkg->name, (char *)o->data);
pfound = 1;
}
@@ -970,7 +970,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data)
}
}
if(replaces) {
- _alpm_log(PM_LOG_FLOW1, _("removing conflicting and to-be-replaced packages"));
+ _alpm_log(PM_LOG_DEBUG, _("removing conflicting and to-be-replaced packages"));
if(_alpm_trans_prepare(tr, data) == -1) {
_alpm_log(PM_LOG_ERROR, _("could not prepare removal transaction"));
goto error;
@@ -985,7 +985,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data)
FREETRANS(tr);
/* install targets */
- _alpm_log(PM_LOG_FLOW1, _("installing packages"));
+ _alpm_log(PM_LOG_DEBUG, _("installing packages"));
tr = _alpm_trans_new();
if(tr == NULL) {
_alpm_log(PM_LOG_ERROR, _("could not create transaction"));
@@ -1028,7 +1028,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data)
/* propagate replaced packages' requiredby fields to their new owners */
if(replaces) {
- _alpm_log(PM_LOG_FLOW1, _("updating database for replaced packages' dependencies"));
+ _alpm_log(PM_LOG_DEBUG, _("updating database for replaced packages' dependencies"));
for(i = trans->packages; i; i = i->next) {
pmsyncpkg_t *sync = i->data;
if(sync->type == PM_SYNC_TYPE_REPLACE) {
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index e9d0cbe0..7049af67 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -468,7 +468,7 @@ int _alpm_runscriptlet(char *root, char *installfn, char *script, char *ver, cha
_alpm_log(PM_LOG_ERROR, _("could not change directory to %s (%s)"), root, strerror(errno));
}
- _alpm_log(PM_LOG_FLOW2, _("executing %s script..."), script);
+ _alpm_log(PM_LOG_DEBUG, _("executing %s script..."), script);
if(oldver) {
snprintf(cmdline, PATH_MAX, "source %s %s %s %s",