diff options
author | Dan McGee <dan@archlinux.org> | 2007-10-08 21:21:04 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-10-08 21:21:04 -0500 |
commit | 087b8df781fb229033e9c01f58cdf80f0ddd29e6 (patch) | |
tree | 4d70fc5f613b4bd3865030a5851a9312833cb01c | |
parent | e03a1f0044ebd7a477b44af411f296d72e3bba4d (diff) |
libalpm/package.c: ensure we use package name when loading packages
Some of the error messages in _alpm_pkg_load failed to use the pkgname
value when printing, which made error messages rather hard to decode.
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | lib/libalpm/package.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 0c58bba5..38e6e4c2 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -949,7 +949,8 @@ pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full) archive_read_data_into_fd (archive, fd); /* parse the info file */ if(parse_descfile(descfile, info) == -1) { - _alpm_log(PM_LOG_ERROR, _("could not parse the package description file\n")); + _alpm_log(PM_LOG_ERROR, _("could not parse package description file in %s\n"), + pkgfile); goto pkg_invalid; } if(!strlen(info->name)) { @@ -1006,7 +1007,8 @@ pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full) } if(archive_read_data_skip(archive)) { - _alpm_log(PM_LOG_ERROR, _("error while reading package: %s\n"), archive_error_string(archive)); + _alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"), + pkgfile, archive_error_string(archive)); pm_errno = PM_ERR_LIBARCHIVE_ERROR; goto error; } @@ -1018,13 +1020,14 @@ pmpkg_t *_alpm_pkg_load(const char *pkgfile, unsigned short full) } if(ret != ARCHIVE_EOF && ret != ARCHIVE_OK) { /* An error occured */ - _alpm_log(PM_LOG_ERROR, _("error while reading package: %s\n"), archive_error_string(archive)); + _alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"), + pkgfile, archive_error_string(archive)); pm_errno = PM_ERR_LIBARCHIVE_ERROR; goto error; } if(!config) { - _alpm_log(PM_LOG_ERROR, _("missing package metadata\n"), pkgfile); + _alpm_log(PM_LOG_ERROR, _("missing package metadata in %s\n"), pkgfile); goto error; } |