commit ddd98220140b4dee2a680494e0255325d84863b9 parent 446137c67442a4d6de45305136074a744fc20a01 Author: Ethan Sommer <e5ten.arch@gmail.com> Date: Tue, 28 Apr 2020 02:17:01 -0400 kiss: replace sed -i with redirection to a temp file Diffstat:
M | kiss | | | 9 | +++++++-- |
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git 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() {