From f6ec1d1d588602b096819341ef5a0cc7c438667aeed3cade4d34f53717663114 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 14 Feb 2012 11:38:59 +0000 Subject: [PATCH] Accepting request 104794 from home:k0da:ppc - fix failed tests on ppc OBS-URL: https://build.opensuse.org/request/show/104794 OBS-URL: https://build.opensuse.org/package/show/Archiving/libarchive?expand=0&rev=9 --- libarchive-ignore-sigpipe-in-test-suite.patch | 34 +++++++++++++++++++ libarchive-test-fuzz.patch | 17 ++++++++++ libarchive.changes | 5 +++ libarchive.spec | 25 ++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 libarchive-ignore-sigpipe-in-test-suite.patch create mode 100644 libarchive-test-fuzz.patch diff --git a/libarchive-ignore-sigpipe-in-test-suite.patch b/libarchive-ignore-sigpipe-in-test-suite.patch new file mode 100644 index 0000000..27a6642 --- /dev/null +++ b/libarchive-ignore-sigpipe-in-test-suite.patch @@ -0,0 +1,34 @@ +diff -ur libarchive-2.8.5-orig/libarchive/test/main.c libarchive-2.8.5/libarchive/test/main.c +--- libarchive-2.8.5-orig/libarchive/test/main.c 2010-06-29 12:06:59.000000000 +1200 ++++ libarchive-2.8.5/libarchive/test/main.c 2011-11-04 20:36:13.000000000 +1300 +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + + /* + * This same file is used pretty much verbatim for all test harnesses. +@@ -1873,6 +1874,7 @@ + const char *tmp, *option_arg, *p; + char tmpdir[256]; + char tmpdir_timestamp[256]; ++ struct sigaction sa; + + (void)argc; /* UNUSED */ + +@@ -2002,6 +2004,14 @@ + #endif + + /* ++ * Ignore SIGPIPE signals ++ */ ++ sa.sa_handler = SIG_IGN; ++ sigemptyset(&sa.sa_mask); ++ sa.sa_flags = 0; ++ sigaction(SIGPIPE, &sa, NULL); ++ ++ /* + * Create a temp directory for the following tests. + * Include the time the tests started as part of the name, + * to make it easier to track the results of multiple tests. diff --git a/libarchive-test-fuzz.patch b/libarchive-test-fuzz.patch new file mode 100644 index 0000000..ba1e77e --- /dev/null +++ b/libarchive-test-fuzz.patch @@ -0,0 +1,17 @@ +Index: libarchive-2.8.5/libarchive/archive_read_support_format_iso9660.c +=================================================================== +--- libarchive-2.8.5.orig/libarchive/archive_read_support_format_iso9660.c ++++ libarchive-2.8.5/libarchive/archive_read_support_format_iso9660.c +@@ -2161,6 +2161,12 @@ read_CE(struct archive_read *a, struct i + } + do { + file = heap->reqs[0].file; ++ if (file->ce_offset + file->ce_size > step) { ++ archive_set_error(&a->archive, ++ ARCHIVE_ERRNO_FILE_FORMAT, ++ "Malformed CE information"); ++ return (ARCHIVE_FATAL); ++ } + p = b + file->ce_offset; + end = p + file->ce_size; + next_CE(heap); diff --git a/libarchive.changes b/libarchive.changes index 3bb116e..3cfcc86 100644 --- a/libarchive.changes +++ b/libarchive.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Feb 13 18:19:49 UTC 2012 - dvaleev@suse.com + +- fix failed tests on ppc + ------------------------------------------------------------------- Wed Feb 8 10:57:45 UTC 2012 - idonmez@suse.com diff --git a/libarchive.spec b/libarchive.spec index 228178d..20d38b3 100644 --- a/libarchive.spec +++ b/libarchive.spec @@ -16,6 +16,7 @@ # + Name: libarchive Version: 2.8.5 Release: 0 @@ -39,6 +40,9 @@ Url: http://code.google.com/p/libarchive/ Source0: http://libarchive.googlecode.com/files/libarchive-%{version}.tar.gz Source1: baselibs.conf Patch1: libarchive-2.5.5_handle_ENOSYS_from_lutimes.patch +Patch2: libarchive-test-fuzz.patch +Patch3: libarchive-ignore-sigpipe-in-test-suite.patch + %description Libarchive is a programming library that can create and read several @@ -52,17 +56,23 @@ and 6. This package contains the bsdtar cmdline utility. %package -n bsdtar + + Summary: Creates and reads several different streaming archive formats Group: Productivity/Archiving/Compression + %description -n bsdtar This package contains the bsdtar cmdline utility. %package -n libarchive2 + + # Summary: Library to work with several different streaming archive formats Group: Development/Libraries/C and C++ + %description -n libarchive2 Libarchive is a programming library that can create and read several different streaming archive formats, including most popular tar @@ -117,6 +127,8 @@ I/O. It should be very easy to add new formats, new compression methods, or new ways of reading/writing archives. %package -n libarchive-devel + + Requires: libacl-devel Requires: libarchive2 = %{version} Requires: zlib-devel @@ -124,6 +136,7 @@ Requires: libbz2-devel Summary: Development files for libarchive Group: Development/Libraries/C and C++ + %description -n libarchive-devel Libarchive is a programming library that can create and read several different streaming archive formats, including most popular tar @@ -138,15 +151,20 @@ This package contains the development files. %prep %setup -q -n %{name}-%{version} %patch1 +%patch2 -p1 +%patch3 -p1 + %build #autoreconf -fi %configure --disable-static --enable-bsdcpio make %{?_smp_mflags} + %check make check + %install %makeinstall @@ -154,10 +172,13 @@ rm -fv minitar/*.o rm -fv %{buildroot}%{_libdir}/*.la rm "%{buildroot}%{_mandir}/man5/"{tar,cpio,mtree}.5* + %post -n libarchive2 -p /sbin/ldconfig + %postun -n libarchive2 -p /sbin/ldconfig + %files -n bsdtar %defattr(-,root,root) %{_bindir}/bsdtar @@ -165,11 +186,13 @@ rm "%{buildroot}%{_mandir}/man5/"{tar,cpio,mtree}.5* %{_mandir}/man1/* %{_mandir}/man5/* + %files -n libarchive2 %defattr(-,root,root) %{_libdir}/libarchive.so.* %doc COPYING INSTALL NEWS README examples/ + %files -n libarchive-devel %defattr(-,root,root) %{_mandir}/man3/* @@ -177,4 +200,6 @@ rm "%{buildroot}%{_mandir}/man5/"{tar,cpio,mtree}.5* %{_includedir}/archive* %{_libdir}/pkgconfig/libarchive.pc + + %changelog