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
set -f "$sys_db"/*/manifest set -f "$sys_db"/*/manifest
# Generate a list of all installed package manifests and remove the # Remove the current package from the manifest list.
# current package from the list. This is the simplest method of fnr "$*" "$sys_db/$_pkg/manifest" ""
# 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
! equ "$manifest" "$sys_db/$_pkg/manifest" || # Intentional, globbing disabled.
continue # shellcheck disable=2046,2086
set -- $_fnr
set -- "$@" "$manifest"
done
# Return here if there is nothing to check conflicts against. # Return here if there is nothing to check conflicts against.
! equ "$#" 0 || return 0 ! equ "$#" 0 || return 0