summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2006-11-09 14:46:07 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2006-11-09 14:46:07 +0000
commit056d4333df4a6dfe0fff7007aef909b8f32fea32 (patch)
tree3be8c4f8895f9500dc8ea9a8cb327406e007f31b /app-arch/bsdtar
parentVersion bump (#154328). (diff)
downloadgentoo-2-056d4333df4a6dfe0fff7007aef909b8f32fea32.tar.gz
gentoo-2-056d4333df4a6dfe0fff7007aef909b8f32fea32.tar.bz2
gentoo-2-056d4333df4a6dfe0fff7007aef909b8f32fea32.zip
Add patch to fix the infinite loop as per bug #154334.
(Portage version: 2.1.2_rc1-r4)
Diffstat (limited to 'app-arch/bsdtar')
-rw-r--r--app-arch/bsdtar/ChangeLog8
-rw-r--r--app-arch/bsdtar/bsdtar-1.3.1-r2.ebuild83
-rw-r--r--app-arch/bsdtar/files/digest-bsdtar-1.3.1-r23
-rw-r--r--app-arch/bsdtar/files/libarchive-1.3.1-infiniteloop.patch55
4 files changed, 148 insertions, 1 deletions
diff --git a/app-arch/bsdtar/ChangeLog b/app-arch/bsdtar/ChangeLog
index acb5d61af61f..cc2ec070b344 100644
--- a/app-arch/bsdtar/ChangeLog
+++ b/app-arch/bsdtar/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-arch/bsdtar
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/bsdtar/ChangeLog,v 1.39 2006/10/17 12:01:10 uberlord Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-arch/bsdtar/ChangeLog,v 1.40 2006/11/09 14:46:07 flameeyes Exp $
+
+*bsdtar-1.3.1-r2 (09 Nov 2006)
+
+ 09 Nov 2006; Diego Pettenò <flameeyes@gentoo.org>
+ +files/libarchive-1.3.1-infiniteloop.patch, +bsdtar-1.3.1-r2.ebuild:
+ Add patch to fix the infinite loop as per bug #154334.
17 Oct 2006; Roy Marples <uberlord@gentoo.org> bsdtar-1.3.1-r1.ebuild:
Added ~sparc-fbsd keyword.
diff --git a/app-arch/bsdtar/bsdtar-1.3.1-r2.ebuild b/app-arch/bsdtar/bsdtar-1.3.1-r2.ebuild
new file mode 100644
index 000000000000..e1f17977bcf7
--- /dev/null
+++ b/app-arch/bsdtar/bsdtar-1.3.1-r2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/bsdtar/bsdtar-1.3.1-r2.ebuild,v 1.1 2006/11/09 14:46:07 flameeyes Exp $
+
+WANT_AUTOCONF=latest
+WANT_AUTOMAKE=latest
+
+inherit eutils autotools toolchain-funcs flag-o-matic
+
+MY_P="libarchive-${PV}"
+
+DESCRIPTION="BSD tar command"
+HOMEPAGE="http://people.freebsd.org/~kientzle/libarchive/"
+SRC_URI="http://people.freebsd.org/~kientzle/libarchive/src/${MY_P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc-fbsd ~x86 ~x86-fbsd"
+IUSE="build static acl xattr"
+
+RDEPEND="!dev-libs/libarchive
+ kernel_linux? (
+ acl? ( sys-apps/acl )
+ xattr? ( sys-apps/attr )
+ )
+ !static? ( !build? (
+ app-arch/bzip2
+ sys-libs/zlib ) )"
+DEPEND="${RDEPEND}
+ kernel_linux? ( sys-fs/e2fsprogs
+ virtual/os-headers )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/libarchive-1.3.1-static.patch
+ epatch "${FILESDIR}"/libarchive-1.2.57-acl.patch
+ epatch "${FILESDIR}"/libarchive-1.2.53-strict-aliasing.patch
+ epatch "${FILESDIR}"/libarchive-1.3.1-infiniteloop.patch
+
+ eautoreconf
+ epunt_cxx
+}
+
+src_compile() {
+ local myconf
+
+ if use static || use build ; then
+ myconf="${myconf} --enable-static-bsdtar"
+ else
+ myconf="${myconf} --disable-static-bsdtar"
+ fi
+
+ econf \
+ --bindir=/bin \
+ $(use_enable acl) \
+ $(use_enable xattr) \
+ ${myconf} || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install || die "emake install failed"
+
+ # Create tar symlink for FreeBSD
+ if [[ ${CHOST} == *-freebsd* ]]; then
+ dosym bsdtar /bin/tar
+ dosym bsdtar.1.gz /usr/share/man/man1/tar.1.gz
+ fi
+
+ if use build; then
+ rm -rf "${D}"/usr
+ rm -rf "${D}"/lib/*.so*
+ return 0
+ fi
+
+ dodir /$(get_libdir)
+ mv "${D}"/usr/$(get_libdir)/*.so* "${D}"/$(get_libdir)
+ gen_usr_ldscript libarchive.so
+}
diff --git a/app-arch/bsdtar/files/digest-bsdtar-1.3.1-r2 b/app-arch/bsdtar/files/digest-bsdtar-1.3.1-r2
new file mode 100644
index 000000000000..853d5013146e
--- /dev/null
+++ b/app-arch/bsdtar/files/digest-bsdtar-1.3.1-r2
@@ -0,0 +1,3 @@
+MD5 c618d26d680ace57fcd5f59cea3151c6 libarchive-1.3.1.tar.gz 901173
+RMD160 e518f802d9a50afcfede6dd7cbb4f42b2cbe12a1 libarchive-1.3.1.tar.gz 901173
+SHA256 ad9eaf5779df75b9a0618a732eb227792e65db17c6713fe81ef5bff2bbc616a8 libarchive-1.3.1.tar.gz 901173
diff --git a/app-arch/bsdtar/files/libarchive-1.3.1-infiniteloop.patch b/app-arch/bsdtar/files/libarchive-1.3.1-infiniteloop.patch
new file mode 100644
index 000000000000..20c4c8f2688a
--- /dev/null
+++ b/app-arch/bsdtar/files/libarchive-1.3.1-infiniteloop.patch
@@ -0,0 +1,55 @@
+Index: lib/libarchive/archive_read_support_compression_none.c
+===================================================================
+RCS file: /home/ncvs/src/lib/libarchive/archive_read_support_compression_none.c,v
+retrieving revision 1.8
+diff -u -I__FBSDID -r1.8 archive_read_support_compression_none.c
+--- lib/libarchive/archive_read_support_compression_none.c 29 Aug 2006 04:59:25 -0000 1.8
++++ lib/libarchive/archive_read_support_compression_none.c 2 Nov 2006 05:17:28 -0000
+@@ -257,7 +257,9 @@
+ }
+
+ /*
+- * Skip at most request bytes. Skipped data is marked as consumed.
++ * Skip forward by exactly the requested bytes or else return
++ * ARCHIVE_FATAL. Note that this differs from the contract for
++ * read_ahead, which does not gaurantee a minimum count.
+ */
+ static ssize_t
+ archive_decompressor_none_skip(struct archive *a, size_t request)
+@@ -287,9 +289,7 @@
+ if (request == 0)
+ return (total_bytes_skipped);
+ /*
+- * If no client_skipper is provided, just read the old way. It is very
+- * likely that after skipping, the request has not yet been fully
+- * satisfied (and is still > 0). In that case, read as well.
++ * If a client_skipper was provided, try that first.
+ */
+ if (a->client_skipper != NULL) {
+ bytes_skipped = (a->client_skipper)(a, a->client_data,
+@@ -307,6 +307,12 @@
+ a->raw_position += bytes_skipped;
+ state->client_avail = state->client_total = 0;
+ }
++ /*
++ * Note that client_skipper will usually not satisfy the
++ * full request (due to low-level blocking concerns),
++ * so even if client_skipper is provided, we may still
++ * have to use ordinary reads to finish out the request.
++ */
+ while (request > 0) {
+ const void* dummy_buffer;
+ ssize_t bytes_read;
+@@ -314,6 +320,12 @@
+ &dummy_buffer, request);
+ if (bytes_read < 0)
+ return (bytes_read);
++ if (bytes_read == 0) {
++ /* We hit EOF before we satisfied the skip request. */
++ archive_set_error(a, ARCHIVE_ERRNO_MISC,
++ "Truncated input file (need to skip %d bytes)", (int)request);
++ return (ARCHIVE_FATAL);
++ }
+ assert(bytes_read >= 0); /* precondition for cast below */
+ min = minimum((size_t)bytes_read, request);
+ bytes_read = archive_decompressor_none_read_consume(a, min);