kiss: clean up pkg_conflicts()

This commit is contained in:
Dylan Araps 2020-05-22 12:53:40 +03:00
parent a747565ef4
commit c154233aa4
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 3 additions and 7 deletions

10
kiss
View File

@ -781,14 +781,10 @@ pkg_conflicts() {
# Filter the tarball's manifest and select only files. Resolve all
# symlinks in file paths as well.
while read -r file; do
while read -r file; do file=$KISS_ROOT/${file#/}
# Skip all directories.
case $file in */) continue; esac
# False positive.
# shellcheck disable=2031
old_PWD=$PWD file=$KISS_ROOT/${file#/}
# Attempt to resolve symlinks by using 'cd'.
# If this fails, fallback to the file's parent
# directory.
@ -797,8 +793,6 @@ pkg_conflicts() {
# Print the file with all symlinks in its path
# resolved to their real locations.
printf '%s\n' "${PWD#$KISS_ROOT}/${file##*/}"
cd "$old_PWD"
done < "$tar_dir/$1/$pkg_db/$1/manifest" > "$mak_dir/$pid-m"
p_name=$1
@ -875,6 +869,8 @@ pkg_conflicts() {
}
done < "$mak_dir/$pid-c"
log "$p_name" "Converted all conflicts to choices (kiss a)"
# Rewrite the package's manifest to update its location
# to its new spot (and name) in the choices directory.
pkg_manifest "$p_name" "$tar_dir" 2>/dev/null