Only enable support for gzip, bzip2 and xz compression formats.

After looking at profiling output I saw that a not so small of time spent
was in libarchive trying to know if archive is zip compressed... so
I've enabled the three compression formats supported by xbps-src.
This commit is contained in:
Juan RP 2012-02-22 04:16:36 +01:00
parent 485a62e221
commit 001947d9bb
2 changed files with 11 additions and 5 deletions

View File

@ -579,9 +579,11 @@ xbps_unpack_binary_pkg(prop_dictionary_t pkg_repod)
return ENOMEM;
}
/*
* Enable support for tar format and all compression methods.
* Enable support for tar format and gzip/bzip2/lzma compression methods.
*/
archive_read_support_compression_all(ar);
archive_read_support_compression_gzip(ar);
archive_read_support_compression_bzip2(ar);
archive_read_support_compression_xz(ar);
archive_read_support_format_tar(ar);
if (archive_read_open_filename(ar, bpkg, ARCHIVE_READ_BLOCKSIZE) != 0) {

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2009-2011 Juan Romero Pardines.
* Copyright (c) 2009-2012 Juan Romero Pardines.
* Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg (at) NetBSD.org>
* All rights reserved.
*
@ -107,7 +107,9 @@ open_archive_by_url(struct url *url)
free(f);
return NULL;
}
archive_read_support_compression_all(a);
archive_read_support_compression_gzip(a);
archive_read_support_compression_bzip2(a);
archive_read_support_compression_xz(a);
archive_read_support_format_tar(a);
if (archive_read_open(a, f, fetch_archive_open, fetch_archive_read,
@ -129,7 +131,9 @@ open_archive(const char *url)
if ((a = archive_read_new()) == NULL)
return NULL;
archive_read_support_compression_all(a);
archive_read_support_compression_gzip(a);
archive_read_support_compression_bzip2(a);
archive_read_support_compression_xz(a);
archive_read_support_format_tar(a);
if (archive_read_open_filename(a, url,