tar: fix interaction of delayed symlink and hardlink creation

function                                             old     new   delta
create_or_remember_link                                -     106    +106
create_links_from_list                                 -      93     +93
find_applet_by_name                                  124     128      +4
unzip_main                                          2724    2726      +2
data_extract_all                                     891     873     -18
create_symlinks_from_list                             64       -     -64
create_or_remember_symlink                            94       -     -94
------------------------------------------------------------------------------
(add/remove: 2/2 grow/shrink: 2/1 up/down: 205/-176)           Total: 29 bytes

Signed-off-by: Harald van Dijk <harald@gigawatt.nl>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Harald van Dijk
2018-05-22 17:34:31 +02:00
committed by Denys Vlasenko
parent a40a661d97
commit 8c24af9dcf
8 changed files with 47 additions and 30 deletions

View File

@@ -365,4 +365,20 @@ n8fYaKlioCTzL2oXYczyUUIP4u5IpwoSEwWdtoA=
SKIP=
cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
mkdir tar.tempdir && cd tar.tempdir || exit 1
testing "Symlinks and hardlinks coexist" '\
mkdir dir
>dir/a
ln -s ../dir/a dir/b
ln dir/b dir/c
mkdir new
tar cf - dir/* | tar -C new -xvf - 2>&1
' "\
dir/a
dir/b
dir/c
" \
"" ""
cd .. || exit 1; rm -rf tar.tempdir 2>/dev/null
exit $FAILCOUNT