mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 00:20:05 -07:00
kiss: minor changes
This commit is contained in:
parent
de036042fb
commit
5d00c43720
43
kiss
43
kiss
@ -863,7 +863,13 @@ pkg_swap() {
|
|||||||
# Swap between package alternatives.
|
# Swap between package alternatives.
|
||||||
pkg_list "$1" >/dev/null
|
pkg_list "$1" >/dev/null
|
||||||
|
|
||||||
alt=$(printf %s "$1$2" | sed 's|/|>|g')
|
# pkg_name + /path/to/file -> pkg_name>path>to>file
|
||||||
|
alt=$(
|
||||||
|
printf %s "$1$2" |
|
||||||
|
|
||||||
|
sed 's|/|>|g'
|
||||||
|
)
|
||||||
|
|
||||||
cd "$sys_db/../choices"
|
cd "$sys_db/../choices"
|
||||||
|
|
||||||
if [ ! -f "$alt" ] && [ ! -h "$alt" ]; then
|
if [ ! -f "$alt" ] && [ ! -h "$alt" ]; then
|
||||||
@ -1225,44 +1231,41 @@ pkg_updates() {
|
|||||||
git pull && git submodule update --remote --init -f
|
git pull && git submodule update --remote --init -f
|
||||||
"
|
"
|
||||||
|
|
||||||
# 'sudo' and 'doas' properly parse command-line
|
# 'su' requires that command be quoted.
|
||||||
# arguments and split them in the common way. 'su'
|
case $su in *su)
|
||||||
# on the other hand requires that each argument be
|
git_cmd="'$git_cmd'"
|
||||||
# properly quoted as the command passed to it must
|
esac
|
||||||
# be a string... This sets quotes where needed.
|
|
||||||
case $su in *su) git_cmd="'$git_cmd'"; esac
|
|
||||||
|
|
||||||
# Spawn a subshell to run multiple commands as
|
as_root sh -c "$git_cmd"
|
||||||
# root at once. This makes things easier on users
|
|
||||||
# who aren't using persist/timestamps for auth
|
|
||||||
# caching.
|
|
||||||
user=$user as_root sh -c "$git_cmd"
|
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
[ ! -x update ] || {
|
if [ -x update ]; then
|
||||||
log "$PWD" "Running update hook"
|
log "$PWD" "Running update hook"
|
||||||
./update
|
./update
|
||||||
}
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
log "Checking for new package versions"
|
log "Checking for new package versions"
|
||||||
|
|
||||||
set +f --
|
set +f --
|
||||||
|
|
||||||
for pkg in "$sys_db/"*; do
|
for _pkg in "$sys_db/"*; do
|
||||||
pkg_find "${pkg##*/}"
|
pkg_find "${_pkg##*/}"
|
||||||
|
|
||||||
read -r db_ver db_rel < "$pkg/version"
|
read -r db_ver db_rel < "$_pkg/version"
|
||||||
read -r re_ver re_rel < "$repo_dir/version"
|
read -r re_ver re_rel < "$repo_dir/version"
|
||||||
|
|
||||||
# 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 %s-%s -> %s-%s\n' \
|
||||||
set -- "$@" "${pkg##*/}"
|
"${_pkg##*/}" \
|
||||||
|
"$db_ver" "$db_rel" \
|
||||||
|
"$re_ver" "$re_rel"
|
||||||
|
|
||||||
|
set -- "$@" "${_pkg##*/}"
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user