From 087b8df781fb229033e9c01f58cdf80f0ddd29e6 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 8 Oct 2007 21:21:04 -0500 Subject: 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 --- lib/libalpm/package.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/libalpm') 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; } -- cgit v1.2.3-70-g09d2