diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-11-21 00:45:51 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-11-21 00:45:51 +0000 |
commit | ba7d98bee081198090bbc4eaea397aa41391256c (patch) | |
tree | d1ead376e7760c546200b0abf2bc7e66c6cf9265 /kiss | |
parent | 5e95d5c02dee39e9e083462ca1b216ee946c6b63 (diff) | |
download | cpt-ba7d98bee081198090bbc4eaea397aa41391256c.tar.gz |
kiss: Possible fix for conflict bug
FossilOrigin-Name: ed6c58322ca912177c92fd09e8ece906dd163d2776d740d925d86082998006ce
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -575,27 +575,27 @@ pkg_conflicts() { set +ef - # Extract manifest from tarball and only print files which - # exist in the filesystem. It's pointless to check for conflicts - # with files which don't presently exist. + # Filter the tarball's manifest and select only files + # and any files they resolve to on the filesystem \ + # (/bin/ls -> /usr/bin/ls). tar xf "$1" -O "./$pkg_db/$2/manifest" | while read -r file; do - [ -f "$KISS_ROOT/$file" ] && { - printf '%s\n' "$file" + case $file in */) continue; esac - (cd "$KISS_ROOT/"; readlink -f "./$file") - } + printf '%s\n' "$file" + + (cd "$KISS_ROOT/" && readlink -f "./$file") ||: done | # Filter the existing file list through the manifest of the # presently installed version of the package (if it exists). - grep -svFxf "$sys_db/$2/manifest" - 2>/dev/null > "$cac_dir/$pid-m" + grep -svFxf "$KISS_ROOT/$sys_db/$2/manifest" - \ + 2>/dev/null > "$cac_dir/$pid-m" # If the generated manifest contains matches, check the # contents for conflicts. - if [ -s "$cac_dir/$pid-m" ]; then + [ -s "$cac_dir/$pid-m" ] && grep -Fxf "$cac_dir/$pid-m" -- "$sys_db"/*/manifest && die "Package '$2' conflicts with another package" - fi set -ef } |