On Wednesday, March 12, 2014 14:29:50 David Lowe wrote:
> Howdy folks,
> 
> We've come across a bug when combining --recursive-unlink with
> --directory... namely, that --recursive-unlink doesn't work anymore!
> I'll demonstrate:

Thanks for the report, this issue seem to be fixed in tar's git from
commit 738fb9c and up:

  commit 738fb9c2f44eee567bb60e22dc011bdfd2f362a8 (refs/bisect/bad)
  Author:     Sergey Poznyakoff <[email protected]>
  AuthorDate: Sun Sep 15 10:13:45 2013 +0300

      Take into account chdir_fd when extracting from incremental dumps.

Could we install upstream testcase for recursive unlink?  Possible patch
attached.

Pavel
>From dc94be7fb5904bdcd6358c782a53d78915e8f960 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <[email protected]>
Date: Mon, 17 Mar 2014 10:00:22 +0100
Subject: [PATCH] testsute: add test for --recursive-unlink

* recunlink.at: New testcase.
* Makefile.am: Adjust for recunlink.at.
* testsuite.at: Likewise.
---
 tests/Makefile.am  |  1 +
 tests/recunlink.at | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/testsuite.at |  1 +
 3 files changed, 67 insertions(+)
 create mode 100644 tests/recunlink.at

diff --git a/tests/Makefile.am b/tests/Makefile.am
index d4c9362..6ea29c4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -158,6 +158,7 @@ TESTSUITE_AT = \
  options02.at\
  owner.at\
  pipe.at\
+ recunlink.at\
  recurse.at\
  recurs02.at\
  rename01.at\
diff --git a/tests/recunlink.at b/tests/recunlink.at
new file mode 100644
index 0000000..b765757
--- /dev/null
+++ b/tests/recunlink.at
@@ -0,0 +1,65 @@
+# Process this file with autom4te to create testsuite. -*- Autotest -*-
+
+# Test suite for GNU tar.
+# Copyright 2014 Free Software Foundation, Inc.
+
+# This file is part of GNU tar.
+
+# GNU tar is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU tar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test --recursive-unlink feature.
+# http://lists.gnu.org/archive/html/bug-tar/2014-03/msg00035.html
+
+AT_SETUP([recursive unlink])
+AT_KEYWORDS([recunlink])
+
+AT_TAR_CHECK([
+prep_hierarchy()
+{
+  rm -rf dir
+  mkdir dir
+  cd dir
+  mkdir foo
+  genfile --file foo/a
+  ln -s foo bar
+  cd ..
+}
+
+break_dir()
+{
+  rm -rf dir/bar
+  mv dir/foo dir/bar
+}
+
+prep_hierarchy
+tar cf archive -C dir bar
+
+break_dir
+
+cd dir
+tar xf ../archive --recursive-unlink
+cd ..
+
+echo separator
+
+prep_hierarchy
+break_dir
+
+tar xf archive -C dir --recursive-unlink
+],
+[0],
+[separator
+], [])
+
+AT_CLEANUP
diff --git a/tests/testsuite.at b/tests/testsuite.at
index c52890b..4b90fa5 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -213,6 +213,7 @@ m4_include([gzip.at])
 m4_include([recurse.at])
 m4_include([recurs02.at])
 m4_include([shortrec.at])
+m4_include([recunlink.at])
 
 AT_BANNER([The --same-order option])
 m4_include([same-order01.at])
-- 
1.8.5.3

Reply via email to