index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Allan McRae <allan@archlinux.org> | 2011-07-02 02:01:38 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2011-07-02 02:01:38 +1000 |
commit | ca43fdd92f06a6997c53e45bfed6fb27f3044de5 (patch) | |
tree | 7e8602a60ee18b8bdee78d9064d6c3bc2eb09dc4 /lib | |
parent | d796d1cdda15889fc0793eae50582d75f07d55d5 (diff) |
-rw-r--r-- | lib/libalpm/add.c | 96 | ||||
-rw-r--r-- | lib/libalpm/alpm.h | 8 | ||||
-rw-r--r-- | lib/libalpm/be_local.c | 38 | ||||
-rw-r--r-- | lib/libalpm/be_package.c | 30 | ||||
-rw-r--r-- | lib/libalpm/be_sync.c | 38 | ||||
-rw-r--r-- | lib/libalpm/conflict.c | 26 | ||||
-rw-r--r-- | lib/libalpm/db.c | 32 | ||||
-rw-r--r-- | lib/libalpm/delta.c | 4 | ||||
-rw-r--r-- | lib/libalpm/deps.c | 32 | ||||
-rw-r--r-- | lib/libalpm/diskspace.c | 22 | ||||
-rw-r--r-- | lib/libalpm/dload.c | 18 | ||||
-rw-r--r-- | lib/libalpm/handle.c | 6 | ||||
-rw-r--r-- | lib/libalpm/remove.c | 64 | ||||
-rw-r--r-- | lib/libalpm/signing.c | 34 | ||||
-rw-r--r-- | lib/libalpm/sync.c | 78 | ||||
-rw-r--r-- | lib/libalpm/trans.c | 12 | ||||
-rw-r--r-- | lib/libalpm/util.c | 50 | ||||
-rw-r--r-- | lib/libalpm/util.h | 4 |
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 4eca6332..df636fbd 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -68,7 +68,7 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) pkgname = pkg->name; pkgver = pkg->version; - _alpm_log(handle, PM_LOG_DEBUG, "adding package '%s'\n", pkgname); + _alpm_log(handle, ALPM_LOG_DEBUG, "adding package '%s'\n", pkgname); if(_alpm_pkg_find(trans->add, pkgname)) { RET_ERR(handle, PM_ERR_TRANS_DUP_TARGET, -1); @@ -83,23 +83,23 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) if(cmp == 0) { if(trans->flags & PM_TRANS_FLAG_NEEDED) { /* with the NEEDED flag, packages up to date are not reinstalled */ - _alpm_log(handle, PM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"), localpkgname, localpkgver); return 0; } else if(!(trans->flags & PM_TRANS_FLAG_DOWNLOADONLY)) { - _alpm_log(handle, PM_LOG_WARNING, _("%s-%s is up to date -- reinstalling\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s-%s is up to date -- reinstalling\n"), localpkgname, localpkgver); } } else if(cmp < 0) { /* local version is newer */ - _alpm_log(handle, PM_LOG_WARNING, _("downgrading package %s (%s => %s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("downgrading package %s (%s => %s)\n"), localpkgname, localpkgver, pkgver); } } /* add the package to the transaction */ pkg->reason = ALPM_PKG_REASON_EXPLICIT; - _alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s to the transaction add list\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s-%s to the transaction add list\n", pkgname, pkgver); trans->add = alpm_list_add(trans->add, pkg); @@ -119,10 +119,10 @@ static int perform_extraction(alpm_handle_t *handle, struct archive *archive, ret = archive_read_extract(archive, entry, archive_flags); if(ret == ARCHIVE_WARN && archive_errno(archive) != ENOSPC) { /* operation succeeded but a "non-critical" error was encountered */ - _alpm_log(handle, PM_LOG_WARNING, _("warning given when extracting %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("warning given when extracting %s (%s)\n"), origname, archive_error_string(archive)); } else if(ret != ARCHIVE_OK) { - _alpm_log(handle, PM_LOG_ERROR, _("could not extract %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not extract %s (%s)\n"), origname, archive_error_string(archive)); alpm_logaction(handle, "error: could not extract %s (%s)\n", origname, archive_error_string(archive)); @@ -160,7 +160,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, } else if(*entryname == '.') { /* for now, ignore all files starting with '.' that haven't * already been handled (for future possibilities) */ - _alpm_log(handle, PM_LOG_DEBUG, "skipping extraction of '%s'\n", entryname); + _alpm_log(handle, ALPM_LOG_DEBUG, "skipping extraction of '%s'\n", entryname); archive_read_data_skip(archive); return 0; } else { @@ -170,7 +170,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* if a file is in NoExtract then we never extract it */ if(alpm_list_find_str(handle->noextract, entryname)) { - _alpm_log(handle, PM_LOG_DEBUG, "%s is in NoExtract, skipping extraction\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoExtract, skipping extraction\n", entryname); alpm_logaction(handle, "note: %s is in NoExtract, skipping extraction\n", entryname); @@ -209,20 +209,20 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, if(lsbuf.st_mode != entrymode) { /* if filesystem perms are different than pkg perms, warn user */ mode_t mask = 07777; - _alpm_log(handle, PM_LOG_WARNING, _("directory permissions differ on %s\n" + _alpm_log(handle, ALPM_LOG_WARNING, _("directory permissions differ on %s\n" "filesystem: %o package: %o\n"), entryname, lsbuf.st_mode & mask, entrymode & mask); alpm_logaction(handle, "warning: directory permissions differ on %s\n" "filesystem: %o package: %o\n", entryname, lsbuf.st_mode & mask, entrymode & mask); } - _alpm_log(handle, PM_LOG_DEBUG, "extract: skipping dir extraction of %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping dir extraction of %s\n", entryname); archive_read_data_skip(archive); return 0; } else { /* case 10/11: trying to overwrite dir with file/symlink, don't allow it */ - _alpm_log(handle, PM_LOG_ERROR, _("extract: not overwriting dir with file %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("extract: not overwriting dir with file %s\n"), entryname); archive_read_data_skip(archive); return 1; @@ -231,20 +231,20 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* case 9: existing symlink, dir in package */ if(S_ISDIR(sbuf.st_mode)) { /* the symlink on FS is to a directory, so we'll use it */ - _alpm_log(handle, PM_LOG_DEBUG, "extract: skipping symlink overwrite of %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "extract: skipping symlink overwrite of %s\n", entryname); archive_read_data_skip(archive); return 0; } else { /* this is BAD. symlink was not to a directory */ - _alpm_log(handle, PM_LOG_ERROR, _("extract: symlink %s does not point to dir\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("extract: symlink %s does not point to dir\n"), entryname); archive_read_data_skip(archive); return 1; } } else if(S_ISREG(lsbuf.st_mode) && S_ISDIR(entrymode)) { /* case 6: trying to overwrite file with dir */ - _alpm_log(handle, PM_LOG_DEBUG, "extract: overwriting file with dir %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "extract: overwriting file with dir %s\n", entryname); } else if(S_ISREG(entrymode)) { /* case 4,7: */ @@ -310,10 +310,10 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, backup->hash = newhash; } - _alpm_log(handle, PM_LOG_DEBUG, "checking hashes for %s\n", entryname_orig); - _alpm_log(handle, PM_LOG_DEBUG, "current: %s\n", hash_local); - _alpm_log(handle, PM_LOG_DEBUG, "new: %s\n", hash_pkg); - _alpm_log(handle, PM_LOG_DEBUG, "original: %s\n", hash_orig); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking hashes for %s\n", entryname_orig); + _alpm_log(handle, ALPM_LOG_DEBUG, "current: %s\n", hash_local); + _alpm_log(handle, ALPM_LOG_DEBUG, "new: %s\n", hash_pkg); + _alpm_log(handle, ALPM_LOG_DEBUG, "original: %s\n", hash_orig); if(!oldpkg) { if(hash_local && hash_pkg && strcmp(hash_local, hash_pkg) != 0) { @@ -324,7 +324,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* move the existing file to the "pacorig" */ if(rename(filename, newpath)) { - _alpm_log(handle, PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), filename, newpath, strerror(errno)); alpm_logaction(handle, "error: could not rename %s to %s (%s)\n", filename, newpath, strerror(errno)); @@ -332,13 +332,13 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, } else { /* rename the file we extracted to the real name */ if(rename(checkfile, filename)) { - _alpm_log(handle, PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), checkfile, filename, strerror(errno)); alpm_logaction(handle, "error: could not rename %s to %s (%s)\n", checkfile, filename, strerror(errno)); errors++; } else { - _alpm_log(handle, PM_LOG_WARNING, _("%s saved as %s\n"), filename, newpath); + _alpm_log(handle, ALPM_LOG_WARNING, _("%s saved as %s\n"), filename, newpath); alpm_logaction(handle, "warning: %s saved as %s\n", filename, newpath); } } @@ -352,11 +352,11 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, if(hash_local && strcmp(hash_orig, hash_local) == 0) { /* installed file has NOT been changed by user */ if(hash_pkg && strcmp(hash_orig, hash_pkg) != 0) { - _alpm_log(handle, PM_LOG_DEBUG, "action: installing new file: %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "action: installing new file: %s\n", entryname_orig); if(rename(checkfile, filename)) { - _alpm_log(handle, PM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not rename %s to %s (%s)\n"), checkfile, filename, strerror(errno)); alpm_logaction(handle, "error: could not rename %s to %s (%s)\n", checkfile, filename, strerror(errno)); @@ -365,33 +365,33 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, } else { /* no sense in installing the same file twice, install * ONLY if the original and package hashes differ */ - _alpm_log(handle, PM_LOG_DEBUG, "action: leaving existing file in place\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "action: leaving existing file in place\n"); unlink(checkfile); } } else if(hash_pkg && strcmp(hash_orig, hash_pkg) == 0) { /* originally installed file and new file are the same - this * implies the case above failed - i.e. the file was changed by a * user */ - _alpm_log(handle, PM_LOG_DEBUG, "action: leaving existing file in place\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "action: leaving existing file in place\n"); unlink(checkfile); } else if(hash_local && hash_pkg && strcmp(hash_local, hash_pkg) == 0) { /* this would be magical. The above two cases failed, but the * user changes just so happened to make the new file exactly the * same as the one in the package... skip it */ - _alpm_log(handle, PM_LOG_DEBUG, "action: leaving existing file in place\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "action: leaving existing file in place\n"); unlink(checkfile); } else { char newpath[PATH_MAX]; - _alpm_log(handle, PM_LOG_DEBUG, "action: keeping current file and installing" + _alpm_log(handle, ALPM_LOG_DEBUG, "action: keeping current file and installing" " new one with .pacnew ending\n"); snprintf(newpath, PATH_MAX, "%s.pacnew", filename); if(rename(checkfile, newpath)) { - _alpm_log(handle, PM_LOG_ERROR, _("could not install %s as %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not install %s as %s (%s)\n"), filename, newpath, strerror(errno)); alpm_logaction(handle, "error: could not install %s as %s (%s)\n", filename, newpath, strerror(errno)); } else { - _alpm_log(handle, PM_LOG_WARNING, _("%s installed as %s\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s installed as %s\n"), filename, newpath); alpm_logaction(handle, "warning: %s installed as %s\n", filename, newpath); @@ -407,12 +407,12 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, /* we didn't need a backup */ if(notouch) { /* change the path to a .pacnew extension */ - _alpm_log(handle, PM_LOG_DEBUG, "%s is in NoUpgrade -- skipping\n", filename); - _alpm_log(handle, PM_LOG_WARNING, _("extracting %s as %s.pacnew\n"), filename, filename); + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in NoUpgrade -- skipping\n", filename); + _alpm_log(handle, ALPM_LOG_WARNING, _("extracting %s as %s.pacnew\n"), filename, filename); alpm_logaction(handle, "warning: extracting %s as %s.pacnew\n", filename, filename); strncat(filename, ".pacnew", PATH_MAX - strlen(filename)); } else { - _alpm_log(handle, PM_LOG_DEBUG, "extracting %s\n", filename); + _alpm_log(handle, ALPM_LOG_DEBUG, "extracting %s\n", filename); } if(handle->trans->flags & PM_TRANS_FLAG_FORCE) { @@ -437,7 +437,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive, if(!backup->name || strcmp(backup->name, entryname_orig) != 0) { continue; } - _alpm_log(handle, PM_LOG_DEBUG, "appending backup entry for %s\n", entryname_orig); + _alpm_log(handle, ALPM_LOG_DEBUG, "appending backup entry for %s\n", entryname_orig); newhash = alpm_compute_md5sum(filename); FREE(backup->hash); backup->hash = newhash; @@ -472,7 +472,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, oldpkg = _alpm_pkg_dup(local); EVENT(trans, PM_TRANS_EVT_UPGRADE_START, newpkg, oldpkg); - _alpm_log(handle, PM_LOG_DEBUG, "upgrading package %s-%s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "upgrading package %s-%s\n", newpkg->name, newpkg->version); /* copy over the install reason */ @@ -487,7 +487,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, is_upgrade = 0; EVENT(trans, PM_TRANS_EVT_ADD_START, newpkg, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s-%s\n", newpkg->name, newpkg->version); /* pre_install scriptlet */ @@ -529,7 +529,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, char cwd[PATH_MAX] = ""; int restore_cwd = 0; - _alpm_log(handle, PM_LOG_DEBUG, "extracting files\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "extracting files\n"); if((archive = archive_read_new()) == NULL) { handle->pm_errno = PM_ERR_LIBARCHIVE; @@ -540,7 +540,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, archive_read_support_compression_all(archive); archive_read_support_format_all(archive); - _alpm_log(handle, PM_LOG_DEBUG, "archive: %s\n", newpkg->origin_data.file); + _alpm_log(handle, ALPM_LOG_DEBUG, "archive: %s\n", newpkg->origin_data.file); if(archive_read_open_filename(archive, newpkg->origin_data.file, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) { handle->pm_errno = PM_ERR_PKG_OPEN; @@ -550,14 +550,14 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, /* save the cwd so we can restore it later */ if(getcwd(cwd, PATH_MAX) == NULL) { - _alpm_log(handle, PM_LOG_ERROR, _("could not get current working directory\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not get current working directory\n")); } else { restore_cwd = 1; } /* libarchive requires this for extracting hard links */ if(chdir(handle->root) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("could not change directory to %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), handle->root, strerror(errno)); ret = -1; goto cleanup; @@ -581,7 +581,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, * (missing metadata sizes) */ int64_t pos = archive_position_compressed(archive); percent = (pos * 100) / newpkg->size; - _alpm_log(handle, PM_LOG_DEBUG, "decompression progress: " + _alpm_log(handle, ALPM_LOG_DEBUG, "decompression progress: " "%d%% (%"PRId64" / %jd)\n", percent, pos, (intmax_t)newpkg->size); if(percent >= 100) { @@ -608,18 +608,18 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, /* restore the old cwd if we have it */ if(restore_cwd && chdir(cwd) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("could not change directory to %s (%s)\n"), cwd, strerror(errno)); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), cwd, strerror(errno)); } if(errors) { ret = -1; if(is_upgrade) { - _alpm_log(handle, PM_LOG_ERROR, _("problem occurred while upgrading %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("problem occurred while upgrading %s\n"), newpkg->name); alpm_logaction(handle, "error: problem occurred while upgrading %s\n", newpkg->name); } else { - _alpm_log(handle, PM_LOG_ERROR, _("problem occurred while installing %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("problem occurred while installing %s\n"), newpkg->name); alpm_logaction(handle, "error: problem occurred while installing %s\n", newpkg->name); @@ -630,11 +630,11 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, /* make an install date (in UTC) */ newpkg->installdate = time(NULL); - _alpm_log(handle, PM_LOG_DEBUG, "updating database\n"); - _alpm_log(handle, PM_LOG_DEBUG, "adding database entry '%s'\n", newpkg->name); + _alpm_log(handle, ALPM_LOG_DEBUG, "updating database\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "adding database entry '%s'\n", newpkg->name); if(_alpm_local_db_write(db, newpkg, INFRQ_ALL)) { - _alpm_log(handle, PM_LOG_ERROR, _("could not update database entry %s-%s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not update database entry %s-%s\n"), alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg)); alpm_logaction(handle, "error: could not update database entry %s-%s\n", alpm_pkg_get_name(newpkg), alpm_pkg_get_version(newpkg)); @@ -644,7 +644,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg, } if(_alpm_db_add_pkgincache(db, newpkg) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not add entry '%s' in cache\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not add entry '%s' in cache\n"), alpm_pkg_get_name(newpkg)); } diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index d0e2d3dd..f7e355d2 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -174,10 +174,10 @@ typedef struct _alpm_backup_t { * Logging Levels */ typedef enum _alpm_loglevel_t { - PM_LOG_ERROR = 1, - PM_LOG_WARNING = (1 << 1), - PM_LOG_DEBUG = (1 << 2), - PM_LOG_FUNCTION = (1 << 3) + ALPM_LOG_ERROR = 1, + ALPM_LOG_WARNING = (1 << 1), + ALPM_LOG_DEBUG = (1 << 2), + ALPM_LOG_FUNCTION = (1 << 3) } alpm_loglevel_t; typedef void (*alpm_cb_log)(alpm_loglevel_t, const char *, va_list); 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) { diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index a4c6c559..57f01233 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -158,7 +158,7 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t * ptr = line; key = strsep(&ptr, "="); if(key == NULL || ptr == NULL) { - _alpm_log(handle, PM_LOG_DEBUG, "%s: syntax error in description file line %d\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "%s: syntax error in description file line %d\n", newpkg->name ? newpkg->name : "error", linenum); } else { key = _alpm_strtrim(key); @@ -209,14 +209,14 @@ static int parse_descfile(alpm_handle_t *handle, struct archive *a, alpm_pkg_t * } else if(strcmp(key, "makepkgopt") == 0) { /* not used atm */ } else { - _alpm_log(handle, PM_LOG_DEBUG, "%s: unknown key '%s' in description file line %d\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "%s: unknown key '%s' in description file line %d\n", newpkg->name ? newpkg->name : "error", key, linenum); } } line[0] = '\0'; } if(ret != ARCHIVE_EOF) { - _alpm_log(handle, PM_LOG_DEBUG, "error parsing package descfile\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "error parsing package descfile\n"); return -1; } @@ -261,18 +261,18 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, } /* first steps- validate the package file */ - _alpm_log(handle, PM_LOG_DEBUG, "md5sum: %s\n", md5sum); + _alpm_log(handle, ALPM_LOG_DEBUG, "md5sum: %s\n", md5sum); if(md5sum) { - _alpm_log(handle, PM_LOG_DEBUG, "checking md5sum for %s\n", pkgfile); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking md5sum for %s\n", pkgfile); if(_alpm_test_md5sum(pkgfile, md5sum) != 0) { alpm_pkg_free(newpkg); RET_ERR(handle, PM_ERR_PKG_INVALID, NULL); } } - _alpm_log(handle, PM_LOG_DEBUG, "base64_sig: %s\n", base64_sig); + _alpm_log(handle, ALPM_LOG_DEBUG, "base64_sig: %s\n", base64_sig); if(check_sig != PM_PGP_VERIFY_NEVER) { - _alpm_log(handle, PM_LOG_DEBUG, "checking signature for %s\n", pkgfile); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking signature for %s\n", pkgfile); ret = _alpm_gpgme_checksig(handle, pkgfile, base64_sig); if((check_sig == PM_PGP_VERIFY_ALWAYS && ret != 0) || (check_sig == PM_PGP_VERIFY_OPTIONAL && ret == 1)) { @@ -296,7 +296,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, RET_ERR(handle, PM_ERR_PKG_OPEN, NULL); } - _alpm_log(handle, PM_LOG_DEBUG, "starting package load for %s\n", pkgfile); + _alpm_log(handle, ALPM_LOG_DEBUG, "starting package load for %s\n", pkgfile); /* If full is false, only read through the archive until we find our needed * metadata. If it is true, read through the entire archive, which serves @@ -307,16 +307,16 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, if(strcmp(entry_name, ".PKGINFO") == 0) { /* parse the info file */ if(parse_descfile(handle, archive, newpkg) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("could not parse package description file in %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not parse package description file in %s\n"), pkgfile); goto pkg_invalid; } if(newpkg->name == NULL || strlen(newpkg->name) == 0) { - _alpm_log(handle, PM_LOG_ERROR, _("missing package name in %s\n"), pkgfile); + _alpm_log(handle, ALPM_LOG_ERROR, _("missing package name in %s\n"), pkgfile); goto pkg_invalid; } if(newpkg->version == NULL || strlen(newpkg->version) == 0) { - _alpm_log(handle, PM_LOG_ERROR, _("missing package version in %s\n"), pkgfile); + _alpm_log(handle, ALPM_LOG_ERROR, _("missing package version in %s\n"), pkgfile); goto pkg_invalid; } config = 1; @@ -333,7 +333,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, } if(archive_read_data_skip(archive)) { - _alpm_log(handle, PM_LOG_ERROR, _("error while reading package %s: %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("error while reading package %s: %s\n"), pkgfile, archive_error_string(archive)); handle->pm_errno = PM_ERR_LIBARCHIVE; goto error; @@ -346,14 +346,14 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, } if(ret != ARCHIVE_EOF && ret != ARCHIVE_OK) { /* An error occured */ - _alpm_log(handle, PM_LOG_ERROR, _("error while reading package %s: %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("error while reading package %s: %s\n"), pkgfile, archive_error_string(archive)); handle->pm_errno = PM_ERR_LIBARCHIVE; goto error; } if(!config) { - _alpm_log(handle, PM_LOG_ERROR, _("missing package metadata in %s\n"), pkgfile); + _alpm_log(handle, ALPM_LOG_ERROR, _("missing package metadata in %s\n"), pkgfile); goto pkg_invalid; } @@ -367,7 +367,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, if(full) { /* "checking for conflicts" requires a sorted list, ensure that here */ - _alpm_log(handle, PM_LOG_DEBUG, "sorting package filelist for %s\n", pkgfile); + _alpm_log(handle, ALPM_LOG_DEBUG, "sorting package filelist for %s\n", pkgfile); newpkg->files = alpm_list_msort(newpkg->files, files_count, _alpm_str_cmp); newpkg->infolevel = INFRQ_ALL; } else { 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) { diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 615cd0c1..7324e34e 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -107,7 +107,7 @@ static int add_conflict(alpm_handle_t *handle, alpm_list_t **baddeps, if(!conflict) { return -1; } - _alpm_log(handle, PM_LOG_DEBUG, "package %s conflicts with %s (by %s)\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "package %s conflicts with %s (by %s)\n", pkg1, pkg2, reason); if(!conflict_isin(conflict, *baddeps)) { *baddeps = alpm_list_add(*baddeps, conflict); @@ -174,7 +174,7 @@ alpm_list_t *_alpm_innerconflicts(alpm_handle_t *handle, alpm_list_t *packages) { alpm_list_t *baddeps = NULL; - _alpm_log(handle, PM_LOG_DEBUG, "check targets vs targets\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "check targets vs targets\n"); check_conflict(handle, packages, packages, &baddeps, 0); return baddeps; @@ -196,9 +196,9 @@ alpm_list_t *_alpm_outerconflicts(alpm_db_t *db, alpm_list_t *packages) packages, _alpm_pkg_cmp); /* two checks to be done here for conflicts */ - _alpm_log(db->handle, PM_LOG_DEBUG, "check targets vs db\n"); + _alpm_log(db->handle, ALPM_LOG_DEBUG, "check targets vs db\n"); check_conflict(db->handle, packages, dblist, &baddeps, 1); - _alpm_log(db->handle, PM_LOG_DEBUG, "check db vs targets\n"); + _alpm_log(db->handle, ALPM_LOG_DEBUG, "check db vs targets\n"); check_conflict(db->handle, dblist, packages, &baddeps, -1); alpm_list_free(dblist); @@ -297,7 +297,7 @@ static alpm_list_t *add_fileconflict(alpm_handle_t *handle, } conflicts = alpm_list_add(conflicts, conflict); - _alpm_log(handle, PM_LOG_DEBUG, "found file conflict %s, packages %s and %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "found file conflict %s, packages %s and %s\n", filestr, name1, name2 ? name2 : "(filesystem)"); return conflicts; @@ -392,7 +392,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, PROGRESS(trans, PM_TRANS_PROGRESS_CONFLICTS_START, "", percent, numtargs, current); /* CHECK 1: check every target against every target */ - _alpm_log(handle, PM_LOG_DEBUG, "searching for file conflicts: %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "searching for file conflicts: %s\n", alpm_pkg_get_name(p1)); for(j = i->next; j; j = j->next) { alpm_list_t *common_files; @@ -420,7 +420,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, } /* CHECK 2: check every target against the filesystem */ - _alpm_log(handle, PM_LOG_DEBUG, "searching for filesystem conflicts: %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "searching for filesystem conflicts: %s\n", p1->name); dbpkg = _alpm_db_get_pkgfromcache(handle->db_local, p1->name); @@ -454,12 +454,12 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, if(path[strlen(path) - 1] == '/') { struct stat sbuf; if(S_ISDIR(lsbuf.st_mode)) { - _alpm_log(handle, PM_LOG_DEBUG, "%s is a directory, not a conflict\n", path); + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is a directory, not a conflict\n", path); continue; } stat(path, &sbuf); if(S_ISLNK(lsbuf.st_mode) && S_ISDIR(sbuf.st_mode)) { - _alpm_log(handle, PM_LOG_DEBUG, + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is a symlink to a dir, hopefully not a conflict\n", path); continue; } @@ -469,14 +469,14 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, path[strlen(path) - 1] = '\0'; } - _alpm_log(handle, PM_LOG_DEBUG, "checking possible conflict: %s\n", path); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking possible conflict: %s\n", path); relative_path = path + strlen(handle->root); /* Check remove list (will we remove the conflicting local file?) */ for(k = remove; k && !resolved_conflict; k = k->next) { alpm_pkg_t *rempkg = k->data; if(alpm_list_find_str(alpm_pkg_get_files(rempkg), relative_path)) { - _alpm_log(handle, PM_LOG_DEBUG, + _alpm_log(handle, ALPM_LOG_DEBUG, "local file will be removed, not a conflict: %s\n", relative_path); resolved_conflict = 1; @@ -498,7 +498,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, * by its new owner (whether the file is in backup array or not */ handle->trans->skip_remove = alpm_list_add(handle->trans->skip_remove, strdup(filestr)); - _alpm_log(handle, PM_LOG_DEBUG, + _alpm_log(handle, ALPM_LOG_DEBUG, "file changed packages, adding to remove skiplist: %s\n", filestr); resolved_conflict = 1; @@ -510,7 +510,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle, char *dir = malloc(strlen(filestr) + 2); sprintf(dir, "%s/", filestr); if(alpm_list_find_str(alpm_pkg_get_files(dbpkg),dir)) { - _alpm_log(handle, PM_LOG_DEBUG, + _alpm_log(handle, ALPM_LOG_DEBUG, "check if all files in %s belongs to %s\n", dir, dbpkg->name); resolved_conflict = dir_belongsto_pkg(handle->root, filestr, dbpkg); diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 6c1b95c0..b7f0c9a3 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -65,7 +65,7 @@ void _alpm_db_unregister(alpm_db_t *db) return; } - _alpm_log(db->handle, PM_LOG_DEBUG, "unregistering database '%s'\n", db->treename); + _alpm_log(db->handle, ALPM_LOG_DEBUG, "unregistering database '%s'\n", db->treename); _alpm_db_free(db); } @@ -175,7 +175,7 @@ int SYMEXPORT alpm_db_add_server(alpm_db_t *db, const char *url) return -1; } db->servers = alpm_list_add(db->servers, newurl); - _alpm_log(db->handle, PM_LOG_DEBUG, "adding new server URL to database '%s': %s\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "adding new server URL to database '%s': %s\n", db->treename, newurl); return 0; @@ -203,7 +203,7 @@ int SYMEXPORT alpm_db_remove_server(alpm_db_t *db, const char *url) db->servers = alpm_list_remove_str(db->servers, newurl, &vdata); free(newurl); if(vdata) { - _alpm_log(db->handle, PM_LOG_DEBUG, "removed server URL from database '%s': %s\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "removed server URL from database '%s': %s\n", db->treename, newurl); free(vdata); return 0; @@ -299,7 +299,7 @@ int SYMEXPORT alpm_db_set_pkgreason(alpm_db_t *db, const char *name, alpm_pkgrea RET_ERR(db->handle, PM_ERR_PKG_NOT_FOUND, -1); } - _alpm_log(db->handle, PM_LOG_DEBUG, "setting install reason %u for %s/%s\n", reason, db->treename, name); + _alpm_log(db->handle, ALPM_LOG_DEBUG, "setting install reason %u for %s/%s\n", reason, db->treename, name); if(alpm_pkg_get_reason(pkg) == reason) { /* we are done */ return 0; @@ -352,7 +352,7 @@ const char *_alpm_db_path(alpm_db_t *db) dbpath = alpm_option_get_dbpath(db->handle); if(!dbpath) { - _alpm_log(db->handle, PM_LOG_ERROR, _("database path is undefined\n")); + _alpm_log(db->handle, ALPM_LOG_ERROR, _("database path is undefined\n")); RET_ERR(db->handle, PM_ERR_DB_OPEN, NULL); } @@ -366,7 +366,7 @@ const char *_alpm_db_path(alpm_db_t *db) /* all sync DBs now reside in the sync/ subdir of the dbpath */ sprintf(db->_path, "%ssync/%s.db", dbpath, db->treename); } - _alpm_log(db->handle, PM_LOG_DEBUG, "database path for tree %s set to %s\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "database path for tree %s set to %s\n", db->treename, db->_path); } return db->_path; @@ -409,7 +409,7 @@ alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles) } ret = NULL; targ = i->data; - _alpm_log(db->handle, PM_LOG_DEBUG, "searching for target '%s'\n", targ); + _alpm_log(db->handle, ALPM_LOG_DEBUG, "searching for target '%s'\n", targ); if(regcomp(®, targ, REG_EXTENDED | REG_NOSUB | REG_ICASE | REG_NEWLINE) != 0) { RET_ERR(db->handle, PM_ERR_INVALID_REGEX, NULL); @@ -451,7 +451,7 @@ alpm_list_t *_alpm_db_search(alpm_db_t *db, const alpm_list_t *needles) } if(matched != NULL) { - _alpm_log(db->handle, PM_LOG_DEBUG, " search target '%s' matched '%s'\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, " search target '%s' matched '%s'\n", targ, matched); ret = alpm_list_add(ret, pkg); } @@ -474,10 +474,10 @@ static int load_pkgcache(alpm_db_t *db) { _alpm_db_free_pkgcache(db); - _alpm_log(db->handle, PM_LOG_DEBUG, "loading package cache for repository '%s'\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "loading package cache for repository '%s'\n", db->treename); if(db->ops->populate(db) == -1) { - _alpm_log(db->handle, PM_LOG_DEBUG, + _alpm_log(db->handle, ALPM_LOG_DEBUG, "failed to load package cache for repository '%s'\n", db->treename); return -1; } @@ -492,7 +492,7 @@ void _alpm_db_free_pkgcache(alpm_db_t *db) return; } - _alpm_log(db->handle, PM_LOG_DEBUG, + _alpm_log(db->handle, ALPM_LOG_DEBUG, "freeing package cache for repository '%s'\n", db->treename); alpm_list_free_inner(_alpm_db_get_pkgcache(db), @@ -545,7 +545,7 @@ int _alpm_db_add_pkgincache(alpm_db_t *db, alpm_pkg_t *pkg) return -1; } - _alpm_log(db->handle, PM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "adding entry '%s' in '%s' cache\n", alpm_pkg_get_name(newpkg), db->treename); db->pkgcache = _alpm_pkghash_add_sorted(db->pkgcache, newpkg); @@ -562,13 +562,13 @@ int _alpm_db_remove_pkgfromcache(alpm_db_t *db, alpm_pkg_t *pkg) return -1; } - _alpm_log(db->handle, PM_LOG_DEBUG, "removing entry '%s' from '%s' cache\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "removing entry '%s' from '%s' cache\n", alpm_pkg_get_name(pkg), db->treename); db->pkgcache = _alpm_pkghash_remove(db->pkgcache, pkg, &data); if(data == NULL) { /* package not found */ - _alpm_log(db->handle, PM_LOG_DEBUG, "cannot remove entry '%s' from '%s' cache: not found\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "cannot remove entry '%s' from '%s' cache: not found\n", alpm_pkg_get_name(pkg), db->treename); return -1; } @@ -604,7 +604,7 @@ static int load_grpcache(alpm_db_t *db) return -1; } - _alpm_log(db->handle, PM_LOG_DEBUG, "loading group cache for repository '%s'\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "loading group cache for repository '%s'\n", db->treename); for(lp = _alpm_db_get_pkgcache(db); lp; lp = lp->next) { @@ -654,7 +654,7 @@ void _alpm_db_free_groupcache(alpm_db_t *db) return; } - _alpm_log(db->handle, PM_LOG_DEBUG, + _alpm_log(db->handle, ALPM_LOG_DEBUG, "freeing group cache for repository '%s'\n", db->treename); for(lg = db->grpcache; lg; lg = lg->next) { diff --git a/lib/libalpm/delta.c b/lib/libalpm/delta.c index d2c2fe80..1b7e3eec 100644 --- a/lib/libalpm/delta.c +++ b/lib/libalpm/delta.c @@ -198,14 +198,14 @@ off_t _alpm_shortest_delta_path(alpm_handle_t *handle, alpm_list_t *deltas, return bestsize; } - _alpm_log(handle, PM_LOG_DEBUG, "started delta shortest-path search for '%s'\n", to); + _alpm_log(handle, ALPM_LOG_DEBUG, "started delta shortest-path search for '%s'\n", to); vertices = graph_init(deltas, 0); graph_init_size(handle, vertices); dijkstra(vertices); bestsize = shortest_path(vertices, to, &bestpath); - _alpm_log(handle, PM_LOG_DEBUG, "delta shortest-path search complete : '%jd'\n", (intmax_t)bestsize); + _alpm_log(handle, ALPM_LOG_DEBUG, "delta shortest-path search complete : '%jd'\n", (intmax_t)bestsize); alpm_list_free_inner(vertices, _alpm_graph_free); alpm_list_free(vertices); diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c index dd08e795..874787f5 100644 --- a/lib/libalpm/deps.c +++ b/lib/libalpm/deps.c @@ -138,7 +138,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, return NULL; } - _alpm_log(handle, PM_LOG_DEBUG, "started sorting dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "started sorting dependencies\n"); vertices = dep_graph_init(targets); @@ -161,13 +161,13 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, alpm_pkg_t *childpkg = nextchild->data; const char *message; - _alpm_log(handle, PM_LOG_WARNING, _("dependency cycle detected:\n")); + _alpm_log(handle, ALPM_LOG_WARNING, _("dependency cycle detected:\n")); if(reverse) { message =_("%s will be removed after its %s dependency\n"); } else { message =_("%s will be installed before its %s dependency\n"); } - _alpm_log(handle, PM_LOG_WARNING, message, vertexpkg->name, childpkg->name); + _alpm_log(handle, ALPM_LOG_WARNING, message, vertexpkg->name, childpkg->name); } } if(!found) { @@ -186,7 +186,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle, } } - _alpm_log(handle, PM_LOG_DEBUG, "sorting dependencies finished\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "sorting dependencies finished\n"); if(reverse) { /* reverse the order */ @@ -291,7 +291,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis /* look for unsatisfied dependencies of the upgrade list */ for(i = upgrade; i; i = i->next) { alpm_pkg_t *tp = i->data; - _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: package %s-%s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "checkdeps: package %s-%s\n", alpm_pkg_get_name(tp), alpm_pkg_get_version(tp)); for(j = alpm_pkg_get_depends(tp); j; j = j->next) { @@ -304,7 +304,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis /* Unsatisfied dependency in the upgrade list */ alpm_depmissing_t *miss; char *missdepstring = alpm_dep_compute_string(depend); - _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: missing dependency '%s' for package '%s'\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "checkdeps: missing dependency '%s' for package '%s'\n", missdepstring, alpm_pkg_get_name(tp)); free(missdepstring); miss = depmiss_new(alpm_pkg_get_name(tp), depend, NULL); @@ -331,7 +331,7 @@ alpm_list_t SYMEXPORT *alpm_checkdeps(alpm_handle_t *handle, alpm_list_t *pkglis !find_dep_satisfier(dblist, depend)) { alpm_depmissing_t *miss; char *missdepstring = alpm_dep_compute_string(depend); - _alpm_log(handle, PM_LOG_DEBUG, "checkdeps: transaction would break '%s' dependency of '%s'\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "checkdeps: transaction would break '%s' dependency of '%s'\n", missdepstring, alpm_pkg_get_name(lp)); free(missdepstring); miss = depmiss_new(lp->name, depend, alpm_pkg_get_name(causingpkg)); @@ -484,7 +484,7 @@ static int can_remove_package(alpm_db_t *db, alpm_pkg_t *pkg, alpm_list_t *targe if(!include_explicit) { /* see if it was explicitly installed */ if(alpm_pkg_get_reason(pkg) == ALPM_PKG_REASON_EXPLICIT) { - _alpm_log(db->handle, PM_LOG_DEBUG, "excluding %s -- explicitly installed\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "excluding %s -- explicitly installed\n", alpm_pkg_get_name(pkg)); return 0; } @@ -532,7 +532,7 @@ void _alpm_recursedeps(alpm_db_t *db, alpm_list_t *targs, int include_explicit) alpm_pkg_t *deppkg = j->data; if(_alpm_dep_edge(pkg, deppkg) && can_remove_package(db, deppkg, targs, include_explicit)) { - _alpm_log(db->handle, PM_LOG_DEBUG, "adding '%s' to the targets\n", + _alpm_log(db->handle, ALPM_LOG_DEBUG, "adding '%s' to the targets\n", alpm_pkg_get_name(deppkg)); /* add it to the target list */ targs = alpm_list_add(targs, _alpm_pkg_dup(deppkg)); @@ -573,7 +573,7 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, NULL, NULL, &install); } else { - _alpm_log(handle, PM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); + _alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); } if(!install) { ignored = 1; @@ -595,14 +595,14 @@ static alpm_pkg_t *resolvedep(alpm_handle_t *handle, alpm_depend_t *dep, QUESTION(handle->trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, pkg, NULL, NULL, &install); } else { - _alpm_log(handle, PM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); + _alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package %s-%s\n"), pkg->name, pkg->version); } if(!install) { ignored = 1; continue; } } - _alpm_log(handle, PM_LOG_DEBUG, "provider found (%s provides %s)\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "provider found (%s provides %s)\n", pkg->name, dep->name); providers = alpm_list_add(providers, pkg); /* keep looking for other providers in the all dbs */ @@ -710,7 +710,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t on that list */ *packages = alpm_list_add(*packages, pkg); - _alpm_log(handle, PM_LOG_DEBUG, "started resolving dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "started resolving dependencies\n"); for(i = alpm_list_last(*packages); i; i = i->next) { alpm_pkg_t *tpkg = i->data; targ = alpm_list_add(NULL, tpkg); @@ -736,7 +736,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t if(!spkg) { handle->pm_errno = PM_ERR_UNSATISFIED_DEPS; char *missdepstring = alpm_dep_compute_string(missdep); - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("cannot resolve \"%s\", a dependency of \"%s\"\n"), missdepstring, tpkg->name); free(missdepstring); @@ -745,7 +745,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t } ret = -1; } else { - _alpm_log(handle, PM_LOG_DEBUG, "pulling dependency %s (needed by %s)\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "pulling dependency %s (needed by %s)\n", alpm_pkg_get_name(spkg), alpm_pkg_get_name(tpkg)); *packages = alpm_list_add(*packages, spkg); _alpm_depmiss_free(miss); @@ -760,7 +760,7 @@ int _alpm_resolvedeps(alpm_handle_t *handle, alpm_list_t *localpkgs, alpm_pkg_t } else { alpm_list_free(packages_copy); } - _alpm_log(handle, PM_LOG_DEBUG, "finished resolving dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "finished resolving dependencies\n"); return ret; } diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index 7ca72c3c..f0e22a68 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -77,11 +77,11 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) while((mnt = getmntent(fp))) { if(!mnt) { - _alpm_log(handle, PM_LOG_WARNING, _("could not get filesystem information\n")); + _alpm_log(handle, ALPM_LOG_WARNING, _("could not get filesystem information\n")); continue; } if(statvfs(mnt->mnt_dir, &fsp) != 0) { - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("could not get filesystem information for %s: %s\n"), mnt->mnt_dir, strerror(errno)); continue; @@ -126,7 +126,7 @@ static alpm_list_t *mount_point_list(alpm_handle_t *handle) mount_point_cmp); for(ptr = mount_points; ptr != NULL; ptr = ptr->next) { mp = ptr->data; - _alpm_log(handle, PM_LOG_DEBUG, "mountpoint: %s\n", mp->mount_dir); + _alpm_log(handle, ALPM_LOG_DEBUG, "mountpoint: %s\n", mp->mount_dir); } return mount_points; } @@ -171,7 +171,7 @@ static int calculate_removed_size(alpm_handle_t *handle, mp = match_mount_point(mount_points, path); if(mp == NULL) { - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("could not determine mount point for file %s\n"), filename); continue; } @@ -233,7 +233,7 @@ static int calculate_installed_size(alpm_handle_t *handle, mp = match_mount_point(mount_points, path); if(mp == NULL) { - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("could not determine mount point for file %s\n"), filename); continue; } @@ -244,7 +244,7 @@ static int calculate_installed_size(alpm_handle_t *handle, mp->used |= USED_INSTALL; if(archive_read_data_skip(archive)) { - _alpm_log(handle, PM_LOG_ERROR, _("error while reading package %s: %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("error while reading package %s: %s\n"), pkg->name, archive_error_string(archive)); handle->pm_errno = PM_ERR_LIBARCHIVE; break; @@ -269,12 +269,12 @@ int _alpm_check_diskspace(alpm_handle_t *handle) numtargs = alpm_list_count(trans->add); mount_points = mount_point_list(handle); if(mount_points == NULL) { - _alpm_log(handle, PM_LOG_ERROR, _("could not determine filesystem mount points\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not determine filesystem mount points\n")); return -1; } root_mp = match_mount_point(mount_points, handle->root); if(root_mp == NULL) { - _alpm_log(handle, PM_LOG_ERROR, _("could not determine root mount point %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not determine root mount point %s\n"), handle->root); return -1; } @@ -321,7 +321,7 @@ int _alpm_check_diskspace(alpm_handle_t *handle) for(i = mount_points; i; i = alpm_list_next(i)) { alpm_mountpoint_t *data = i->data; if(data->used && data->read_only) { - _alpm_log(handle, PM_LOG_ERROR, _("Partition %s is mounted read only\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("Partition %s is mounted read only\n"), data->mount_dir); error = 1; } else if(data->used & USED_INSTALL) { @@ -330,12 +330,12 @@ int _alpm_check_diskspace(alpm_handle_t *handle) long twentymb = (20 * 1024 * 1024 / (long)data->fsp.f_bsize) + 1; long cushion = fivepc < twentymb ? fivepc : twentymb; - _alpm_log(handle, PM_LOG_DEBUG, "partition %s, needed %ld, cushion %ld, free %ld\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "partition %s, needed %ld, cushion %ld, free %ld\n", data->mount_dir, data->max_blocks_needed, cushion, (unsigned long)data->fsp.f_bfree); if(data->max_blocks_needed + cushion >= 0 && (unsigned long)(data->max_blocks_needed + cushion) > data->fsp.f_bfree) { - _alpm_log(handle, PM_LOG_ERROR, _("Partition %s too full: %ld blocks needed, %ld blocks free\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("Partition %s too full: %ld blocks needed, %ld blocks free\n"), data->mount_dir, data->max_blocks_needed + cushion, (unsigned long)data->fsp.f_bfree); error = 1; diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index fd83aac0..0a9a81ad 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -171,7 +171,7 @@ static int curl_download_internal(alpm_handle_t *handle, dlfile.initial_size = 0.0; dlfile.filename = get_filename(url); if(!dlfile.filename || curl_gethost(url, hostname) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("url '%s' is invalid\n"), url); + _alpm_log(handle, ALPM_LOG_ERROR, _("url '%s' is invalid\n"), url); RET_ERR(handle, PM_ERR_SERVER_BAD_URL, -1); } @@ -211,7 +211,7 @@ static int curl_download_internal(alpm_handle_t *handle, /* a previous partial download exists, resume from end of file. */ open_mode = "ab"; curl_easy_setopt(handle->curl, CURLOPT_RESUME_FROM, (long)st.st_size); - _alpm_log(handle, PM_LOG_DEBUG, "tempfile found, attempting continuation"); + _alpm_log(handle, ALPM_LOG_DEBUG, "tempfile found, attempting continuation"); dlfile.initial_size = (double)st.st_size; } @@ -249,10 +249,10 @@ static int curl_download_internal(alpm_handle_t *handle, } else if(handle->curlerr != CURLE_OK) { if(!errors_ok) { handle->pm_errno = PM_ERR_LIBCURL; - _alpm_log(handle, PM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"), dlfile.filename, hostname, error_buffer); } else { - _alpm_log(handle, PM_LOG_DEBUG, "failed retrieving file '%s' from %s : %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "failed retrieving file '%s' from %s : %s\n", dlfile.filename, hostname, error_buffer); } unlink(tempfile); @@ -279,7 +279,7 @@ static int curl_download_internal(alpm_handle_t *handle, if(!DOUBLE_EQ(remote_size, -1) && !DOUBLE_EQ(bytes_dl, -1) && !DOUBLE_EQ(bytes_dl, remote_size)) { handle->pm_errno = PM_ERR_RETRIEVE; - _alpm_log(handle, PM_LOG_ERROR, _("%s appears to be truncated: %jd/%jd bytes\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("%s appears to be truncated: %jd/%jd bytes\n"), dlfile.filename, (intmax_t)bytes_dl, (intmax_t)remote_size); goto cleanup; } @@ -357,10 +357,10 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url) /* download the file */ ret = _alpm_download(handle, url, cachedir, 0, 1, 0); if(ret == -1) { - _alpm_log(handle, PM_LOG_WARNING, _("failed to download %s\n"), url); + _alpm_log(handle, ALPM_LOG_WARNING, _("failed to download %s\n"), url); return NULL; } - _alpm_log(handle, PM_LOG_DEBUG, "successfully downloaded %s\n", url); + _alpm_log(handle, ALPM_LOG_DEBUG, "successfully downloaded %s\n", url); /* attempt to download the signature */ if(ret == 0 && (handle->sigverify == PM_PGP_VERIFY_ALWAYS || @@ -375,11 +375,11 @@ char SYMEXPORT *alpm_fetch_pkgurl(alpm_handle_t *handle, const char *url) ret = _alpm_download(handle, sig_url, cachedir, 1, 0, errors_ok); if(ret == -1 && !errors_ok) { - _alpm_log(handle, PM_LOG_WARNING, _("failed to download %s\n"), sig_url); + _alpm_log(handle, ALPM_LOG_WARNING, _("failed to download %s\n"), sig_url); /* Warn now, but don't return NULL. We will fail later during package * load time. */ } else if(ret == 0) { - _alpm_log(handle, PM_LOG_DEBUG, "successfully downloaded %s\n", sig_url); + _alpm_log(handle, ALPM_LOG_DEBUG, "successfully downloaded %s\n", sig_url); } FREE(sig_url); } diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 8486851f..66fb935b 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -351,7 +351,7 @@ int SYMEXPORT alpm_option_add_cachedir(alpm_handle_t *handle, const char *cached RET_ERR(handle, PM_ERR_MEMORY, -1); } handle->cachedirs = alpm_list_add(handle->cachedirs, newcachedir); - _alpm_log(handle, PM_LOG_DEBUG, "option 'cachedir' = %s\n", newcachedir); + _alpm_log(handle, ALPM_LOG_DEBUG, "option 'cachedir' = %s\n", newcachedir); return 0; } @@ -412,7 +412,7 @@ int SYMEXPORT alpm_option_set_logfile(alpm_handle_t *handle, const char *logfile fclose(handle->logstream); handle->logstream = NULL; } - _alpm_log(handle, PM_LOG_DEBUG, "option 'logfile' = %s\n", handle->logfile); + _alpm_log(handle, ALPM_LOG_DEBUG, "option 'logfile' = %s\n", handle->logfile); return 0; } @@ -429,7 +429,7 @@ int SYMEXPORT alpm_option_set_gpgdir(alpm_handle_t *handle, const char *gpgdir) } handle->gpgdir = strdup(gpgdir); - _alpm_log(handle, PM_LOG_DEBUG, "option 'gpgdir' = %s\n", handle->gpgdir); + _alpm_log(handle, ALPM_LOG_DEBUG, "option 'gpgdir' = %s\n", handle->gpgdir); return 0; } diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 86571a4f..4c0d4791 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -64,7 +64,7 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) RET_ERR(handle, PM_ERR_TRANS_DUP_TARGET, -1); } - _alpm_log(handle, PM_LOG_DEBUG, "adding package %s to the transaction remove list\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s to the transaction remove list\n", pkgname); trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(pkg)); return 0; @@ -81,12 +81,12 @@ static void remove_prepare_cascade(alpm_handle_t *handle, alpm_list_t *lp) alpm_pkg_t *info = _alpm_db_get_pkgfromcache(handle->db_local, miss->target); if(info) { if(!_alpm_pkg_find(trans->remove, alpm_pkg_get_name(info))) { - _alpm_log(handle, PM_LOG_DEBUG, "pulling %s in target list\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "pulling %s in target list\n", alpm_pkg_get_name(info)); trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(info)); } } else { - _alpm_log(handle, PM_LOG_ERROR, _("could not find %s in database -- skipping\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not find %s in database -- skipping\n"), miss->target); } } @@ -115,7 +115,7 @@ static void remove_prepare_keep_needed(alpm_handle_t *handle, alpm_list_t *lp) &vpkg); pkg = vpkg; if(pkg) { - _alpm_log(handle, PM_LOG_WARNING, _("removing %s from target list\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("removing %s from target list\n"), alpm_pkg_get_name(pkg)); _alpm_pkg_free(pkg); } @@ -141,7 +141,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data) alpm_db_t *db = handle->db_local; if((trans->flags & PM_TRANS_FLAG_RECURSE) && !(trans->flags & PM_TRANS_FLAG_CASCADE)) { - _alpm_log(handle, PM_LOG_DEBUG, "finding removable dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "finding removable dependencies\n"); _alpm_recursedeps(db, trans->remove, trans->flags & PM_TRANS_FLAG_RECURSEALL); } @@ -149,7 +149,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data) if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "looking for unsatisfied dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "looking for unsatisfied dependencies\n"); lp = alpm_checkdeps(handle, _alpm_db_get_pkgcache(db), trans->remove, NULL, 1); if(lp != NULL) { @@ -172,7 +172,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data) } /* re-order w.r.t. dependencies */ - _alpm_log(handle, PM_LOG_DEBUG, "sorting by dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "sorting by dependencies\n"); lp = _alpm_sortbydeps(handle, trans->remove, 1); /* free the old alltargs */ alpm_list_free(trans->remove); @@ -180,7 +180,7 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data) /* -Rcs == -Rc then -Rs */ if((trans->flags & PM_TRANS_FLAG_CASCADE) && (trans->flags & PM_TRANS_FLAG_RECURSE)) { - _alpm_log(handle, PM_LOG_DEBUG, "finding removable dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "finding removable dependencies\n"); _alpm_recursedeps(db, trans->remove, trans->flags & PM_TRANS_FLAG_RECURSEALL); } @@ -208,7 +208,7 @@ static int can_remove_file(alpm_handle_t *handle, const char *path, if(errno != EACCES && errno != ETXTBSY && access(file, F_OK) == 0) { /* only return failure if the file ACTUALLY exists and we can't write to * it - ignore "chmod -w" simple permission failures */ - _alpm_log(handle, PM_LOG_ERROR, _("cannot remove file '%s': %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("cannot remove file '%s': %s\n"), file, strerror(errno)); return 0; } @@ -231,7 +231,7 @@ static void unlink_file(alpm_handle_t *handle, alpm_pkg_t *info, const char *fil * see the big comment block in db_find_fileconflicts() for an * explanation. */ if(alpm_list_find_str(skip_remove, filename)) { - _alpm_log(handle, PM_LOG_DEBUG, "%s is in skip_remove, skipping removal\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is in skip_remove, skipping removal\n", file); return; } @@ -241,23 +241,23 @@ static void unlink_file(alpm_handle_t *handle, alpm_pkg_t *info, const char *fil * filesystem, we want to work with the linked directory instead of the * actual symlink */ if(lstat(file, &buf)) { - _alpm_log(handle, PM_LOG_DEBUG, "file %s does not exist\n", file); + _alpm_log(handle, ALPM_LOG_DEBUG, "file %s does not exist\n", file); return; } if(S_ISDIR(buf.st_mode)) { if(rmdir(file)) { /* this is okay, other packages are probably using it (like /usr) */ - _alpm_log(handle, PM_LOG_DEBUG, "keeping directory %s\n", file); + _alpm_log(handle, ALPM_LOG_DEBUG, "keeping directory %s\n", file); } else { - _alpm_log(handle, PM_LOG_DEBUG, "removing directory %s\n", file); + _alpm_log(handle, ALPM_LOG_DEBUG, "removing directory %s\n", file); } } else { /* if the file needs backup and has been modified, back it up to .pacsave */ alpm_backup_t *backup = _alpm_needbackup(filename, alpm_pkg_get_backup(info)); if(backup) { if(nosave) { - _alpm_log(handle, PM_LOG_DEBUG, "transaction is set to NOSAVE, not backing up '%s'\n", file); + _alpm_log(handle, ALPM_LOG_DEBUG, "transaction is set to NOSAVE, not backing up '%s'\n", file); } else { char *filehash = alpm_compute_md5sum(file); int cmp = filehash ? strcmp(filehash, backup->hash) : 0; @@ -266,17 +266,17 @@ static void unlink_file(alpm_handle_t *handle, alpm_pkg_t *info, const char *fil char newpath[PATH_MAX]; snprintf(newpath, PATH_MAX, "%s.pacsave", file); rename(file, newpath); - _alpm_log(handle, PM_LOG_WARNING, _("%s saved as %s\n"), file, newpath); + _alpm_log(handle, ALPM_LOG_WARNING, _("%s saved as %s\n"), file, newpath); alpm_logaction(handle, "warning: %s saved as %s\n", file, newpath); return; } } } - _alpm_log(handle, PM_LOG_DEBUG, "unlinking %s\n", file); + _alpm_log(handle, ALPM_LOG_DEBUG, "unlinking %s\n", file); if(unlink(file) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("cannot remove file '%s': %s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("cannot remove file '%s': %s\n"), filename, strerror(errno)); } } @@ -291,7 +291,7 @@ int _alpm_upgraderemove_package(alpm_handle_t *handle, alpm_list_t *files = alpm_pkg_get_files(oldpkg); const char *pkgname = alpm_pkg_get_name(oldpkg); - _alpm_log(handle, PM_LOG_DEBUG, "removing old package first (%s-%s)\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "removing old package first (%s-%s)\n", oldpkg->name, oldpkg->version); if(handle->trans->flags & PM_TRANS_FLAG_DBONLY) { @@ -312,21 +312,21 @@ int _alpm_upgraderemove_package(alpm_handle_t *handle, if(!alpm_list_find_str(filelist, backup->name)) { continue; } - _alpm_log(handle, PM_LOG_DEBUG, "adding %s to the skip_remove array\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "adding %s to the skip_remove array\n", backup->name); skip_remove = alpm_list_add(skip_remove, strdup(backup->name)); } for(lp = files; lp; lp = lp->next) { if(!can_remove_file(handle, lp->data, skip_remove)) { - _alpm_log(handle, PM_LOG_DEBUG, + _alpm_log(handle, ALPM_LOG_DEBUG, "not removing package '%s', can't remove all files\n", pkgname); RET_ERR(handle, PM_ERR_PKG_CANT_REMOVE, -1); } filenum++; } - _alpm_log(handle, PM_LOG_DEBUG, "removing %ld files\n", (unsigned long)filenum); + _alpm_log(handle, ALPM_LOG_DEBUG, "removing %ld files\n", (unsigned long)filenum); /* iterate through the list backwards, unlinking files */ newfiles = alpm_list_reverse(files); @@ -338,15 +338,15 @@ int _alpm_upgraderemove_package(alpm_handle_t *handle, db: /* remove the package from the database */ - _alpm_log(handle, PM_LOG_DEBUG, "updating database\n"); - _alpm_log(handle, PM_LOG_DEBUG, "removing database entry '%s'\n", pkgname); + _alpm_log(handle, ALPM_LOG_DEBUG, "updating database\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "removing database entry '%s'\n", pkgname); if(_alpm_local_db_remove(handle->db_local, oldpkg) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not remove database entry %s-%s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not remove database entry %s-%s\n"), pkgname, alpm_pkg_get_version(oldpkg)); } /* remove the package from the cache */ if(_alpm_db_remove_pkgfromcache(handle->db_local, oldpkg) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not remove entry '%s' from cache\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not remove entry '%s' from cache\n"), pkgname); } @@ -379,7 +379,7 @@ int _alpm_remove_packages(alpm_handle_t *handle) _alpm_db_path(handle->db_local), pkgname, alpm_pkg_get_version(info)); EVENT(trans, PM_TRANS_EVT_REMOVE_START, info, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "removing package %s-%s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "removing package %s-%s\n", pkgname, alpm_pkg_get_version(info)); /* run the pre-remove scriptlet if it exists */ @@ -395,14 +395,14 @@ int _alpm_remove_packages(alpm_handle_t *handle) for(lp = files; lp; lp = lp->next) { if(!can_remove_file(handle, lp->data, NULL)) { - _alpm_log(handle, PM_LOG_DEBUG, "not removing package '%s', can't remove all files\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "not removing package '%s', can't remove all files\n", pkgname); RET_ERR(handle, PM_ERR_PKG_CANT_REMOVE, -1); } filenum++; } - _alpm_log(handle, PM_LOG_DEBUG, "removing %ld files\n", (unsigned long)filenum); + _alpm_log(handle, ALPM_LOG_DEBUG, "removing %ld files\n", (unsigned long)filenum); /* init progress bar */ PROGRESS(trans, PM_TRANS_PROGRESS_REMOVE_START, info->name, 0, @@ -434,15 +434,15 @@ int _alpm_remove_packages(alpm_handle_t *handle) } /* remove the package from the database */ - _alpm_log(handle, PM_LOG_DEBUG, "updating database\n"); - _alpm_log(handle, PM_LOG_DEBUG, "removing database entry '%s'\n", pkgname); + _alpm_log(handle, ALPM_LOG_DEBUG, "updating database\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "removing database entry '%s'\n", pkgname); if(_alpm_local_db_remove(handle->db_local, info) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not remove database entry %s-%s\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not remove database entry %s-%s\n"), pkgname, alpm_pkg_get_version(info)); } /* remove the package from the cache */ if(_alpm_db_remove_pkgfromcache(handle->db_local, info) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not remove entry '%s' from cache\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not remove entry '%s' from cache\n"), pkgname); } diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 4e03ddcc..8ac457af 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -124,7 +124,7 @@ static int init_gpgme(alpm_handle_t *handle) /* calling gpgme_check_version() returns the current version and runs * some internal library setup code */ version = gpgme_check_version(NULL); - _alpm_log(handle, PM_LOG_DEBUG, "GPGME version: %s\n", version); + _alpm_log(handle, ALPM_LOG_DEBUG, "GPGME version: %s\n", version); gpgme_set_locale(NULL, LC_CTYPE, setlocale(LC_CTYPE, NULL)); #ifdef LC_MESSAGES gpgme_set_locale(NULL, LC_MESSAGES, setlocale(LC_MESSAGES, NULL)); @@ -146,14 +146,14 @@ static int init_gpgme(alpm_handle_t *handle) CHECK_ERR(); err = gpgme_get_engine_info(&enginfo); CHECK_ERR(); - _alpm_log(handle, PM_LOG_DEBUG, "GPGME engine info: file=%s, home=%s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "GPGME engine info: file=%s, home=%s\n", enginfo->file_name, enginfo->home_dir); init = 1; return 0; error: - _alpm_log(handle, PM_LOG_ERROR, _("GPGME error: %s\n"), gpgme_strerror(err)); + _alpm_log(handle, ALPM_LOG_ERROR, _("GPGME error: %s\n"), gpgme_strerror(err)); RET_ERR(handle, PM_ERR_GPGME, 1); } @@ -238,7 +238,7 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path, return -1; } - _alpm_log(handle, PM_LOG_DEBUG, "checking signature for %s\n", path); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking signature for %s\n", path); memset(&ctx, 0, sizeof(ctx)); memset(&sigdata, 0, sizeof(sigdata)); @@ -287,7 +287,7 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path, result = gpgme_op_verify_result(ctx); gpgsig = result->signatures; if(!gpgsig) { - _alpm_log(handle, PM_LOG_DEBUG, "no signatures returned\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "no signatures returned\n"); ret = -1; goto error; } @@ -295,16 +295,16 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path, while(gpgsig) { alpm_list_t *summary_list, *summary; - _alpm_log(handle, PM_LOG_DEBUG, "fingerprint: %s\n", gpgsig->fpr); + _alpm_log(handle, ALPM_LOG_DEBUG, "fingerprint: %s\n", gpgsig->fpr); summary_list = list_sigsum(gpgsig->summary); for(summary = summary_list; summary; summary = summary->next) { - _alpm_log(handle, PM_LOG_DEBUG, "summary: %s\n", (const char *)summary->data); + _alpm_log(handle, ALPM_LOG_DEBUG, "summary: %s\n", (const char *)summary->data); } alpm_list_free(summary_list); - _alpm_log(handle, PM_LOG_DEBUG, "status: %s\n", gpgme_strerror(gpgsig->status)); - _alpm_log(handle, PM_LOG_DEBUG, "timestamp: %lu\n", gpgsig->timestamp); - _alpm_log(handle, PM_LOG_DEBUG, "exp_timestamp: %lu\n", gpgsig->exp_timestamp); - _alpm_log(handle, PM_LOG_DEBUG, "validity: %s; reason: %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "status: %s\n", gpgme_strerror(gpgsig->status)); + _alpm_log(handle, ALPM_LOG_DEBUG, "timestamp: %lu\n", gpgsig->timestamp); + _alpm_log(handle, ALPM_LOG_DEBUG, "exp_timestamp: %lu\n", gpgsig->exp_timestamp); + _alpm_log(handle, ALPM_LOG_DEBUG, "validity: %s; reason: %s\n", string_validity(gpgsig->validity), gpgme_strerror(gpgsig->validity_reason)); @@ -313,22 +313,22 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path, * worst case wins out. */ if(gpgsig->summary & GPGME_SIGSUM_VALID) { /* definite good signature */ - _alpm_log(handle, PM_LOG_DEBUG, "result: valid signature\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "result: valid signature\n"); } else if(gpgsig->summary & GPGME_SIGSUM_GREEN) { /* good signature */ - _alpm_log(handle, PM_LOG_DEBUG, "result: green signature\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "result: green signature\n"); } else if(gpgsig->summary & GPGME_SIGSUM_RED) { /* definite bad signature, error */ - _alpm_log(handle, PM_LOG_DEBUG, "result: red signature\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "result: red signature\n"); handle->pm_errno = PM_ERR_SIG_INVALID; ret = 1; } else if(gpgsig->summary & GPGME_SIGSUM_KEY_MISSING) { - _alpm_log(handle, PM_LOG_DEBUG, "result: signature from unknown key\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "result: signature from unknown key\n"); handle->pm_errno = PM_ERR_SIG_UNKNOWN; ret = 1; } else { /* we'll capture everything else here */ - _alpm_log(handle, PM_LOG_DEBUG, "result: invalid signature\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "result: invalid signature\n"); handle->pm_errno = PM_ERR_SIG_INVALID; ret = 1; } @@ -349,7 +349,7 @@ error: FREE(sigpath); FREE(decoded_sigdata); if(err != GPG_ERR_NO_ERROR) { - _alpm_log(handle, PM_LOG_ERROR, _("GPGME error: %s\n"), gpgme_strerror(err)); + _alpm_log(handle, ALPM_LOG_ERROR, _("GPGME error: %s\n"), gpgme_strerror(err)); RET_ERR(handle, PM_ERR_GPGME, -1); } return ret; diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 5114309d..c82665fc 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -66,14 +66,14 @@ alpm_pkg_t SYMEXPORT *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_syn } if(spkg == NULL) { - _alpm_log(pkg->handle, PM_LOG_DEBUG, "'%s' not found in sync db => no upgrade\n", + _alpm_log(pkg->handle, ALPM_LOG_DEBUG, "'%s' not found in sync db => no upgrade\n", alpm_pkg_get_name(pkg)); return NULL; } /* compare versions and see if spkg is an upgrade */ if(_alpm_pkg_compare_versions(spkg, pkg) > 0) { - _alpm_log(pkg->handle, PM_LOG_DEBUG, "new version of '%s' found (%s => %s)\n", + _alpm_log(pkg->handle, ALPM_LOG_DEBUG, "new version of '%s' found (%s => %s)\n", alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg), alpm_pkg_get_version(spkg)); return spkg; @@ -97,12 +97,12 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) ASSERT(trans != NULL, RET_ERR(handle, PM_ERR_TRANS_NULL, -1)); ASSERT(trans->state == STATE_INITIALIZED, RET_ERR(handle, PM_ERR_TRANS_NOT_INITIALIZED, -1)); - _alpm_log(handle, PM_LOG_DEBUG, "checking for package upgrades\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking for package upgrades\n"); for(i = _alpm_db_get_pkgcache(db_local); i; i = i->next) { alpm_pkg_t *lpkg = i->data; if(_alpm_pkg_find(trans->add, lpkg->name)) { - _alpm_log(handle, PM_LOG_DEBUG, "%s is already in the target list -- skipping\n", lpkg->name); + _alpm_log(handle, ALPM_LOG_DEBUG, "%s is already in the target list -- skipping\n", lpkg->name); continue; } @@ -116,15 +116,15 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* 1. literal was found in sdb */ int cmp = _alpm_pkg_compare_versions(spkg, lpkg); if(cmp > 0) { - _alpm_log(handle, PM_LOG_DEBUG, "new version of '%s' found (%s => %s)\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "new version of '%s' found (%s => %s)\n", lpkg->name, lpkg->version, spkg->version); /* check IgnorePkg/IgnoreGroup */ if(_alpm_pkg_should_ignore(handle, spkg) || _alpm_pkg_should_ignore(handle, lpkg)) { - _alpm_log(handle, PM_LOG_WARNING, _("%s: ignoring package upgrade (%s => %s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s: ignoring package upgrade (%s => %s)\n"), lpkg->name, lpkg->version, spkg->version); } else { - _alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", spkg->name, spkg->version); trans->add = alpm_list_add(trans->add, spkg); } @@ -133,15 +133,15 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* check IgnorePkg/IgnoreGroup */ if(_alpm_pkg_should_ignore(handle, spkg) || _alpm_pkg_should_ignore(handle, lpkg)) { - _alpm_log(handle, PM_LOG_WARNING, _("%s: ignoring package downgrade (%s => %s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s: ignoring package downgrade (%s => %s)\n"), lpkg->name, lpkg->version, spkg->version); } else { - _alpm_log(handle, PM_LOG_WARNING, _("%s: downgrading from version %s to version %s\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s: downgrading from version %s to version %s\n"), lpkg->name, lpkg->version, spkg->version); trans->add = alpm_list_add(trans->add, spkg); } } else { - _alpm_log(handle, PM_LOG_WARNING, _("%s: local (%s) is newer than %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("%s: local (%s) is newer than %s (%s)\n"), lpkg->name, lpkg->version, sdb->treename, spkg->version); } } @@ -157,7 +157,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* check IgnorePkg/IgnoreGroup */ if(_alpm_pkg_should_ignore(handle, spkg) || _alpm_pkg_should_ignore(handle, lpkg)) { - _alpm_log(handle, PM_LOG_WARNING, _("ignoring package replacement (%s-%s => %s-%s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("ignoring package replacement (%s-%s => %s-%s)\n"), lpkg->name, lpkg->version, spkg->name, spkg->version); continue; } @@ -174,11 +174,11 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) if(tpkg) { /* sanity check, multiple repos can contain spkg->name */ if(tpkg->origin_data.db != sdb) { - _alpm_log(handle, PM_LOG_WARNING, _("cannot replace %s by %s\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("cannot replace %s by %s\n"), lpkg->name, spkg->name); continue; } - _alpm_log(handle, PM_LOG_DEBUG, "appending %s to the removes list of %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "appending %s to the removes list of %s\n", lpkg->name, tpkg->name); tpkg->removes = alpm_list_add(tpkg->removes, lpkg); /* check the to-be-replaced package's reason field */ @@ -190,7 +190,7 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade) /* copy over reason */ spkg->reason = alpm_pkg_get_reason(lpkg); spkg->removes = alpm_list_add(NULL, lpkg); - _alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "adding package %s-%s to the transaction targets\n", spkg->name, spkg->version); trans->add = alpm_list_add(trans->add, spkg); } @@ -282,10 +282,10 @@ static int compute_download_size(alpm_pkg_t *newpkg) &newpkg->delta_path); if(newpkg->delta_path && (dltsize < pkgsize * MAX_DELTA_RATIO)) { - _alpm_log(handle, PM_LOG_DEBUG, "using delta size\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "using delta size\n"); size = dltsize; } else { - _alpm_log(handle, PM_LOG_DEBUG, "using package size\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "using package size\n"); size = alpm_pkg_get_size(newpkg); alpm_list_free(newpkg->delta_path); newpkg->delta_path = NULL; @@ -294,7 +294,7 @@ static int compute_download_size(alpm_pkg_t *newpkg) size = alpm_pkg_get_size(newpkg); } - _alpm_log(handle, PM_LOG_DEBUG, "setting download size %jd for pkg %s\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "setting download size %jd for pkg %s\n", (intmax_t)size, alpm_pkg_get_name(newpkg)); newpkg->infolevel |= INFRQ_DSIZE; @@ -321,7 +321,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* Build up list by repeatedly resolving each transaction package */ /* Resolve targets dependencies */ EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "resolving target's dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "resolving target's dependencies\n"); /* build remove list for resolvedeps */ for(i = trans->add; i; i = i->next) { @@ -398,10 +398,10 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) /* check for inter-conflicts and whatnot */ EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "looking for conflicts\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "looking for conflicts\n"); /* 1. check for conflicts in the target list */ - _alpm_log(handle, PM_LOG_DEBUG, "check targets vs targets\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "check targets vs targets\n"); deps = _alpm_innerconflicts(handle, trans->add); for(i = deps; i; i = i->next) { @@ -415,7 +415,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) continue; } - _alpm_log(handle, PM_LOG_DEBUG, "conflicting packages in the sync list: '%s' <-> '%s'\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "conflicting packages in the sync list: '%s' <-> '%s'\n", conflict->package1, conflict->package2); /* if sync1 provides sync2, we remove sync2 from the targets, and vice versa */ @@ -428,7 +428,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) rsync = sync1; sync = sync2; } else { - _alpm_log(handle, PM_LOG_ERROR, _("unresolvable package conflicts detected\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n")); handle->pm_errno = PM_ERR_CONFLICTING_DEPS; ret = -1; if(data) { @@ -447,7 +447,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) _alpm_dep_free(dep2); /* Prints warning */ - _alpm_log(handle, PM_LOG_WARNING, + _alpm_log(handle, ALPM_LOG_WARNING, _("removing '%s' from target list because it conflicts with '%s'\n"), rsync->name, sync->name); trans->add = alpm_list_remove(trans->add, rsync, _alpm_pkg_cmp, NULL); @@ -460,7 +460,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) deps = NULL; /* 2. we check for target vs db conflicts (and resolve)*/ - _alpm_log(handle, PM_LOG_DEBUG, "check targets vs db and db vs targets\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "check targets vs db and db vs targets\n"); deps = _alpm_outerconflicts(handle->db_local, trans->add); for(i = deps; i; i = i->next) { @@ -479,7 +479,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) continue; } - _alpm_log(handle, PM_LOG_DEBUG, "package '%s' conflicts with '%s'\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "package '%s' conflicts with '%s'\n", conflict->package1, conflict->package2); alpm_pkg_t *sync = _alpm_pkg_find(trans->add, conflict->package1); @@ -489,10 +489,10 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) conflict->package2, conflict->reason, &doremove); if(doremove) { /* append to the removes list */ - _alpm_log(handle, PM_LOG_DEBUG, "electing '%s' for removal\n", conflict->package2); + _alpm_log(handle, ALPM_LOG_DEBUG, "electing '%s' for removal\n", conflict->package2); sync->removes = alpm_list_add(sync->removes, local); } else { /* abort */ - _alpm_log(handle, PM_LOG_ERROR, _("unresolvable package conflicts detected\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("unresolvable package conflicts detected\n")); handle->pm_errno = PM_ERR_CONFLICTING_DEPS; ret = -1; if(data) { @@ -517,14 +517,14 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data) for(j = spkg->removes; j; j = j->next) { alpm_pkg_t *rpkg = j->data; if(!_alpm_pkg_find(trans->remove, rpkg->name)) { - _alpm_log(handle, PM_LOG_DEBUG, "adding '%s' to remove list\n", rpkg->name); + _alpm_log(handle, ALPM_LOG_DEBUG, "adding '%s' to remove list\n", rpkg->name); trans->remove = alpm_list_add(trans->remove, _alpm_pkg_dup(rpkg)); } } } if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) { - _alpm_log(handle, PM_LOG_DEBUG, "checking dependencies\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking dependencies\n"); deps = alpm_checkdeps(handle, _alpm_db_get_pkgcache(handle->db_local), trans->remove, trans->add, 1); if(deps) { @@ -627,7 +627,7 @@ static int apply_deltas(alpm_handle_t *handle) snprintf(command, PATH_MAX, "xdelta3 -d -q -s %s %s %s", from, delta, to); } - _alpm_log(handle, PM_LOG_DEBUG, "command: %s\n", command); + _alpm_log(handle, ALPM_LOG_DEBUG, "command: %s\n", command); EVENT(trans, PM_TRANS_EVT_DELTA_PATCH_START, d->to, d->delta); @@ -810,7 +810,7 @@ static int download_files(alpm_handle_t *handle, alpm_list_t **deltas) FREELIST(files); if(errors) { - _alpm_log(handle, PM_LOG_WARNING, _("failed to retrieve some files from %s\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("failed to retrieve some files from %s\n"), current->treename); if(handle->pm_errno == 0) { handle->pm_errno = PM_ERR_RETRIEVE; @@ -878,7 +878,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) /* load the package file and replace pkgcache entry with it in the target list */ /* TODO: alpm_pkg_get_db() will not work on this target anymore */ - _alpm_log(handle, PM_LOG_DEBUG, + _alpm_log(handle, ALPM_LOG_DEBUG, "replacing pkgcache entry with package file for target %s\n", spkg->name); alpm_pkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1, spkg->md5sum, @@ -916,7 +916,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) if(!(trans->flags & PM_TRANS_FLAG_FORCE)) { EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "looking for file conflicts\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n"); alpm_list_t *conflict = _alpm_db_find_fileconflicts(handle, trans->add, trans->remove); if(conflict) { @@ -936,9 +936,9 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) if(handle->checkspace) { EVENT(trans, PM_TRANS_EVT_DISKSPACE_START, NULL, NULL); - _alpm_log(handle, PM_LOG_DEBUG, "checking available disk space\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "checking available disk space\n"); if(_alpm_check_diskspace(handle) == -1) { - _alpm_log(handle, PM_LOG_ERROR, "%s\n", _("not enough free disk space")); + _alpm_log(handle, ALPM_LOG_ERROR, "%s\n", _("not enough free disk space")); return -1; } @@ -947,18 +947,18 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data) /* remove conflicting and to-be-replaced packages */ if(replaces) { - _alpm_log(handle, PM_LOG_DEBUG, "removing conflicting and to-be-replaced packages\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "removing conflicting and to-be-replaced packages\n"); /* we want the frontend to be aware of commit details */ if(_alpm_remove_packages(handle) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not commit removal transaction\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not commit removal transaction\n")); return -1; } } /* install targets */ - _alpm_log(handle, PM_LOG_DEBUG, "installing packages\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "installing packages\n"); if(_alpm_upgrade_packages(handle) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not commit transaction\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not commit transaction\n")); return -1; } diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c index 29a74bf9..d6cc3b55 100644 --- a/lib/libalpm/trans.c +++ b/lib/libalpm/trans.c @@ -231,7 +231,7 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle) /* unlock db */ if(!nolock_flag) { 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)); alpm_logaction(handle, "warning: could not remove lock file %s\n", alpm_option_get_lockfile(handle)); @@ -298,7 +298,7 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn, if(access(installfn, R_OK)) { /* not found */ - _alpm_log(handle, PM_LOG_DEBUG, "scriptlet '%s' not found\n", installfn); + _alpm_log(handle, ALPM_LOG_DEBUG, "scriptlet '%s' not found\n", installfn); return 0; } @@ -309,7 +309,7 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn, } snprintf(tmpdir, PATH_MAX, "%stmp/alpm_XXXXXX", handle->root); if(mkdtemp(tmpdir) == NULL) { - _alpm_log(handle, PM_LOG_ERROR, _("could not create temp directory\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not create temp directory\n")); return 1; } else { clean_tmpdir = 1; @@ -323,7 +323,7 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn, } } else { if(_alpm_copyfile(installfn, scriptfn)) { - _alpm_log(handle, PM_LOG_ERROR, _("could not copy tempfile to %s (%s)\n"), scriptfn, strerror(errno)); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not copy tempfile to %s (%s)\n"), scriptfn, strerror(errno)); retval = 1; } } @@ -347,13 +347,13 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn, scriptpath, script, ver); } - _alpm_log(handle, PM_LOG_DEBUG, "executing \"%s\"\n", cmdline); + _alpm_log(handle, ALPM_LOG_DEBUG, "executing \"%s\"\n", cmdline); retval = _alpm_run_chroot(handle, "/bin/sh", argv); cleanup: if(clean_tmpdir && _alpm_rmrf(tmpdir)) { - _alpm_log(handle, PM_LOG_WARNING, _("could not remove tmpdir %s\n"), tmpdir); + _alpm_log(handle, ALPM_LOG_WARNING, _("could not remove tmpdir %s\n"), tmpdir); } return retval; diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c index 8bcb5463..5d80a0e3 100644 --- a/lib/libalpm/util.c +++ b/lib/libalpm/util.c @@ -262,7 +262,7 @@ int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix, if(archive_read_open_filename(_archive, archive, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) { - _alpm_log(handle, PM_LOG_ERROR, _("could not open file %s: %s\n"), archive, + _alpm_log(handle, ALPM_LOG_ERROR, _("could not open file %s: %s\n"), archive, archive_error_string(_archive)); RET_ERR(handle, PM_ERR_PKG_OPEN, 1); } @@ -271,14 +271,14 @@ int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix, /* save the cwd so we can restore it later */ if(getcwd(cwd, PATH_MAX) == NULL) { - _alpm_log(handle, PM_LOG_ERROR, _("could not get current working directory\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not get current working directory\n")); } else { restore_cwd = 1; } /* just in case our cwd was removed in the upgrade operation */ if(chdir(prefix) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("could not change directory to %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), prefix, strerror(errno)); ret = 1; goto cleanup; @@ -313,7 +313,7 @@ int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix, } continue; } else { - _alpm_log(handle, PM_LOG_DEBUG, "extracting: %s\n", entryname); + _alpm_log(handle, ALPM_LOG_DEBUG, "extracting: %s\n", entryname); } } @@ -321,10 +321,10 @@ int _alpm_unpack(alpm_handle_t *handle, const char *archive, const char *prefix, int readret = archive_read_extract(_archive, entry, 0); if(readret == ARCHIVE_WARN) { /* operation succeeded but a non-critical error was encountered */ - _alpm_log(handle, PM_LOG_WARNING, _("warning given when extracting %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("warning given when extracting %s (%s)\n"), entryname, archive_error_string(_archive)); } else if(readret != ARCHIVE_OK) { - _alpm_log(handle, PM_LOG_ERROR, _("could not extract %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not extract %s (%s)\n"), entryname, archive_error_string(_archive)); ret = 1; goto cleanup; @@ -339,7 +339,7 @@ cleanup: umask(oldmask); archive_read_finish(_archive); if(restore_cwd && chdir(cwd) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("could not change directory to %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), cwd, strerror(errno)); } return ret; @@ -429,26 +429,26 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[] /* save the cwd so we can restore it later */ if(getcwd(cwd, PATH_MAX) == NULL) { - _alpm_log(handle, PM_LOG_ERROR, _("could not get current working directory\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not get current working directory\n")); } else { restore_cwd = 1; } /* just in case our cwd was removed in the upgrade operation */ if(chdir(handle->root) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("could not change directory to %s (%s)\n"), + _alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), handle->root, strerror(errno)); goto cleanup; } - _alpm_log(handle, PM_LOG_DEBUG, "executing \"%s\" under chroot \"%s\"\n", + _alpm_log(handle, ALPM_LOG_DEBUG, "executing \"%s\" under chroot \"%s\"\n", path, handle->root); /* Flush open fds before fork() to avoid cloning buffers */ fflush(NULL); if(pipe(pipefd) == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not create pipe (%s)\n"), strerror(errno)); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not create pipe (%s)\n"), strerror(errno)); retval = 1; goto cleanup; } @@ -456,7 +456,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[] /* fork- parent and child each have seperate code blocks below */ pid = fork(); if(pid == -1) { - _alpm_log(handle, PM_LOG_ERROR, _("could not fork a new process (%s)\n"), strerror(errno)); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not fork a new process (%s)\n"), strerror(errno)); retval = 1; goto cleanup; } @@ -507,7 +507,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[] while(waitpid(pid, &status, 0) == -1) { if(errno != EINTR) { - _alpm_log(handle, PM_LOG_ERROR, _("call to waitpid failed (%s)\n"), strerror(errno)); + _alpm_log(handle, ALPM_LOG_ERROR, _("call to waitpid failed (%s)\n"), strerror(errno)); retval = 1; goto cleanup; } @@ -515,14 +515,14 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[] /* report error from above after the child has exited */ if(retval != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("could not open pipe (%s)\n"), strerror(errno)); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not open pipe (%s)\n"), strerror(errno)); goto cleanup; } /* check the return status, make sure it is 0 (success) */ if(WIFEXITED(status)) { - _alpm_log(handle, PM_LOG_DEBUG, "call to waitpid succeeded\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "call to waitpid succeeded\n"); if(WEXITSTATUS(status) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("command failed to execute correctly\n")); + _alpm_log(handle, ALPM_LOG_ERROR, _("command failed to execute correctly\n")); retval = 1; } } @@ -530,7 +530,7 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *path, char *const argv[] cleanup: if(restore_cwd && chdir(cwd) != 0) { - _alpm_log(handle, PM_LOG_ERROR, _("could not change directory to %s (%s)\n"), cwd, strerror(errno)); + _alpm_log(handle, ALPM_LOG_ERROR, _("could not change directory to %s (%s)\n"), cwd, strerror(errno)); } return retval; @@ -540,7 +540,7 @@ int _alpm_ldconfig(alpm_handle_t *handle) { char line[PATH_MAX]; - _alpm_log(handle, PM_LOG_DEBUG, "running ldconfig\n"); + _alpm_log(handle, ALPM_LOG_DEBUG, "running ldconfig\n"); snprintf(line, PATH_MAX, "%setc/ld.so.conf", handle->root); if(access(line, F_OK) == 0) { @@ -579,7 +579,7 @@ char *_alpm_filecache_find(alpm_handle_t *handle, const char *filename) filename); if(stat(path, &buf) == 0 && S_ISREG(buf.st_mode)) { retpath = strdup(path); - _alpm_log(handle, PM_LOG_DEBUG, "found cached pkg: %s\n", retpath); + _alpm_log(handle, ALPM_LOG_DEBUG, "found cached pkg: %s\n", retpath); return retpath; } } @@ -603,17 +603,17 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle) cachedir = alpm_list_getdata(i); if(stat(cachedir, &buf) != 0) { /* cache directory does not exist.... try creating it */ - _alpm_log(handle, PM_LOG_WARNING, _("no %s cache exists, creating...\n"), + _alpm_log(handle, ALPM_LOG_WARNING, _("no %s cache exists, creating...\n"), cachedir); if(_alpm_makepath(cachedir) == 0) { - _alpm_log(handle, PM_LOG_DEBUG, "using cachedir: %s\n", cachedir); + _alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", cachedir); return cachedir; } } else if(S_ISDIR(buf.st_mode) && (buf.st_mode & S_IWUSR)) { - _alpm_log(handle, PM_LOG_DEBUG, "using cachedir: %s\n", cachedir); + _alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", cachedir); return cachedir; } else { - _alpm_log(handle, PM_LOG_DEBUG, "skipping cachedir: %s\n", cachedir); + _alpm_log(handle, ALPM_LOG_DEBUG, "skipping cachedir: %s\n", cachedir); } } @@ -621,8 +621,8 @@ const char *_alpm_filecache_setup(alpm_handle_t *handle) tmp = alpm_list_add(NULL, "/tmp/"); alpm_option_set_cachedirs(handle, tmp); alpm_list_free(tmp); - _alpm_log(handle, PM_LOG_DEBUG, "using cachedir: %s\n", "/tmp/"); - _alpm_log(handle, PM_LOG_WARNING, _("couldn't create package cache, using /tmp instead\n")); + _alpm_log(handle, ALPM_LOG_DEBUG, "using cachedir: %s\n", "/tmp/"); + _alpm_log(handle, ALPM_LOG_WARNING, _("couldn't create package cache, using /tmp instead\n")); return "/tmp/"; } diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index 614c2fbb..fd97824a 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -62,12 +62,12 @@ #define ASSERT(cond, action) do { if(!(cond)) { action; } } while(0) #define RET_ERR_VOID(handle, err) do { \ - _alpm_log(handle, PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \ + _alpm_log(handle, ALPM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \ (handle)->pm_errno = (err); \ return; } while(0) #define RET_ERR(handle, err, ret) do { \ - _alpm_log(handle, PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \ + _alpm_log(handle, ALPM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \ (handle)->pm_errno = (err); \ return (ret); } while(0) |