kiss: Don't keep logs around for updates. git does this for us.

This commit is contained in:
Dylan Araps 2020-02-09 11:29:05 +02:00
parent fbca8e30d9
commit 77b90da4e2
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

17
kiss
View File

@ -1037,7 +1037,7 @@ pkg_updates() {
# Where to store repository diffs for the update. # Where to store repository diffs for the update.
# At the same time, create the file so updates requiring root don't # At the same time, create the file so updates requiring root don't
# overwrite the user's existing permissions over the log. # overwrite the user's existing permissions over the log.
:> "${log_file:=$log_dir/update-$time-$pid}" :> "$mak_dir/log"
# Update each repository in '$KISS_PATH'. It is assumed that # Update each repository in '$KISS_PATH'. It is assumed that
# each repository is 'git' tracked. # each repository is 'git' tracked.
@ -1070,7 +1070,7 @@ pkg_updates() {
if [ -w "$PWD" ] && [ "$(id -u)" != 0 ]; then if [ -w "$PWD" ] && [ "$(id -u)" != 0 ]; then
git fetch git fetch
git diff >> "$log_file" git diff >> "$mak_dir/log"
git merge git merge
else else
@ -1084,7 +1084,7 @@ pkg_updates() {
# case that the repository is owned by a 3rd user. # case that the repository is owned by a 3rd user.
( (
user=$(stat -c %U "$PWD") user=$(stat -c %U "$PWD")
pull="git fetch && git diff >>'$log_file' && git merge" pull="git fetch && git diff >>'$mak_dir/log' && git merge"
[ "$user" = root ] || [ "$user" = root ] ||
log "Dropping permissions to $user for pull" log "Dropping permissions to $user for pull"
@ -1147,16 +1147,7 @@ pkg_updates() {
# Show a diff of each new change to the repositories. # Show a diff of each new change to the repositories.
# This spawns the user's set PAGER with a fallback to less. # This spawns the user's set PAGER with a fallback to less.
# [ "$KISS_AUDIT" ] && "${PAGER:-less}" "$mak_dir/log"
# Disable this warning as the behavior (C may run when A is true)
# is intentional and fine. It is to prevent pager error from
# causing the package manager to abort.
# shellcheck disable=2015
[ -s "$log_file" ] && {
log "Saved update log to $log_file"
[ "$KISS_AUDIT" ] && "${PAGER:-less}" "$log_file"
} ||:
# Tell 'pkg_build' to always prompt before build. # Tell 'pkg_build' to always prompt before build.
pkg_update=1 pkg_update=1