aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-11-20 14:26:07 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-11-20 14:26:07 +0000
commit5e95d5c02dee39e9e083462ca1b216ee946c6b63 (patch)
treeeb503159598de02467fb56408b5ed0fa393c23a5
parentdbeab96c5fad767bec5eac0176496c12ba7a645b (diff)
downloadcpt-5e95d5c02dee39e9e083462ca1b216ee946c6b63.tar.gz
kiss: resolve symlinks in package conflict check.
FossilOrigin-Name: 8a227caf7afa7cbb3690e5d00842f487c34874e46204a40ae0723d0a0f012855
-rwxr-xr-xkiss9
1 files changed, 7 insertions, 2 deletions
diff --git a/kiss b/kiss
index 056a56f..bab4b43 100755
--- a/kiss
+++ b/kiss
@@ -579,7 +579,11 @@ pkg_conflicts() {
# exist in the filesystem. It's pointless to check for conflicts
# with files which don't presently exist.
tar xf "$1" -O "./$pkg_db/$2/manifest" | while read -r file; do
- [ -f "$KISS_ROOT/$file" ] && printf '%s\n' "$file"
+ [ -f "$KISS_ROOT/$file" ] && {
+ printf '%s\n' "$file"
+
+ (cd "$KISS_ROOT/"; readlink -f "./$file")
+ }
done |
# Filter the existing file list through the manifest of the
@@ -588,9 +592,10 @@ pkg_conflicts() {
# If the generated manifest contains matches, check the
# contents for conflicts.
- [ -s "$cac_dir/$pid-m" ] &&
+ if [ -s "$cac_dir/$pid-m" ]; then
grep -Fxf "$cac_dir/$pid-m" -- "$sys_db"/*/manifest &&
die "Package '$2' conflicts with another package"
+ fi
set -ef
}