aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss13
1 files changed, 9 insertions, 4 deletions
diff --git a/kiss b/kiss
index 5daa7ec..d471b2d 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_etc() {
@@ -1262,7 +1267,7 @@ args() {
# Rerun the script with 'su' if the user isn't root.
# Cheeky but 'su' can't be used on shell functions themselves.
[ -z "$1" ] || [ "$uid" = 0 ] || {
- as_root kiss "$action" "$@"
+ as_root "$0" "$action" "$@"
return
}
;;
@@ -1271,7 +1276,7 @@ args() {
# Rerun the script with 'su' if the user isn't root.
# Cheeky but 'su' can't be used on shell functions themselves.
[ "$uid" = 0 ] || {
- KISS_FORCE="$KISS_FORCE" as_root kiss "$action" "$@"
+ KISS_FORCE="$KISS_FORCE" as_root "$0" "$action" "$@"
return
}
;;