diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-06-18 08:01:06 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-06-18 08:01:06 +0000 |
commit | f67cd748b5f56153519beacbde798d8fa02978de (patch) | |
tree | dfa82c9dcb43dca38c3ae0209800b29afee859e6 /kiss | |
parent | 1674a88b9152a541aec9981d2cd93c94049a635b (diff) | |
download | cpt-f67cd748b5f56153519beacbde798d8fa02978de.tar.gz |
kiss: Fix pkg_conflicts
FossilOrigin-Name: 20d92d7576a6432c81925f143d8fb4748167ad926bf4086994efa492aaaaa27b
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -125,8 +125,11 @@ pkg_strip() { } pkg_manifest() { - (cd "$pkg_dir" && find ./*) | sed -e ss.ss -e '1!G;h;$!d' | - tee manifest > "$pkg_db/$name/manifest" + # Store the file and directory list of the package. + # Directories have a trailing '/' and the list is sorted in reverse. + (cd "$pkg_dir" && { + find ./* -type d -print | sed 's!$!/!'; find . \! -type d + }) | sort -r | sed -e ss.ss | tee manifest > "$pkg_db/$name/manifest" } pkg_tar() { @@ -139,9 +142,9 @@ pkg_conflicts() { # Extract manifest from tarball and strip directories. tar xf "$bin_dir/$pkg" "./var/db/$kiss/$name/manifest" -O | - while read -r line; do - [ -f "$line" ] && printf '%s\n' "$line" >> "$cac_dir/manifest" - done + while read -r line; do + [ "${line%%*/}" ] && printf '%s\n' "$line" >> "$cac_dir/manifest" + done # Compare extracted manifest to all installed manifests. # If there are matching lines (files) there's a package @@ -152,8 +155,6 @@ pkg_conflicts() { grep -Fxf "$cac_dir/manifest" "$db/manifest" && die "Package '$name' conflicts with '${db##*/}'." done - - rm "$cac_dir/manifest" } pkg_install() { @@ -261,7 +262,7 @@ args() { } main() { - trap 'rm -rf -- "$mak_dir" "$pkg_dir"' EXIT INT + trap 'rm -rf -- "$mak_dir" "$pkg_dir" "$cac_dir/manifest"' EXIT INT kiss=${0##*/} [ -z "$KISS_PATH" ] && |