Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-arch/libarchive/files: libarchive-2.6.0-nolibs.patch
Date: Fri, 02 Jan 2009 21:45:21
Message-Id: E1LIrpY-0000aq-02@stork.gentoo.org
1 flameeyes 09/01/02 21:45:19
2
3 Added: libarchive-2.6.0-nolibs.patch
4 Log:
5 Fix building with bzip2 and zlib disabled, closes bug #253284. Thanks to Lifong Sun for the patch.
6 (Portage version: 2.2_rc20/cvs/Linux 2.6.28-gentoo x86_64)
7
8 Revision Changes Path
9 1.1 app-arch/libarchive/files/libarchive-2.6.0-nolibs.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/libarchive/files/libarchive-2.6.0-nolibs.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/libarchive/files/libarchive-2.6.0-nolibs.patch?rev=1.1&content-type=text/plain
13
14 Index: libarchive-2.6.0-nolibs.patch
15 ===================================================================
16 Patch from bug #253284 thanks to Lifong Sun
17
18 diff -urN a/cpio/cpio.c b/cpio/cpio.c
19 --- a/cpio/cpio.c 2008-12-29 04:08:16.000000000 +0800
20 +++ b/cpio/cpio.c 2009-01-01 22:23:06.000000000 +0800
21 @@ -321,7 +321,15 @@
22 "Common Options:\n"
23 " -v Verbose\n"
24 "Create: %p -o [options] < [list of files] > [archive]\n"
25 +#ifdef HAVE_BZLIB_H
26 +#ifdef HAVE_ZLIB_H
27 " -z, -y Compress archive with gzip/bzip2\n"
28 +#else
29 + " -y Compress archive with bzip2\n"
30 +#endif
31 +#elif defined HAVE_ZLIB_H
32 + " -z Compress archive with gzip\n"
33 +#endif
34 " --format {odc|newc|ustar} Select archive format\n"
35 "List: %p -it < [archive]\n"
36 "Extract: %p -i [options] < [archive]\n";
37 @@ -387,12 +395,16 @@
38 if (cpio->archive == NULL)
39 cpio_errc(1, 0, "Failed to allocate archive object");
40 switch (cpio->compress) {
41 +#ifdef HAVE_BZLIB_H
42 case 'j': case 'y':
43 archive_write_set_compression_bzip2(cpio->archive);
44 break;
45 +#endif
46 +#ifdef HAVE_ZLIB_H
47 case 'z':
48 archive_write_set_compression_gzip(cpio->archive);
49 break;
50 +#endif
51 case 'Z':
52 archive_write_set_compression_compress(cpio->archive);
53 break;