diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-06-19 06:20:37 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2019-06-19 06:20:37 +0000 |
commit | 6e72f4046a273d3188ca64df085fea6fb8ee2444 (patch) | |
tree | 3177c4ad0e7fc5f3b3ec6ecb4b0f7dee7ae2e73d /kiss | |
parent | 94215b6e320675064ab7da76cf44128327764fb1 (diff) | |
download | cpt-6e72f4046a273d3188ca64df085fea6fb8ee2444.tar.gz |
kiss: Make temporary files unique.
FossilOrigin-Name: 2ebaf2634a6dd7aa154dea8af4a18eb40fc6682fca2075f98d59e36871608435
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -21,7 +21,7 @@ source_type() { pkg_clean() { rm -rf -- "$mak_dir" "$pkg_dir" \ - "$cac_dir/manifest" "$cac_dir/tar" "$cac_dir/checksums" + "$cac_dir/manifest-$$" "$cac_dir/tar" "$cac_dir/checksums-$$" } pkg_search() { @@ -85,9 +85,9 @@ pkg_checksum() { } pkg_verify() { - pkg_checksum "$cac_dir/checksums" + pkg_checksum "$cac_dir/checksums-$$" - cmp -s "$cac_dir/checksums" checksums || + cmp -s "$cac_dir/checksums-$$" checksums || die "checksum mismatch, run '$kiss checksum $name'." } @@ -150,7 +150,7 @@ 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 - [ "${line%%*/}" ] && printf '%s\n' "$line" >> "$cac_dir/manifest" + [ "${line%%*/}" ] && printf '%s\n' "$line" >> "$cac_dir/manifest-$$" done # Compare extracted manifest to all installed manifests. @@ -159,7 +159,7 @@ pkg_conflicts() { for db in "$sys_db"/*; do [ "$name" = "${db##*/}" ] && continue - grep -Fxf "$cac_dir/manifest" "$db/manifest" && + grep -Fxf "$cac_dir/manifest-$$" "$db/manifest" && die "Package '$name' conflicts with '${db##*/}'." done } |