From ca43fdd92f06a6997c53e45bfed6fb27f3044de5 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:38 +1000 Subject: Prefix alpm_loglevel_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/be_package.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'lib/libalpm/be_package.c') 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 { -- cgit v1.2.3-24-g4f1b From afc96f2ab3d05f14a73e81f871164f01423b5572 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Sat, 2 Jul 2011 02:01:39 +1000 Subject: Prefix _alpm_errno_t members with ALPM Signed-off-by: Allan McRae --- lib/libalpm/be_package.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'lib/libalpm/be_package.c') diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c index 57f01233..16132144 100644 --- a/lib/libalpm/be_package.c +++ b/lib/libalpm/be_package.c @@ -52,7 +52,7 @@ static void *_package_changelog_open(alpm_pkg_t *pkg) const char *pkgfile = pkg->origin_data.file; if((archive = archive_read_new()) == NULL) { - RET_ERR(pkg->handle, PM_ERR_LIBARCHIVE, NULL); + RET_ERR(pkg->handle, ALPM_ERR_LIBARCHIVE, NULL); } archive_read_support_compression_all(archive); @@ -60,7 +60,7 @@ static void *_package_changelog_open(alpm_pkg_t *pkg) if(archive_read_open_filename(archive, pkgfile, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) { - RET_ERR(pkg->handle, PM_ERR_PKG_OPEN, NULL); + RET_ERR(pkg->handle, ALPM_ERR_PKG_OPEN, NULL); } while(archive_read_next_header(archive, &entry) == ARCHIVE_OK) { @@ -92,7 +92,7 @@ static size_t _package_changelog_read(void *ptr, size_t size, ssize_t sret = archive_read_data((struct archive *)fp, ptr, size); /* Report error (negative values) */ if(sret < 0) { - RET_ERR(pkg->handle, PM_ERR_LIBARCHIVE, 0); + RET_ERR(pkg->handle, ALPM_ERR_LIBARCHIVE, 0); } else { return (size_t)sret; } @@ -244,20 +244,20 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, size_t files_count = 0; if(pkgfile == NULL || strlen(pkgfile) == 0) { - RET_ERR(handle, PM_ERR_WRONG_ARGS, NULL); + RET_ERR(handle, ALPM_ERR_WRONG_ARGS, NULL); } /* attempt to stat the package file, ensure it exists */ if(stat(pkgfile, &st) == 0) { newpkg = _alpm_pkg_new(); if(newpkg == NULL) { - RET_ERR(handle, PM_ERR_MEMORY, NULL); + RET_ERR(handle, ALPM_ERR_MEMORY, NULL); } newpkg->filename = strdup(pkgfile); newpkg->size = st.st_size; } else { /* couldn't stat the pkgfile, return an error */ - RET_ERR(handle, PM_ERR_PKG_OPEN, NULL); + RET_ERR(handle, ALPM_ERR_PKG_OPEN, NULL); } /* first steps- validate the package file */ @@ -266,7 +266,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *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); + RET_ERR(handle, ALPM_ERR_PKG_INVALID, NULL); } } @@ -277,14 +277,14 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, if((check_sig == PM_PGP_VERIFY_ALWAYS && ret != 0) || (check_sig == PM_PGP_VERIFY_OPTIONAL && ret == 1)) { alpm_pkg_free(newpkg); - RET_ERR(handle, PM_ERR_SIG_INVALID, NULL); + RET_ERR(handle, ALPM_ERR_SIG_INVALID, NULL); } } /* next- try to create an archive object to read in the package */ if((archive = archive_read_new()) == NULL) { alpm_pkg_free(newpkg); - RET_ERR(handle, PM_ERR_LIBARCHIVE, NULL); + RET_ERR(handle, ALPM_ERR_LIBARCHIVE, NULL); } archive_read_support_compression_all(archive); @@ -293,7 +293,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, if(archive_read_open_filename(archive, pkgfile, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) { alpm_pkg_free(newpkg); - RET_ERR(handle, PM_ERR_PKG_OPEN, NULL); + RET_ERR(handle, ALPM_ERR_PKG_OPEN, NULL); } _alpm_log(handle, ALPM_LOG_DEBUG, "starting package load for %s\n", pkgfile); @@ -335,7 +335,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, if(archive_read_data_skip(archive)) { _alpm_log(handle, ALPM_LOG_ERROR, _("error while reading package %s: %s\n"), pkgfile, archive_error_string(archive)); - handle->pm_errno = PM_ERR_LIBARCHIVE; + handle->pm_errno = ALPM_ERR_LIBARCHIVE; goto error; } @@ -348,7 +348,7 @@ 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, ALPM_LOG_ERROR, _("error while reading package %s: %s\n"), pkgfile, archive_error_string(archive)); - handle->pm_errno = PM_ERR_LIBARCHIVE; + handle->pm_errno = ALPM_ERR_LIBARCHIVE; goto error; } @@ -379,7 +379,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle, const char *pkgfile, return newpkg; pkg_invalid: - handle->pm_errno = PM_ERR_PKG_INVALID; + handle->pm_errno = ALPM_ERR_PKG_INVALID; error: _alpm_pkg_free(newpkg); archive_read_finish(archive); @@ -391,7 +391,7 @@ int SYMEXPORT alpm_pkg_load(alpm_handle_t *handle, const char *filename, int ful pgp_verify_t check_sig, alpm_pkg_t **pkg) { CHECK_HANDLE(handle, return -1); - ASSERT(pkg != NULL, RET_ERR(handle, PM_ERR_WRONG_ARGS, -1)); + ASSERT(pkg != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); *pkg = _alpm_pkg_load_internal(handle, filename, full, NULL, NULL, check_sig); if(*pkg == NULL) { -- cgit v1.2.3-24-g4f1b