mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 08:30:05 -07:00
kiss: cleanup update code
This commit is contained in:
parent
9f1bf8dd0e
commit
e7c934167e
14
kiss
14
kiss
@ -1251,11 +1251,14 @@ pkg_updates() {
|
|||||||
# Create a list of all repositories.
|
# Create a list of all repositories.
|
||||||
# See [1] at top of script.
|
# See [1] at top of script.
|
||||||
# shellcheck disable=2046,2086
|
# shellcheck disable=2046,2086
|
||||||
{ IFS=:; set -- $KISS_PATH; unset IFS; }
|
{
|
||||||
|
IFS=:
|
||||||
|
set -- $KISS_PATH
|
||||||
|
unset IFS
|
||||||
|
}
|
||||||
|
|
||||||
# Update each repository in '$KISS_PATH'.
|
# Update each repository in '$KISS_PATH'.
|
||||||
for repo do
|
for repo do
|
||||||
# Go to the root of the repository (if it exists).
|
|
||||||
cd "$repo"
|
cd "$repo"
|
||||||
|
|
||||||
case $(git remote 2>/dev/null) in
|
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)"
|
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)
|
git_root=$(git rev-parse --show-superproject-working-tree)
|
||||||
cd "${git_root:-"$PWD"}"
|
cd "${git_root:-.}"
|
||||||
|
|
||||||
contains "$repos" "$PWD" || {
|
contains "$repos" "$PWD" || {
|
||||||
repos="$repos $PWD "
|
repos="$repos $PWD "
|
||||||
@ -1343,7 +1343,7 @@ pkg_updates() {
|
|||||||
|
|
||||||
# Compare installed packages to repository packages.
|
# Compare installed packages to repository packages.
|
||||||
[ "$db_ver-$db_rel" = "$re_ver-$re_rel" ] || {
|
[ "$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##*/}"
|
set -- "$@" "${pkg##*/}"
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user