Hello,
In addition to my last post, I think that slackpkg should ignore whitespaces at start and end of patterns in /etc/slackpkg/blacklist: (1) there's no package whose name has spaces, and I doubt there will be. (2) the blacklist is applied using a grep with option -w, on data formatted as below :
Code:
name version arch fullname build
In this context, the command grep, with option -w, always fails when the pattern includes spaces:
Code:
$ for PAT in name version arch fullname build ; do echo "name version arch fullname build" | grep -Ew --color "${PAT} | ${PAT} | ${PAT}" ; done
The patch below is for latest slackpkg. With it, slackpkg removes spaces at start/end of patterns found in the blacklist before it is applied to the pre-selected packages.
Code:
--- core-functions.sh.orig 2016-08-16 17:46:10.258438259 +0200
+++ core-functions.sh 2016-08-16 17:46:10.258438259 +0200
@@ -558,7 +558,7 @@
INPUTLIST=$@
- grep -vE "(^#|^[[:blank:]]*$)" ${CONF}/blacklist > ${TMPDIR}/blacklist
+ grep -vE "(^#|^[[:blank:]]*$)" ${CONF}/blacklist | sed -e "s/^[[:space:]]*//" -e "s/[[:space:]]*$//" > ${TMPDIR}/blacklist
if echo $CMD | grep -q install ; then
ls -1 $ROOT/var/log/packages/* | awk -f /usr/libexec/slackpkg/pkglist.awk > ${TMPDIR}/tmplist
else
Without this patch, when blacklist contains any of the patterns " qemu", "qemu " or " qemu ", there's an unexpected update returned by command
slackpkg upgrade qemu :
Code:
$ grep qemu /etc/slackpkg/blacklist
qemu
$ slackpkg upgrade qemu
Checking local integrity... DONE
Looking for qemu in package list. Please wait... DONE
[ Repository ] [ Package ]
alienbob qemu-2.5.0-x86_64-1alien.txz
Total package(s): 1
Do you wish to upgrade selected packages (Y/n)? n
With the patch, there's no update for package qemu, as expected.
Code:
$ grep qemu /etc/slackpkg/blacklist
qemu
$ slackpkg upgrade qemu
No packages match the pattern for upgrade. Try:
/usr/sbin/slackpkg install|reinstall
--
SeB