From c154233aa4f842c5e29e93ba8ac1d04c292fde30 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 22 May 2020 12:53:40 +0300 Subject: [PATCH] kiss: clean up pkg_conflicts() --- kiss | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/kiss b/kiss index 9958f0c..eeee95c 100755 --- a/kiss +++ b/kiss @@ -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