summaryrefslogtreecommitdiff
path: root/lib/libalpm/util.c
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-11-16 17:24:41 +0000
committerAaron Griffin <aaron@archlinux.org>2006-11-16 17:24:41 +0000
commit3d6242ed7480526abcbc8c2687157933061b5b28 (patch)
tree9af64a60a7883d3fa75c5ed67c2d21cebb3bb8dc /lib/libalpm/util.c
parent95358f7c5b10cdcb8ca2523ca86bd862a38476c1 (diff)
downloadpacman-3d6242ed7480526abcbc8c2687157933061b5b28.tar.xz
* makepkg.conf.in variable changes (missed the checkin)
* Better error reporting when unpacking an archive fails * Fixed -Sc and -Scc cache dir opening/reading
Diffstat (limited to 'lib/libalpm/util.c')
-rw-r--r--lib/libalpm/util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index ddaecebb..f1f74202 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -273,8 +273,10 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
archive_read_support_compression_all(_archive);
archive_read_support_format_all(_archive);
- if(archive_read_open_file(_archive, archive, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK)
+ if(archive_read_open_file(_archive, archive, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
+ _alpm_log(PM_LOG_ERROR, _("could not open %s: %s\n"), archive, archive_error_string(_archive));
RET_ERR(PM_ERR_PKG_OPEN, -1);
+ }
while(archive_read_next_header(_archive, &entry) == ARCHIVE_OK) {
if (fn && strcmp(fn, archive_entry_pathname(entry))) {
@@ -285,7 +287,7 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
snprintf(expath, PATH_MAX, "%s/%s", prefix, archive_entry_pathname(entry));
archive_entry_set_pathname(entry, expath);
if(archive_read_extract(_archive, entry, ARCHIVE_EXTRACT_FLAGS) != ARCHIVE_OK) {
- fprintf(stderr, _("could not extract %s: %s\n"), archive_entry_pathname(entry), archive_error_string(_archive));
+ _alpm_log(PM_LOG_ERROR, _("could not extract %s: %s\n"), archive_entry_pathname(entry), archive_error_string(_archive));
return(1);
}