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 --- CHANGELOG.md | 11 ++++++++++- kiss | 24 +++++++++++++++++++----- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9701f72..6bee04c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ this project _somewhat_ adheres to [Semantic Versioning]. [Keep a Changelog]: https://keepachangelog.com/en/1.0.0/ [Semantic Versioning]: https://semver.org/spec/v2.0.0.html -1.22.1 - 2020-05-15 +1.22.2 - 2020-05-16 ------------------- **NOTE:** `1.22.x` is the last minor version before `2.0.0`, meaning I will not be doing any @@ -15,6 +15,15 @@ releases except for patches and fixes. My attention is now on implementing binar I will be doing some 'release candidates' before release, as binary repositories will need user feedback. +### Fixed +- Fixed an issue where `pkg_conflicts` would abort if `kiss-readlink` failed due to missing + components. It now fallbacks to the original directory name. + + + +1.22.1 - 2020-05-15 +------------------- + ### REMOVED - Removed some contrib scripts and moved them to [kiss-extra] - `kiss-cargo-urlgen` 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