kiss: use fnr to remove manifest

Prevents us looping once for each package installed.
This commit is contained in:
Dylan Araps 2021-07-19 10:59:05 +03:00
parent 52b3c72340
commit fab34f69eb
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
1 changed files with 5 additions and 11 deletions

16
kiss
View File

@ -1042,18 +1042,12 @@ pkg_conflicts() {
set +f
set -f "$sys_db"/*/manifest
# Generate a list of all installed package manifests and remove the
# current package from the list. This is the simplest method of
# dropping an item from the argument list. The one downside is that
# it cannot live in a function due to scoping of arguments.
for manifest do
shift
# Remove the current package from the manifest list.
fnr "$*" "$sys_db/$_pkg/manifest" ""
! equ "$manifest" "$sys_db/$_pkg/manifest" ||
continue
set -- "$@" "$manifest"
done
# Intentional, globbing disabled.
# shellcheck disable=2046,2086
set -- $_fnr
# Return here if there is nothing to check conflicts against.
! equ "$#" 0 || return 0