aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-04-29 13:01:16 +0000
committermerakor <cem@ckyln.com>2020-04-29 13:01:16 +0000
commit54129eee9bbe76a13155b1b183390f11ddddd9e4 (patch)
tree36ef953e94d5238ffadc5b0fd183e6c98e6dc8df
parent8997f5677be91c6063633eaa7dd619a3a1eb3244 (diff)
downloadcpt-54129eee9bbe76a13155b1b183390f11ddddd9e4.tar.gz
kiss: replace sed -i with redirection to a temp file
FossilOrigin-Name: cff50fe1f102942609154f9f51fac35e60cd90b8093ee20000b051bf2a7f6934
-rwxr-xr-xkiss9
1 files changed, 7 insertions, 2 deletions
diff --git a/kiss b/kiss
index 88dbb18..284076b 100755
--- a/kiss
+++ b/kiss
@@ -840,14 +840,19 @@ pkg_swap() {
# Convert the current owner to an alternative and rewrite
# its manifest file to reflect this.
cp -Pf "$2" "$pkg_owns>${alt#*>}"
- sed -i "$(esc "$2" "$PWD/$pkg_owns>${alt#*>}")" \
+ sed "$(esc "$2" "$PWD/$pkg_owns>${alt#*>}")" \
+ "../installed/$pkg_owns/manifest" > \
+ "../installed/$pkg_owns/manifest.tmp"
+ mv -f "../installed/$pkg_owns/manifest.tmp" \
"../installed/$pkg_owns/manifest"
fi
# Convert the desired alternative to a real file and rewrite
# the manifest file to reflect this. The reverse of above.
mv -f "$alt" "$2"
- sed -i "$(esc "$PWD/$alt" "$2")" "../installed/$1/manifest"
+ sed "$(esc "$PWD/$alt" "$2")" "../installed/$1/manifest" > \
+ "../installed/$1/manifest.tmp"
+ mv -f "../installed/$1/manifest.tmp" "../installed/$1/manifest"
}
pkg_install_files() {