summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/be_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/be_local.c')
-rw-r--r--lib/libalpm/be_local.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 63a95bb8..a98b1bba 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -280,13 +280,13 @@ static int checkdbdir(alpm_db_t *db)
const char *path = _alpm_db_path(db);
if(stat(path, &buf) != 0) {
- _alpm_log(db->handle, PM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
path);
if(_alpm_makepath(path) != 0) {
RET_ERR(db->handle, PM_ERR_SYSTEM, -1);
}
} else if(!S_ISDIR(buf.st_mode)) {
- _alpm_log(db->handle, PM_LOG_WARNING, _("removing invalid database: %s\n"), path);
+ _alpm_log(db->handle, ALPM_LOG_WARNING, _("removing invalid database: %s\n"), path);
if(unlink(path) != 0 || _alpm_makepath(path) != 0) {
RET_ERR(db->handle, PM_ERR_SYSTEM, -1);
}
@@ -442,7 +442,7 @@ static int local_db_populate(alpm_db_t *db)
/* split the db entry name */
if(_alpm_splitname(name, &(pkg->name), &(pkg->version),
&(pkg->name_hash)) != 0) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("invalid name for database entry '%s'\n"),
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("invalid name for database entry '%s'\n"),
name);
_alpm_pkg_free(pkg);
continue;
@@ -450,7 +450,7 @@ static int local_db_populate(alpm_db_t *db)
/* duplicated database entries are not allowed */
if(_alpm_pkghash_find(db->pkgcache, pkg->name)) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("duplicated database entry '%s'\n"), pkg->name);
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("duplicated database entry '%s'\n"), pkg->name);
_alpm_pkg_free(pkg);
continue;
}
@@ -462,13 +462,13 @@ static int local_db_populate(alpm_db_t *db)
/* explicitly read with only 'BASE' data, accessors will handle the rest */
if(local_db_read(pkg, INFRQ_BASE) == -1) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("corrupted database entry '%s'\n"), name);
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("corrupted database entry '%s'\n"), name);
_alpm_pkg_free(pkg);
continue;
}
/* add to the collection */
- _alpm_log(db->handle, PM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
+ _alpm_log(db->handle, ALPM_LOG_FUNCTION, "adding '%s' to package cache for db '%s'\n",
pkg->name, db->treename);
db->pkgcache = _alpm_pkghash_add(db->pkgcache, pkg);
count++;
@@ -478,7 +478,7 @@ static int local_db_populate(alpm_db_t *db)
if(count > 0) {
db->pkgcache->list = alpm_list_msort(db->pkgcache->list, (size_t)count, _alpm_pkg_cmp);
}
- _alpm_log(db->handle, PM_LOG_DEBUG, "added %d packages to package cache for db '%s'\n",
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "added %d packages to package cache for db '%s'\n",
count, db->treename);
return count;
@@ -516,7 +516,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
/* already loaded all of this info, do nothing */
return 0;
}
- _alpm_log(db->handle, PM_LOG_FUNCTION, "loading package data for %s : level=0x%x\n",
+ _alpm_log(db->handle, ALPM_LOG_FUNCTION, "loading package data for %s : level=0x%x\n",
info->name, inforeq);
/* clear out 'line', to be certain - and to make valgrind happy */
@@ -526,7 +526,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
if(access(pkgpath, F_OK)) {
/* directory doesn't exist or can't be opened */
- _alpm_log(db->handle, PM_LOG_DEBUG, "cannot find '%s-%s' in db '%s'\n",
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "cannot find '%s-%s' in db '%s'\n",
info->name, info->version, db->treename);
goto error;
}
@@ -535,7 +535,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
if(inforeq & INFRQ_DESC && !(info->infolevel & INFRQ_DESC)) {
snprintf(path, PATH_MAX, "%sdesc", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
goto error;
}
while(!feof(fp)) {
@@ -548,7 +548,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
goto error;
}
if(strcmp(_alpm_strtrim(line), info->name) != 0) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("%s database is inconsistent: name "
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("%s database is inconsistent: name "
"mismatch on package %s\n"), db->treename, info->name);
}
} else if(strcmp(line, "%VERSION%") == 0) {
@@ -556,7 +556,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
goto error;
}
if(strcmp(_alpm_strtrim(line), info->version) != 0) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("%s database is inconsistent: version "
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("%s database is inconsistent: version "
"mismatch on package %s\n"), db->treename, info->name);
}
} else if(strcmp(line, "%DESC%") == 0) {
@@ -659,7 +659,7 @@ static int local_db_read(alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
if(inforeq & INFRQ_FILES && !(info->infolevel & INFRQ_FILES)) {
snprintf(path, PATH_MAX, "%sfiles", pkgpath);
if((fp = fopen(path, "r")) == NULL) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), path, strerror(errno));
goto error;
}
while(fgets(line, sizeof(line), fp)) {
@@ -721,7 +721,7 @@ int _alpm_local_db_prepare(alpm_db_t *db, alpm_pkg_t *info)
pkgpath = get_pkgpath(db, info);
if((retval = mkdir(pkgpath, 0755)) != 0) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("could not create directory %s: %s\n"),
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("could not create directory %s: %s\n"),
pkgpath, strerror(errno));
}
@@ -755,11 +755,11 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
/* DESC */
if(inforeq & INFRQ_DESC) {
- _alpm_log(db->handle, PM_LOG_DEBUG, "writing %s-%s DESC information back to db\n",
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "writing %s-%s DESC information back to db\n",
info->name, info->version);
snprintf(path, PATH_MAX, "%sdesc", pkgpath);
if((fp = fopen(path, "w")) == NULL) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("could not open file %s: %s\n"),
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"),
path, strerror(errno));
retval = -1;
goto cleanup;
@@ -857,11 +857,11 @@ int _alpm_local_db_write(alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq
/* FILES */
if(inforeq & INFRQ_FILES) {
- _alpm_log(db->handle, PM_LOG_DEBUG, "writing %s-%s FILES information back to db\n",
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "writing %s-%s FILES information back to db\n",
info->name, info->version);
snprintf(path, PATH_MAX, "%sfiles", pkgpath);
if((fp = fopen(path, "w")) == NULL) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("could not open file %s: %s\n"),
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"),
path, strerror(errno));
retval = -1;
goto cleanup;
@@ -924,7 +924,7 @@ alpm_db_t *_alpm_db_register_local(alpm_handle_t *handle)
{
alpm_db_t *db;
- _alpm_log(handle, PM_LOG_DEBUG, "registering local database\n");
+ _alpm_log(handle, ALPM_LOG_DEBUG, "registering local database\n");
db = _alpm_db_new("local", 1);
if(db == NULL) {