mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-09-28 12:22:39 -06:00
kiss: remove case statement
This commit is contained in:
parent
7d50b6ec9d
commit
9456b9902c
77
kiss
77
kiss
@ -1353,56 +1353,55 @@ pkg_updates() {
|
|||||||
printf 'Skipping repository, not a directory\n'
|
printf 'Skipping repository, not a directory\n'
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
cd "$repo"
|
cd "$repo"
|
||||||
|
|
||||||
case $(git remote 2>/dev/null) in
|
git remote >/dev/null 2>&1 || {
|
||||||
"")
|
log "$repo" " "
|
||||||
log "$repo" " "
|
printf 'Skipping git pull, not a repository\n'
|
||||||
printf 'Skipping git pull, not a repository\n'
|
continue
|
||||||
;;
|
}
|
||||||
|
|
||||||
*)
|
# Go to the repository's root directory.
|
||||||
# Go to the repository's root directory.
|
git_root=$(git rev-parse --show-toplevel)
|
||||||
cd "$(git rev-parse --show-toplevel)"
|
cd "${git_root:?"failed to find git root for '$PWD'"}"
|
||||||
|
|
||||||
# Go to the real root directory if this is a submodule.
|
# Go to the real root directory if this is a submodule.
|
||||||
git_root=$(git rev-parse --show-superproject-working-tree)
|
git_root=$(git rev-parse --show-superproject-working-tree)
|
||||||
cd "${git_root:-"$PWD"}"
|
cd "${git_root:-"$PWD"}"
|
||||||
|
|
||||||
contains "$repos" "$PWD" || {
|
contains "$repos" "$PWD" || {
|
||||||
repos="$repos $PWD "
|
repos="$repos $PWD "
|
||||||
|
|
||||||
# Display a tick if signing is enabled for this repository.
|
# Display a tick if signing is enabled for this repository.
|
||||||
case $(git config merge.verifySignatures) in
|
case $(git config merge.verifySignatures) in
|
||||||
true) log "$PWD" "[signed] " ;;
|
true) log "$PWD" "[signed] " ;;
|
||||||
*) log "$PWD" " " ;;
|
*) log "$PWD" " " ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ -w "$PWD" ] && [ "$uid" != 0 ]; then
|
if [ -w "$PWD" ] && [ "$uid" != 0 ]; then
|
||||||
git pull
|
git pull
|
||||||
git submodule update --remote --init -f
|
git submodule update --remote --init -f
|
||||||
|
|
||||||
else
|
else
|
||||||
[ "$uid" = 0 ] || log "$PWD" "Need root to update"
|
[ "$uid" = 0 ] || log "$PWD" "Need root to update"
|
||||||
|
|
||||||
# Find out the owner of the repository and spawn
|
# Find out the owner of the repository and spawn
|
||||||
# git as this user below.
|
# git as this user below.
|
||||||
#
|
#
|
||||||
# This prevents 'git' from changing the original
|
# This prevents 'git' from changing the original
|
||||||
# ownership of files and directories in the rare
|
# ownership of files and directories in the rare
|
||||||
# case that the repository is owned by a 3rd user.
|
# case that the repository is owned by a 3rd user.
|
||||||
file_owner "$PWD"
|
file_owner "$PWD"
|
||||||
|
|
||||||
# We're in a repository which is owned by a 3rd
|
# We're in a repository which is owned by a 3rd
|
||||||
# user. Not root or the current user.
|
# user. Not root or the current user.
|
||||||
[ "$user" = root ] || log "Dropping to $user for pull"
|
[ "$user" = root ] || log "Dropping to $user for pull"
|
||||||
|
|
||||||
as_root git pull
|
as_root git pull
|
||||||
as_root git submodule update --remote --init -f
|
as_root git submodule update --remote --init -f
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
|
|
||||||
log "Checking for new package versions"
|
log "Checking for new package versions"
|
||||||
|
Loading…
Reference in New Issue
Block a user