bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-tar] Recursing bug


From: Lutz Donnerhacke
Subject: [Bug-tar] Recursing bug
Date: Fri, 14 Feb 2014 18:01:23 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Hi,

I'v added a new test to check if the positional arguments --recursion and
-no-recursion works as expected.
Quoting from the documentation:
************************************************************************
   The `--no-recursion' and `--recursion' options apply to later
   options and operands, and can be overridden by later occurrences of
   `--no-recursion' and `--recursion'.  For example:

     $ tar -cf jams.tar --no-recursion grape --recursion grape/concord

   creates an archive with one entry for `grape', and the recursive
   contents of `grape/concord', but no entries under `grape' other than
   `grape/concord'.
************************************************************************

It does not work in 1.27.1, simply because the global argument parsing flag
is used instead of the stored flags. One example is:
 ~/tar-1.27.1$ fgrep -n1 recursion src/create.c
 1169-
 1170:  if (!recursion_option)
 1171-    return;

There are other refences, and I'm not sure how to fix it correctly. So I
provide a new test for this behavior.

Thank you for your work.

------------------------------------------------------------------------
# Process this file with autom4te to create testsuite. -*- Autotest -*-

# Test suite for GNU tar.
# Copyright 2014 Lutz Donnerhacke

# 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/>.

AT_SETUP([recurse: toggle])
AT_KEYWORDS([recurse options recurse02])

AT_TAR_CHECK([
mkdir directory1 directory2
touch directory1/file directory2/file
tar --create --file archive --no-recursion directory1 --recursion directory2 || 
exit 1
tar tf archive
],
[0],
[directory1/
directory2/
directory2/file
])

AT_CLEANUP
------------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]