From 91aaf984c843df030b33c2dc9419dfecc5da95a5 Mon Sep 17 00:00:00 2001 From: merakor Date: Fri, 15 May 2020 23:12:28 +0000 Subject: kiss: do not abort if kiss-readlink fails FossilOrigin-Name: c0ece3c29785b6423770c830b1047ba3fcf8ced4b9f4a805daa868067ea3ba9d --- kiss | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'kiss') diff --git a/kiss b/kiss index dc2def2..25288bb 100755 --- a/kiss +++ b/kiss @@ -800,11 +800,25 @@ pkg_conflicts() { # (/bin/ls -> /usr/bin/ls). while read -r file; do case $file in */) continue; esac - dirname="$(kiss-readlink "$KISS_ROOT/${file%/*}" 2>/dev/null)" - printf '%s/%s\n' \ - "${dirname#$KISS_ROOT}" \ - "${file##*/}" + # Use $KISS_ROOT in filename so that we follow its symlinks. + file=$KISS_ROOT/${file#/} + + # We will only follow the symlinks of the directories, so we + # reserve the directory name in this 'dirname' value. kiss-readlink + # functions in a similar fashion to 'readlink -f', it makes sure + # every component except for the first one to be available on + # the directory structure. If we cannot find it in the system, + # we don't need to make this much more complex by trying so + # hard to find it. Simply use the original directory name. + dirname="$(kiss-readlink "${file%/*}" 2>/dev/null)" || + dirname="${file%/*}" + + + # Combine the dirname and file values, and print them into the + # temporary manifest to be parsed. + printf '%s/%s\n' "${dirname#$KISS_ROOT}" "${file##*/}" + done < "$tar_dir/$1/$pkg_db/$1/manifest" > "$KISS_TMPDIR/$pid-m" p_name=$1 @@ -1504,7 +1518,7 @@ args() { l|list) pkg_list "$@" ;; u|update) pkg_updates ;; s|search) for pkg do pkg_find "$pkg" all; done ;; - v|version) log kiss 1.22.1 ;; + v|version) log kiss 1.22.2 ;; h|help|-h|--help|'') exec 2>&1 -- cgit v1.2.3