Files
tar/tests/onetop04.at
Sergey Poznyakoff e426787454 Fix bug in the inplementation of --one-top-level.
When extracting an archive that contains './' with the --one-top-level option,
the mode and ownership of '.' would be incorrectly applied to the current
working directory, instead of the requested top-level directory.

* src/list.c (enforce_one_top_level): Map '.' to the top-level
directory.
* tests/Makefile.am: Add onetop05.at
* tests/testsuite.at: Include onetop05.at.
* tests/onetop05.at: New file.
* tests/onetop01.at: Fix keywords.
* tests/onetop02.at: Likewise.
* tests/onetop03.at: Likewise.
* tests/onetop04.at: Likewise.
2015-11-21 21:56:49 +02:00

39 lines
1.1 KiB
Plaintext

# Process this file with autom4te to create testsuite. -*- Autotest -*-
#
# Test suite for GNU tar.
# Copyright 2014,2015 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/>.
#
AT_SETUP([tar --one-top-level --transform])
AT_KEYWORDS([extract onetop onetop04])
AT_TAR_CHECK([
AT_SORT_PREREQ
mkdir a
genfile --file a/b
genfile --file c
tar cf a.tar a c
tar -tf a.tar --one-top-level --transform 's/c/d/' --show-transformed | sort
],
[0],
[a/
a/b
a/d
])
AT_CLEANUP