summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-04-20 16:49:46 +0000
committerMike Frysinger <vapier@gentoo.org>2015-04-20 16:49:46 +0000
commitff6253dddc51af9b16beb2185361dc117ffbd037 (patch)
tree8c6273678e1c569f2da836d39fcb00987a46c7c0
parentKeyword ~ppc and ~ppc64. Bug #544242. (diff)
downloadgentoo-2-ff6253dddc51af9b16beb2185361dc117ffbd037.tar.gz
gentoo-2-ff6253dddc51af9b16beb2185361dc117ffbd037.tar.bz2
gentoo-2-ff6253dddc51af9b16beb2185361dc117ffbd037.zip
Add fix from upstream for -A/-g flags #546294 by Alex Efros.
(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
-rw-r--r--app-arch/tar/ChangeLog10
-rw-r--r--app-arch/tar/files/tar-1.28-concat-listed.patch117
-rw-r--r--app-arch/tar/tar-1.28-r1.ebuild75
3 files changed, 200 insertions, 2 deletions
diff --git a/app-arch/tar/ChangeLog b/app-arch/tar/ChangeLog
index d9ed202e16d5..da4980595ecc 100644
--- a/app-arch/tar/ChangeLog
+++ b/app-arch/tar/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-arch/tar
-# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/ChangeLog,v 1.210 2014/08/12 12:17:44 vapier Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/ChangeLog,v 1.211 2015/04/20 16:49:46 vapier Exp $
+
+*tar-1.28-r1 (20 Apr 2015)
+
+ 20 Apr 2015; Mike Frysinger <vapier@gentoo.org>
+ +files/tar-1.28-concat-listed.patch, +tar-1.28-r1.ebuild:
+ Add fix from upstream for -A/-g flags #546294 by Alex Efros.
12 Aug 2014; Mike Frysinger <vapier@gentoo.org> tar-1.27.1-r2.ebuild:
Mark arm64/m68k/s390/sh stable.
diff --git a/app-arch/tar/files/tar-1.28-concat-listed.patch b/app-arch/tar/files/tar-1.28-concat-listed.patch
new file mode 100644
index 000000000000..28dc57824155
--- /dev/null
+++ b/app-arch/tar/files/tar-1.28-concat-listed.patch
@@ -0,0 +1,117 @@
+https://bugs.gentoo.org/546294
+https://lists.gnu.org/archive/html/bug-tar/2015-04/msg00006.html
+
+From 15c02c2b9d383446b3ea35dbea5a048e136b020d Mon Sep 17 00:00:00 2001
+From: Sergey Poznyakoff <gray@gnu.org.ua>
+Date: Thu, 16 Apr 2015 13:02:10 +0300
+Subject: [PATCH] Fix extraction from concatenated incremental archives.
+
+* src/common.h (remove_delayed_set_stat): New proto.
+* src/extract.c (free_delayed_set_stat)
+(remove_delayed_set_stat): New function.
+(apply_nonancestor_delayed_set_stat): Use free_delayed_set_stat.
+* src/misc.c (safer_rmdir): Remove delayed_set_stat entry
+corresponding to the removed directory.
+* tests/incr10.at: New test case.
+* tests/Makefile.am: Add new test.
+* tests/testsuite.at: Likewise.
+---
+ src/common.h | 2 ++
+ src/extract.c | 38 +++++++++++++++++++++++++++-----
+ src/misc.c | 7 +++++-
+ tests/Makefile.am | 1 +
+ tests/incr10.at | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ tests/testsuite.at | 1 +
+ 6 files changed, 107 insertions(+), 6 deletions(-)
+ create mode 100644 tests/incr10.at
+
+diff --git a/src/common.h b/src/common.h
+index 20cbb64..2904183 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -523,6 +523,8 @@ void extract_archive (void);
+ void extract_finish (void);
+ bool rename_directory (char *src, char *dst);
+
++void remove_delayed_set_stat (const char *fname);
++
+ /* Module delete.c. */
+
+ void delete_archive_members (void);
+diff --git a/src/extract.c b/src/extract.c
+index ca25603..5aaeb1b 100644
+--- a/src/extract.c
++++ b/src/extract.c
+@@ -537,6 +537,38 @@ repair_delayed_set_stat (char const *dir,
+ quotearg_colon (dir)));
+ }
+
++static void
++free_delayed_set_stat (struct delayed_set_stat *data)
++{
++ xheader_xattr_free (data->xattr_map, data->xattr_map_size);
++ free (data->cntx_name);
++ free (data->acls_a_ptr);
++ free (data->acls_d_ptr);
++ free (data);
++}
++
++void
++remove_delayed_set_stat (const char *fname)
++{
++ struct delayed_set_stat *data, *next, *prev = NULL;
++ for (data = delayed_set_stat_head; data; data = next)
++ {
++ next = data->next;
++ if (chdir_current == data->change_dir
++ && strcmp (data->file_name, fname) == 0)
++ {
++ free_delayed_set_stat (data);
++ if (prev)
++ prev->next = next;
++ else
++ delayed_set_stat_head = next;
++ return;
++ }
++ else
++ prev = data;
++ }
++}
++
+ /* After a file/link/directory creation has failed, see if
+ it's because some required directory was not present, and if so,
+ create all required directories. Return zero if all the required
+@@ -846,11 +878,7 @@ apply_nonancestor_delayed_set_stat (char const *file_name, bool after_links)
+ }
+
+ delayed_set_stat_head = data->next;
+- xheader_xattr_free (data->xattr_map, data->xattr_map_size);
+- free (data->cntx_name);
+- free (data->acls_a_ptr);
+- free (data->acls_d_ptr);
+- free (data);
++ free_delayed_set_stat (data);
+ }
+ }
+
+diff --git a/src/misc.c b/src/misc.c
+index 8e66643..d263c07 100644
+--- a/src/misc.c
++++ b/src/misc.c
+@@ -586,7 +586,12 @@ safer_rmdir (const char *file_name)
+ return -1;
+ }
+
+- return unlinkat (chdir_fd, file_name, AT_REMOVEDIR);
++ if (unlinkat (chdir_fd, file_name, AT_REMOVEDIR) == 0)
++ {
++ remove_delayed_set_stat (file_name);
++ return 0;
++ }
++ return -1;
+ }
+
+ /* Remove FILE_NAME, returning 1 on success. If FILE_NAME is a directory,
+--
+2.3.5
+
diff --git a/app-arch/tar/tar-1.28-r1.ebuild b/app-arch/tar/tar-1.28-r1.ebuild
new file mode 100644
index 000000000000..81304686c949
--- /dev/null
+++ b/app-arch/tar/tar-1.28-r1.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/tar-1.28-r1.ebuild,v 1.1 2015/04/20 16:49:46 vapier Exp $
+
+EAPI=4
+
+inherit flag-o-matic eutils
+
+DESCRIPTION="Use this to make tarballs :)"
+HOMEPAGE="http://www.gnu.org/software/tar/"
+SRC_URI="mirror://gnu/tar/${P}.tar.bz2
+ mirror://gnu-alpha/tar/${P}.tar.bz2"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="acl minimal nls selinux static userland_GNU xattr"
+
+RDEPEND="acl? ( virtual/acl )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ nls? ( >=sys-devel/gettext-0.10.35 )
+ xattr? ( sys-apps/attr )"
+
+src_prepare() {
+ if ! use userland_GNU ; then
+ sed -i \
+ -e 's:/backup\.sh:/gbackup.sh:' \
+ scripts/{backup,dump-remind,restore}.in \
+ || die "sed non-GNU"
+ fi
+ epatch "${FILESDIR}"/${P}-concat-listed.patch #546294
+}
+
+src_configure() {
+ use static && append-ldflags -static
+ FORCE_UNSAFE_CONFIGURE=1 \
+ econf \
+ --enable-backup-scripts \
+ --bindir="${EPREFIX}"/bin \
+ --libexecdir="${EPREFIX}"/usr/sbin \
+ $(usex userland_GNU "" "--program-prefix=g") \
+ $(use_with acl posix-acls) \
+ $(use_enable nls) \
+ $(use_with selinux) \
+ $(use_with xattr xattrs)
+}
+
+src_install() {
+ default
+
+ local p=$(usex userland_GNU "" "g")
+ if [[ -z ${p} ]] ; then
+ # a nasty yet required piece of baggage
+ exeinto /etc
+ doexe "${FILESDIR}"/rmt
+ fi
+
+ # autoconf looks for gtar before tar (in configure scripts), hence
+ # in Prefix it is important that it is there, otherwise, a gtar from
+ # the host system (FreeBSD, Solaris, Darwin) will be found instead
+ # of the Prefix provided (GNU) tar
+ if use prefix ; then
+ dosym tar /bin/gtar
+ fi
+
+ mv "${ED}"/usr/sbin/${p}backup{,-tar} || die
+ mv "${ED}"/usr/sbin/${p}restore{,-tar} || die
+
+ if use minimal ; then
+ find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
+ -type f -a '!' '(' -name tar -o -name ${p}tar ')' \
+ -delete || die
+ fi
+}