Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_sync.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm/be_sync.c')
-rw-r--r--lib/libalpm/be_sync.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index ce418d56..3f24b3fa 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -50,14 +50,14 @@ static char *get_sync_dir(alpm_handle_t *handle)
sprintf(syncpath, "%s%s", dbpath, "sync/");
if(stat(syncpath, &buf) != 0) {
- _alpm_log(handle, PM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
+ _alpm_log(handle, ALPM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
syncpath);
if(_alpm_makepath(syncpath) != 0) {
free(syncpath);
RET_ERR(handle, PM_ERR_SYSTEM, NULL);
}
} else if(!S_ISDIR(buf.st_mode)) {
- _alpm_log(handle, PM_LOG_WARNING, _("removing invalid file: %s\n"), syncpath);
+ _alpm_log(handle, ALPM_LOG_WARNING, _("removing invalid file: %s\n"), syncpath);
if(unlink(syncpath) != 0 || _alpm_makepath(syncpath) != 0) {
free(syncpath);
RET_ERR(handle, PM_ERR_SYSTEM, NULL);
@@ -93,7 +93,7 @@ static int sync_db_validate(alpm_db_t *db)
return 0;
}
- _alpm_log(db->handle, PM_LOG_DEBUG, "checking signature for %s\n",
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "checking signature for %s\n",
db->treename);
ret = _alpm_gpgme_checksig(db->handle, dbpath, NULL);
if((check_sig == PM_PGP_VERIFY_ALWAYS && ret != 0) ||
@@ -218,7 +218,7 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
goto cleanup;
} else if(ret == -1) {
/* pm_errno was set by the download code */
- _alpm_log(handle, PM_LOG_DEBUG, "failed to sync db: %s\n",
+ _alpm_log(handle, ALPM_LOG_DEBUG, "failed to sync db: %s\n",
alpm_strerror(handle->pm_errno));
goto cleanup;
}
@@ -235,7 +235,7 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db)
cleanup:
if(_alpm_handle_unlock(handle)) {
- _alpm_log(handle, PM_LOG_WARNING, _("could not remove lock file %s\n"),
+ _alpm_log(handle, ALPM_LOG_WARNING, _("could not remove lock file %s\n"),
alpm_option_get_lockfile(handle));
}
free(syncpath);
@@ -264,7 +264,7 @@ static alpm_pkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname,
}
}
if(_alpm_splitname(entryname, &pkgname, &pkgver, &pkgname_hash) != 0) {
- _alpm_log(db->handle, PM_LOG_ERROR,
+ _alpm_log(db->handle, ALPM_LOG_ERROR,
_("invalid name for database entry '%s'\n"), entryname);
return NULL;
}
@@ -290,7 +290,7 @@ static alpm_pkg_t *load_pkg_for_entry(alpm_db_t *db, const char *entryname,
pkg->handle = db->handle;
/* 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);
} else {
@@ -383,11 +383,11 @@ static int sync_db_populate(alpm_db_t *db)
return -1;
}
- _alpm_log(db->handle, PM_LOG_DEBUG, "opening database archive %s\n", dbpath);
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "opening database archive %s\n", dbpath);
if(archive_read_open_filename(archive, dbpath,
ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
- _alpm_log(db->handle, PM_LOG_ERROR, _("could not open file %s: %s\n"), dbpath,
+ _alpm_log(db->handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), dbpath,
archive_error_string(archive));
archive_read_finish(archive);
RET_ERR(db->handle, PM_ERR_DB_OPEN, -1);
@@ -413,7 +413,7 @@ static int sync_db_populate(alpm_db_t *db)
} else {
/* we have desc, depends or deltas - parse it */
if(sync_db_read(db, archive, entry, &pkg) != 0) {
- _alpm_log(db->handle, PM_LOG_ERROR,
+ _alpm_log(db->handle, ALPM_LOG_ERROR,
_("could not parse package description file '%s' from db '%s'\n"),
archive_entry_pathname(entry), db->treename);
continue;
@@ -427,7 +427,7 @@ static int sync_db_populate(alpm_db_t *db)
db->pkgcache->list = alpm_list_msort(db->pkgcache->list, (size_t)count, _alpm_pkg_cmp);
}
archive_read_finish(archive);
- _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;
@@ -460,12 +460,12 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
entryname = archive_entry_pathname(entry);
if(entryname == NULL) {
- _alpm_log(db->handle, PM_LOG_DEBUG,
+ _alpm_log(db->handle, ALPM_LOG_DEBUG,
"invalid archive entry provided to _alpm_sync_db_read, skipping\n");
return -1;
}
- _alpm_log(db->handle, PM_LOG_FUNCTION, "loading package data from archive entry %s\n",
+ _alpm_log(db->handle, ALPM_LOG_FUNCTION, "loading package data from archive entry %s\n",
entryname);
memset(&buf, 0, sizeof(buf));
@@ -475,7 +475,7 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
pkg = load_pkg_for_entry(db, entryname, &filename, *likely_pkg);
if(pkg == NULL) {
- _alpm_log(db->handle, PM_LOG_DEBUG,
+ _alpm_log(db->handle, ALPM_LOG_DEBUG,
"entry %s could not be loaded into %s sync database",
entryname, db->treename);
return -1;
@@ -490,13 +490,13 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
if(strcmp(line, "%NAME%") == 0) {
READ_NEXT(line);
if(strcmp(line, pkg->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, pkg->name);
}
} else if(strcmp(line, "%VERSION%") == 0) {
READ_NEXT(line);
if(strcmp(line, pkg->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, pkg->name);
}
} else if(strcmp(line, "%FILENAME%") == 0) {
@@ -569,13 +569,13 @@ static int sync_db_read(alpm_db_t *db, struct archive *archive,
/* currently do nothing with this file */
} else {
/* unknown database file */
- _alpm_log(db->handle, PM_LOG_DEBUG, "unknown database file: %s\n", filename);
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "unknown database file: %s\n", filename);
}
return 0;
error:
- _alpm_log(db->handle, PM_LOG_DEBUG, "error parsing database file: %s\n", filename);
+ _alpm_log(db->handle, ALPM_LOG_DEBUG, "error parsing database file: %s\n", filename);
return -1;
}
@@ -590,7 +590,7 @@ alpm_db_t *_alpm_db_register_sync(alpm_handle_t *handle, const char *treename,
{
alpm_db_t *db;
- _alpm_log(handle, PM_LOG_DEBUG, "registering sync database '%s'\n", treename);
+ _alpm_log(handle, ALPM_LOG_DEBUG, "registering sync database '%s'\n", treename);
db = _alpm_db_new(treename, 0);
if(db == NULL) {