summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Woodfall <dave@slackbuilds.org>2021-02-25 01:25:42 +0000
committerDave Woodfall <dave@slackbuilds.org>2021-02-25 01:25:42 +0000
commit85c9f01361cba4eef97c2436f36c11e743bb4d12 (patch)
treec8ea286c7d89a28f836cc34214496801a53d18cb
parenta96e181033b963ea33b53597375598909a128d13 (diff)
downloadslackpkg-85c9f01361cba4eef97c2436f36c11e743bb4d12.tar.xz
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.
-rw-r--r--files/core-functions.sh14
1 files 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 )