mirror of
https://codeberg.org/kiss-community/kiss
synced 2025-03-09 23:00:05 -06:00
kiss: simplify tar contains
This commit is contained in:
parent
a73f120c9d
commit
07c62219a1
7
kiss
7
kiss
@ -386,9 +386,8 @@ pkg_extract_tar_hack() {
|
|||||||
|
|
||||||
# Iterate over all directories in the first level of the
|
# Iterate over all directories in the first level of the
|
||||||
# tarball's manifest. Each directory is moved up a level.
|
# tarball's manifest. Each directory is moved up a level.
|
||||||
while IFS=/ read -r dir _; do case ${dir#.} in *?*)
|
while IFS=/ read -r dir _; do contains "$_seen" "${dir#.}" || {
|
||||||
# Skip duplicate directories.
|
_seen="$_seen $dir"
|
||||||
! contains "$_seen" "$dir" || continue && _seen="$_seen $dir"
|
|
||||||
|
|
||||||
# Move the parent directory to prevent naming conflicts
|
# Move the parent directory to prevent naming conflicts
|
||||||
# with the to-be-moved children.
|
# with the to-be-moved children.
|
||||||
@ -410,7 +409,7 @@ pkg_extract_tar_hack() {
|
|||||||
# transferred out of it. This can't be a simple 'rmdir'
|
# transferred out of it. This can't be a simple 'rmdir'
|
||||||
# as we may leave files in here if any were copied.
|
# as we may leave files in here if any were copied.
|
||||||
rm -rf "$KISS_PID-$dir"
|
rm -rf "$KISS_PID-$dir"
|
||||||
esac done < "$_tmp_file"
|
} done < "$_tmp_file"
|
||||||
|
|
||||||
# Remove the tarball now that we are done with it.
|
# Remove the tarball now that we are done with it.
|
||||||
rm -f "$_tmp_file_pre"
|
rm -f "$_tmp_file_pre"
|
||||||
|
Loading…
Reference in New Issue
Block a user