From 85c9f01361cba4eef97c2436f36c11e743bb4d12 Mon Sep 17 00:00:00 2001 From: Dave Woodfall Date: Thu, 25 Feb 2021 01:25:42 +0000 Subject: Add blacklist to search option. This avoid matching against the last field in pkglist - txz, tgz which prints multiple false positives with 'slackpkg search xz' etc. --- files/core-functions.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/files/core-functions.sh b/files/core-functions.sh index 75f6ae6..61b61e0 100644 --- a/files/core-functions.sh +++ b/files/core-functions.sh @@ -784,8 +784,13 @@ function makelist() { done else for i in ${PRIORITY[@]}; do - PKGS=$(grep "^${i}.*${PATTERN}" \ - ${TMPDIR}/pkglist | cut -f6 -d\ ) + + # Test for search pattern in blacklist first + grep -q "^${PATTERN}$" ${TMPDIR}/blacklist && continue + + PKGS=$( cut -d\ -f1-7 ${TMPDIR}/pkglist | + grep "^${i}.*${PATTERN}" | cut -f6 -d\ ) + for FULLNAME in $PKGS ; do NAME=$(cutpkg ${FULLNAME}) @@ -796,6 +801,11 @@ function makelist() { done fi rm -f $PKGNAMELIST + rm ${TMPDIR}/waiting + + echo -e "DONE\n" + # We need to return early before the blacklist + return ;; esac LIST=$( printf "%s\n" $LIST | applyblacklist | sort -u ) -- cgit v1.2.3