1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-12-25 00:20:05 -07:00

kiss: cleanup update code

This commit is contained in:
Dylan Araps 2020-09-12 18:04:30 +03:00
parent 9f1bf8dd0e
commit e7c934167e
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

14
kiss
View File

@ -1251,11 +1251,14 @@ pkg_updates() {
# Create a list of all repositories.
# See [1] at top of script.
# shellcheck disable=2046,2086
{ IFS=:; set -- $KISS_PATH; unset IFS; }
{
IFS=:
set -- $KISS_PATH
unset IFS
}
# Update each repository in '$KISS_PATH'.
for repo do
# Go to the root of the repository (if it exists).
cd "$repo"
case $(git remote 2>/dev/null) in
@ -1265,12 +1268,9 @@ pkg_updates() {
;;
*)
# Go to the repository's root directory.
cd "$(git rev-parse --show-toplevel)"
# Go to the real root directory if this is a submodule.
git_root=$(git rev-parse --show-superproject-working-tree)
cd "${git_root:-"$PWD"}"
cd "${git_root:-.}"
contains "$repos" "$PWD" || {
repos="$repos $PWD "
@ -1343,7 +1343,7 @@ pkg_updates() {
# Compare installed packages to repository packages.
[ "$db_ver-$db_rel" = "$re_ver-$re_rel" ] || {
printf '%s\n' "${pkg##*/} $db_ver-$db_rel ==> $re_ver-$re_rel"
printf '%s\n' "${pkg##*/} $db_ver-$db_rel -> $re_ver-$re_rel"
set -- "$@" "${pkg##*/}"
}
done