mirror of
https://codeberg.org/kiss-community/kiss
synced 2025-01-21 18:04:40 -07:00
kiss: only move up directories if there is just one top level dir
This commit is contained in:
parent
d240830906
commit
02c254e388
6
kiss
6
kiss
@ -535,6 +535,11 @@ pkg_source_tar() {
|
|||||||
tar tf "$_tmp_file_pre" | sort -ut / -k1,1 > "$_tmp_file" ||
|
tar tf "$_tmp_file_pre" | sort -ut / -k1,1 > "$_tmp_file" ||
|
||||||
die "$repo_name" "Failed to extract manifest"
|
die "$repo_name" "Failed to extract manifest"
|
||||||
|
|
||||||
|
# Only move directories up a level if there is one top-level directory
|
||||||
|
# in the tarball. The tarball could contain all the files without a top
|
||||||
|
# directory, so in those more complicated cases, just give the build file
|
||||||
|
# the original tar structure.
|
||||||
|
case "$(wc -l <"$_tmp_file")" in 1)
|
||||||
# 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 case ${dir#.} in *?*)
|
||||||
@ -562,6 +567,7 @@ pkg_source_tar() {
|
|||||||
# 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"
|
esac done < "$_tmp_file"
|
||||||
|
esac
|
||||||
|
|
||||||
# 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