mirror of
https://git.savannah.gnu.org/git/tar.git
synced 2026-10-22 16:42:33 +00:00
It’s not clear what ‘-C x --one-top-dir=/abs/olute’ should mean, so for now let’s play it safe and reject that combination. * src/misc.c (chdir_arg): Diagnose attempts to combine -C with --one-top-level=/abs/olute. * tests/onetop06.at: Move last test to onetop07.at, since it now differs in behavior and it’s better to test it separately. * tests/onetop07.at: New file. * tests/Makefile.am (TESTSUITE_AT): Add it. * tests/testsuite.at: Include it.
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
# Process this file with autom4te to create testsuite. -*- Autotest -*-
|
|
#
|
|
# Test suite for GNU tar.
|
|
# Copyright 2026 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 into nonexistent absolute dir])
|
|
AT_KEYWORDS([extract onetop onetop06])
|
|
|
|
AT_TAR_CHECK([
|
|
mkdir d f && genfile --file d/file || framework_failure_
|
|
tar -cf test.tar d || exit
|
|
tar -xf test.tar --one-top-level=$PWD/e/c || exit
|
|
diff d e/c/d || exit
|
|
tar -xf test.tar --one-top-level=$PWD/e/d || exit
|
|
diff d e/d/d || exit
|
|
|
|
tar -cf test1.tar e/c || exit
|
|
tar -xf test1.tar -C f --one-top-level=e/c || exit
|
|
diff e/c/d f/e/c/d || exit
|
|
])
|
|
|
|
AT_CLEANUP
|