| 1 |
# Test suite for GNU tar. -*- autotest -*- |
| 2 |
# Copyright 2021-2023 Free Software Foundation, Inc. |
| 3 |
# |
| 4 |
# This file is part of GNU tar. |
| 5 |
# |
| 6 |
# GNU tar is free software; you can redistribute it and/or modify |
| 7 |
# it under the terms of the GNU General Public License as published by |
| 8 |
# the Free Software Foundation; either version 3 of the License, or |
| 9 |
# (at your option) any later version. |
| 10 |
# |
| 11 |
# GNU tar is distributed in the hope that it will be useful, |
| 12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 |
# GNU General Public License for more details. |
| 15 |
# |
| 16 |
# You should have received a copy of the GNU General Public License |
| 17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 18 |
AT_SETUP([--to-stdout]) |
| 19 |
AT_KEYWORDS([extract extrac24 to-stdout]) |
| 20 |
|
| 21 |
# Description: When extracting over pipe, only regular files should be |
| 22 |
# extracted. In tar 1.33 this was broken, so that members of other types |
| 23 |
# (in particular, directories) were extracted as usual. This test ensures |
| 24 |
# that this is no longer the case. |
| 25 |
# |
| 26 |
# References: https://bugs.archlinux.org/task/69373, |
| 27 |
# https://savannah.gnu.org/bugs/?60002 |
| 28 |
|
| 29 |
AT_TAR_CHECK([ |
| 30 |
mkdir dir/ |
| 31 |
echo TEXT > dir/file |
| 32 |
tar cf a.tar dir |
| 33 |
rm -r dir |
| 34 |
tar --extract --to-stdout --file a.tar |
| 35 |
test -d dir |
| 36 |
], |
| 37 |
[1], |
| 38 |
[TEXT |
| 39 |
]) |
| 40 |
|
| 41 |
AT_CLEANUP |