summaryrefslogtreecommitdiff
path: root/lib/libalpm/be_package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-01 10:26:45 -0500
committerDan McGee <dan@archlinux.org>2011-11-01 10:26:45 -0500
commita4ce3edf95f148bc6eac16b6edd9bc281c7745af (patch)
treeae7dc55d73ae12a3214c14ccaa4d37084a0e37c2 /lib/libalpm/be_package.c
parentd5f0395dc13fb305e75a5e78de57e148d87f12d7 (diff)
parentd98ff04cc933253b7221fc170813f7d2365d3289 (diff)
Merge branch 'maint'
Diffstat (limited to 'lib/libalpm/be_package.c')
-rw-r--r--lib/libalpm/be_package.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
index c20c703f..4d9d0e82 100644
--- a/lib/libalpm/be_package.c
+++ b/lib/libalpm/be_package.c
@@ -59,7 +59,7 @@ static void *_package_changelog_open(alpm_pkg_t *pkg)
archive_read_support_format_all(archive);
if(archive_read_open_filename(archive, pkgfile,
- ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
+ ALPM_BUFFER_SIZE) != ARCHIVE_OK) {
RET_ERR(pkg->handle, ALPM_ERR_PKG_OPEN, NULL);
}
@@ -390,7 +390,7 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
archive_read_support_format_all(archive);
if(archive_read_open_filename(archive, pkgfile,
- ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
+ ALPM_BUFFER_SIZE) != ARCHIVE_OK) {
alpm_pkg_free(newpkg);
RET_ERR(handle, ALPM_ERR_PKG_OPEN, NULL);
}
@@ -482,17 +482,19 @@ alpm_pkg_t *_alpm_pkg_load_internal(alpm_handle_t *handle,
newpkg->origin_data.file = strdup(pkgfile);
newpkg->ops = get_file_pkg_ops();
newpkg->handle = handle;
+ newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_SCRIPTLET;
if(full) {
- /* attempt to hand back any memory we don't need */
- files = realloc(files, sizeof(alpm_file_t) * files_count);
- /* "checking for conflicts" requires a sorted list, ensure that here */
- _alpm_log(handle, ALPM_LOG_DEBUG, "sorting package filelist for %s\n", pkgfile);
- newpkg->files.files = files_msort(files, files_count);
+ if(files) {
+ /* attempt to hand back any memory we don't need */
+ files = realloc(files, sizeof(alpm_file_t) * files_count);
+ /* "checking for conflicts" requires a sorted list, ensure that here */
+ _alpm_log(handle, ALPM_LOG_DEBUG,
+ "sorting package filelist for %s\n", pkgfile);
+ newpkg->files.files = files_msort(files, files_count);
+ }
newpkg->files.count = files_count;
- newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_FILES | INFRQ_SCRIPTLET;
- } else {
- newpkg->infolevel = INFRQ_BASE | INFRQ_DESC | INFRQ_SCRIPTLET;
+ newpkg->infolevel |= INFRQ_FILES;
}
return newpkg;