cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 2acd3691c8de0561b948d45b350d7518c2660a11
parent 4e2528071d7c3db695a2d294a8cac7cf2833d5f1
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat, 16 May 2020 02:12:28 +0300

kiss: do not abort if kiss-readlink fails

Diffstat:
MCHANGELOG.md | 11++++++++++-
Mkiss | 24+++++++++++++++++++-----
2 files changed, 29 insertions(+), 6 deletions(-)

diff --git 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 @@ -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