From fab34f69eb47aaa704e2103502f43a8fc51404bc Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 19 Jul 2021 10:59:05 +0300 Subject: [PATCH] kiss: use fnr to remove manifest Prevents us looping once for each package installed. --- kiss | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/kiss b/kiss index c432ae2..49823bb 100755 --- a/kiss +++ b/kiss @@ -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