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.
This commit is contained in:
Dave Woodfall 2021-02-25 01:25:42 +00:00
parent a96e181033
commit 85c9f01361

View file

@ -784,8 +784,13 @@ function makelist() {
done done
else else
for i in ${PRIORITY[@]}; do 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 for FULLNAME in $PKGS ; do
NAME=$(cutpkg ${FULLNAME}) NAME=$(cutpkg ${FULLNAME})
@ -796,6 +801,11 @@ function makelist() {
done done
fi fi
rm -f $PKGNAMELIST rm -f $PKGNAMELIST
rm ${TMPDIR}/waiting
echo -e "DONE\n"
# We need to return early before the blacklist
return
;; ;;
esac esac
LIST=$( printf "%s\n" $LIST | applyblacklist | sort -u ) LIST=$( printf "%s\n" $LIST | applyblacklist | sort -u )