From 001947d9bb10d5fa34ed498910ce70d516acedac Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 22 Feb 2012 04:16:36 +0100 Subject: [PATCH] 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. --- lib/package_unpack.c | 6 ++++-- lib/plist_fetch.c | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/package_unpack.c b/lib/package_unpack.c index f81255f8..f8680476 100644 --- a/lib/package_unpack.c +++ b/lib/package_unpack.c @@ -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) { diff --git a/lib/plist_fetch.c b/lib/plist_fetch.c index 07e585fc..567f4cf3 100644 --- a/lib/plist_fetch.c +++ b/lib/plist_fetch.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2011 Juan Romero Pardines. + * Copyright (c) 2009-2012 Juan Romero Pardines. * Copyright (c) 2008, 2009 Joerg Sonnenberger * 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,