diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-12-29 10:03:44 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-12-29 10:03:44 +0000 |
commit | bab7f2a6435cb42a0bfa75c9076243bf7c0969b4 (patch) | |
tree | 8f64260644f9983f445506888f27a0745ecccf86 /app-arch/tar | |
parent | broken #252680 (diff) | |
download | historical-bab7f2a6435cb42a0bfa75c9076243bf7c0969b4.tar.gz historical-bab7f2a6435cb42a0bfa75c9076243bf7c0969b4.tar.bz2 historical-bab7f2a6435cb42a0bfa75c9076243bf7c0969b4.zip |
Revert an upstream change that breaks when piping data into tar as pointed out by Zac Medico #252680 by Etienne Hilson.
Package-Manager: portage-2.2_rc18/cvs/Linux 2.6.28 x86_64
Diffstat (limited to 'app-arch/tar')
-rw-r--r-- | app-arch/tar/ChangeLog | 9 | ||||
-rw-r--r-- | app-arch/tar/Manifest | 11 | ||||
-rw-r--r-- | app-arch/tar/files/tar-1.21-revert-pipe.patch | 123 | ||||
-rw-r--r-- | app-arch/tar/tar-1.21-r1.ebuild | 69 |
4 files changed, 206 insertions, 6 deletions
diff --git a/app-arch/tar/ChangeLog b/app-arch/tar/ChangeLog index e298978e59e2..bbb8a5eb595c 100644 --- a/app-arch/tar/ChangeLog +++ b/app-arch/tar/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-arch/tar # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/ChangeLog,v 1.137 2008/12/27 03:24:11 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/ChangeLog,v 1.138 2008/12/29 10:03:44 vapier Exp $ + +*tar-1.21-r1 (29 Dec 2008) + + 29 Dec 2008; Mike Frysinger <vapier@gentoo.org> + +files/tar-1.21-revert-pipe.patch, +tar-1.21-r1.ebuild: + Revert an upstream change that breaks when piping data into tar as pointed + out by Zac Medico #252680 by Etienne Hilson. *tar-1.21 (27 Dec 2008) diff --git a/app-arch/tar/Manifest b/app-arch/tar/Manifest index c0644abcbe73..64a637e8355a 100644 --- a/app-arch/tar/Manifest +++ b/app-arch/tar/Manifest @@ -2,17 +2,18 @@ Hash: SHA1 AUX rmt 273 RMD160 18f5fac369cc3372af7bd83384bb437a67baaa44 SHA1 971081167d145e45288a173d74ca19aa24c0c05e SHA256 8de946561fc5fe3603627c78c9777dc1f7bad7926171822f3a25958a6cd3be55 +AUX tar-1.21-revert-pipe.patch 3637 RMD160 a4bf5d640bba35cb5f55de7a1a1423a48342867e SHA1 b781ed64030235fddac784a53072a8336b90a3a3 SHA256 0c872589ad1abee21d1ba09f0f4572d490cf4cdc17c171f78578dc47ecbd573c AUX tar.1 13004 RMD160 c0afe404edbb6e11c2b4be51458056f115df30bd SHA1 ddd9670245e2026f26d7338cf0d0f1713f00b774 SHA256 9525814c05657180e309ee5fdf592cc61edbc92911921ed21fefc34bbe1dc36c DIST tar-1.20.tar.bz2 1912591 RMD160 cb5a708e847489e5370b83a433f3e847ce359e56 SHA1 4d4cda2ce857b5ea77b39dc718260ab09c145335 SHA256 be8bf33afb5adc2377e45d94693ffd46b75f267f9b808df0c7006e51211f9deb DIST tar-1.21.tar.bz2 2071237 RMD160 316e3148f0a392b66423fd73f7dae17cd2f03b90 SHA1 4563bc828e7d285eb466a9587af88e7e1556cf88 SHA256 dc6c70d2071ca4a928460b6d68ab500a32e67d50255261a0d17765a307aeb350 EBUILD tar-1.20.ebuild 1654 RMD160 b7bb0fc7bdcfbf33d00fc8a337e8c15c9a801147 SHA1 d80c6ea3d8e71e2a3c8eed9f652ac88babd17dec SHA256 1ba966014de965854cbd2a98aebb899392e889512492a5b5507c57fe59dba496 -EBUILD tar-1.21.ebuild 1669 RMD160 903abe461802ba4d3bfe2b706e621e77cf321abf SHA1 8fde2668556595131e20c2243d6ee6430464c75e SHA256 1a43da206f33e0cc32d6628f83573075282b084332f2e19ced77d8afdf388055 -MISC ChangeLog 20207 RMD160 9735bf7e1464f6e9a3d4f478bd2f0dfdd9742faf SHA1 d77eed4d36765b3adf6236e1d5147ed94caeaf83 SHA256 6060baf318d79163213dfc39851b8d365bb023c6e0f5c030dc25d7d9fa0f5559 +EBUILD tar-1.21-r1.ebuild 1726 RMD160 883679a053a99a63ea888559a8f5889a6cdd86dc SHA1 159394173339b721d428ba8dba83fb9cbbbe080f SHA256 3f1d013af4f3d0cc6532cd2113221f979559a639e206f8211351154e88bce0b7 +MISC ChangeLog 20468 RMD160 90534d225dc6617a17655c2c805918599824c0cd SHA1 3ad1d87bb0151b31107eece1bdb2315ce4f57d0f SHA256 e206c11b6483975dbf1b6d16f4c702d3ec8edd312f88b4bf5f8d7419ccf502c9 MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) -iEYEARECAAYFAklVn+EACgkQn/5bYzqsSmFuqQCgmGBxnzNihKu7QJfEgJo1WwwK -2skAnR0JWzCJRu7ppfuvetWTZug+qiZd -=K8+C +iEYEARECAAYFAklYoIUACgkQn/5bYzqsSmFx+ACePm5NkhWni0bh+sf/hCZQqRkH +iFkAn0YI1k9w7zlsgiqKWNblSAsVahO9 +=nKKC -----END PGP SIGNATURE----- diff --git a/app-arch/tar/files/tar-1.21-revert-pipe.patch b/app-arch/tar/files/tar-1.21-revert-pipe.patch new file mode 100644 index 000000000000..60ac7e665123 --- /dev/null +++ b/app-arch/tar/files/tar-1.21-revert-pipe.patch @@ -0,0 +1,123 @@ +http://bugs.gentoo.org/252680 + +revert this change: + +2008-11-25 Sergey Poznyakoff <gray@gnu.org.ua> + + Do not try to drain the input pipe before closing the + archive. + + * src/buffer.c (close_archive): Remove call to + sys_drain_input_pipe. Pass hit_eof as the second + argument to sys_wait_for_child. + * src/common.h (sys_drain_input_pipe): Remove + (sys_wait_for_child): Declare second argument. + * src/system.c (sys_drain_input_pipe): Remove. + (sys_wait_for_child): Take two arguments. The second one helps to + decide whether to tolerate child termination on SIGPIPE. + +diff --git a/src/buffer.c b/src/buffer.c +index 5f5457a..02a3e4c 100644 +--- a/src/buffer.c ++++ b/src/buffer.c +@@ -848,6 +848,8 @@ close_archive (void) + flush_archive (); + } + ++ sys_drain_input_pipe (); ++ + compute_duration (); + if (verify_option) + verify_volume (); +@@ -855,7 +857,7 @@ close_archive (void) + if (rmtclose (archive) != 0) + close_error (*archive_name_cursor); + +- sys_wait_for_child (child_pid, hit_eof); ++ sys_wait_for_child (child_pid); + + tar_stat_destroy (¤t_stat_info); + if (save_name) +diff --git a/src/common.h b/src/common.h +index 9897b46..cc3483e 100644 +--- a/src/common.h ++++ b/src/common.h +@@ -699,7 +699,8 @@ char *xheader_format_name (struct tar_stat_info *st, const char *fmt, + + void sys_detect_dev_null_output (void); + void sys_save_archive_dev_ino (void); +-void sys_wait_for_child (pid_t, bool); ++void sys_drain_input_pipe (void); ++void sys_wait_for_child (pid_t); + void sys_spawn_shell (void); + bool sys_compare_uid (struct stat *a, struct stat *b); + bool sys_compare_gid (struct stat *a, struct stat *b); +diff --git a/src/system.c b/src/system.c +index c90a40d..e57e6da 100644 +--- a/src/system.c ++++ b/src/system.c +@@ -1,7 +1,6 @@ + /* System-dependent calls for tar. + +- Copyright (C) 2003, 2004, 2005, 2006, 2007, +- 2008 Free Software Foundation, Inc. ++ Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the +@@ -52,7 +51,12 @@ sys_detect_dev_null_output (void) + } + + void +-sys_wait_for_child (pid_t child_pid, bool eof) ++sys_drain_input_pipe (void) ++{ ++} ++ ++void ++sys_wait_for_child (pid_t child_pid) + { + } + +@@ -156,8 +160,26 @@ sys_detect_dev_null_output (void) + && archive_stat.st_ino == dev_null_stat.st_ino)); + } + ++/* Manage to fully drain a pipe we might be reading, so to not break it on ++ the producer after the EOF block. FIXME: one of these days, GNU tar ++ might become clever enough to just stop working, once there is no more ++ work to do, we might have to revise this area in such time. */ ++ ++void ++sys_drain_input_pipe (void) ++{ ++ size_t r; ++ ++ if (access_mode == ACCESS_READ ++ && ! _isrmt (archive) ++ && (S_ISFIFO (archive_stat.st_mode) || S_ISSOCK (archive_stat.st_mode))) ++ while ((r = rmtread (archive, record_start->buffer, record_size)) != 0 ++ && r != SAFE_READ_ERROR) ++ continue; ++} ++ + void +-sys_wait_for_child (pid_t child_pid, bool eof) ++sys_wait_for_child (pid_t child_pid) + { + if (child_pid) + { +@@ -171,11 +193,8 @@ sys_wait_for_child (pid_t child_pid, bool eof) + } + + if (WIFSIGNALED (wait_status)) +- { +- int sig = WTERMSIG (wait_status); +- if (!(!eof && sig == SIGPIPE)) +- ERROR ((0, 0, _("Child died with signal %d"), sig)); +- } ++ ERROR ((0, 0, _("Child died with signal %d"), ++ WTERMSIG (wait_status))); + else if (WEXITSTATUS (wait_status) != 0) + ERROR ((0, 0, _("Child returned status %d"), + WEXITSTATUS (wait_status))); diff --git a/app-arch/tar/tar-1.21-r1.ebuild b/app-arch/tar/tar-1.21-r1.ebuild new file mode 100644 index 000000000000..2732d023a371 --- /dev/null +++ b/app-arch/tar/tar-1.21-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/tar-1.21-r1.ebuild,v 1.1 2008/12/29 10:03:44 vapier Exp $ + +inherit flag-o-matic eutils + +DESCRIPTION="Use this to make tarballs :)" +HOMEPAGE="http://www.gnu.org/software/tar/" +SRC_URI="http://ftp.gnu.org/gnu/tar/${P}.tar.bz2 + ftp://alpha.gnu.org/gnu/tar/${P}.tar.bz2 + mirror://gnu/tar/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="nls static userland_GNU" + +RDEPEND="" +DEPEND="${RDEPEND} + nls? ( >=sys-devel/gettext-0.10.35 )" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${P}-revert-pipe.patch #252680 + + if ! use userland_GNU ; then + sed -i \ + -e 's:/backup\.sh:/gbackup.sh:' \ + scripts/{backup,dump-remind,restore}.in \ + || die "sed non-GNU" + fi +} + +src_compile() { + local myconf + use static && append-ldflags -static + use userland_GNU || myconf="--program-prefix=g" + # Work around bug in sandbox #67051 + gl_cv_func_chown_follows_symlink=yes \ + econf \ + --enable-backup-scripts \ + --bindir=/bin \ + --libexecdir=/usr/sbin \ + $(use_enable nls) \ + ${myconf} || die + emake || die "emake failed" +} + +src_install() { + local p="" + use userland_GNU || p=g + + emake DESTDIR="${D}" install || die "make install failed" + + if [[ -z ${p} ]] ; then + # a nasty yet required piece of baggage + exeinto /etc + doexe "${FILESDIR}"/rmt || die + fi + + dodoc AUTHORS ChangeLog* NEWS README* PORTS THANKS + newman "${FILESDIR}"/tar.1 ${p}tar.1 + mv "${D}"/usr/sbin/${p}backup{,-tar} + mv "${D}"/usr/sbin/${p}restore{,-tar} + + rm -f "${D}"/usr/$(get_libdir)/charset.alias +} |