From c2216a3388624277835e6103dbd8b3a6e0e86ba8 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 8 Jul 2021 15:12:43 +0300 Subject: [PATCH] kiss: skip already seen directories during tar hack Fixed bug where fcft/fcft becomes fcft. Also improves performance. --- kiss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kiss b/kiss index f855d09..46cfeb5 100755 --- a/kiss +++ b/kiss @@ -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