kiss: skip already seen directories during tar hack

Fixed bug where fcft/fcft becomes fcft.
Also improves performance.
This commit is contained in:
Dylan Araps 2021-07-08 15:12:43 +03:00
parent 6db1ac3bd0
commit c2216a3388
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
1 changed files with 3 additions and 0 deletions

3
kiss
View File

@ -341,6 +341,9 @@ pkg_extract_tar_hack() {
# Iterate over all directories in the first level of the
# tarball's manifest.
tar tf "$tmp_dir/ktar" | while IFS=/ read -r dir _; do
# Skip the directory if seen before.
! contains "$_seen" "$dir" || continue && _seen="$_seen $dir"
# Some tarballs contain './' as the top-level directory,
# we need to skip these occurances.
[ -d "${dir#.}" ] || continue