summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Woodfall <dave@tty1.uk>2018-12-30 09:29:42 +0000
committerRobby Workman <rworkman@slackware.com>2018-12-30 04:18:24 -0600
commita14cc9c88821f9ff9016bb477bce50d02ee9cbf8 (patch)
tree0058d95370240d21f1169497b29e6e9077a1bac9
parentfdba68e52972bc36249c3ce75f8432fe905b10dc (diff)
downloadslackpkg-a14cc9c88821f9ff9016bb477bce50d02ee9cbf8.tar.xz
Fix support for blacklisting entire package sets
Blacklisted sets now need a trailing / (eg. kde/) Anything with a trailing slash is excluded from having \s added to it. Then the slash is removed so the set is picked up by the old functionality. Signed-off-by: Robby Workman <rworkman@slackware.com>
-rw-r--r--files/blacklist.new14
-rw-r--r--files/core-functions.sh12
2 files changed, 19 insertions, 7 deletions
diff --git a/files/blacklist.new b/files/blacklist.new
index df47915..34cf0d1 100644
--- a/files/blacklist.new
+++ b/files/blacklist.new
@@ -7,9 +7,11 @@
#
# You can blacklist using regular expressions.
#
-# Don't use *full* regex here, because all of the following
-# will be checked for the regex: series, name, version, arch,
-# build and fullname.
+# Don't use *full* regex here, because all of the following will be checked
+# for the regex: series, name, version, arch, build, and fullname.
+# When blacklisting packages, you can use extended regex on package names
+# (such as xorg-.* instead of xorg-server, xorg-docs, etc), and a trailing
+# slash for package series ("n/", "ap/", "xap/", etc).
#
# To blacklist *only* the "xorg-server" package, use this:
# xorg-server
@@ -17,12 +19,14 @@
# To blacklist *all* of the "xorg-server-*" packages, use this:
# xorg-server.*
#
+# To blacklist the entire KDE package set, use this:
+# kde/
+#
# You will need to escape any special characters that are present in the
# package name. For example, to blacklist the gcc-g++ package, use this:
# gcc-g\+\+
#
-# DON'T put any space(s) before or after the package name or regexp.
-# If you do this, the blacklist will NOT work.
+# DON'T put any space(s) before or after the package name or regex.
#
# Automated upgrade of kernel packages may not be wanted in some situations;
# uncomment the lines below if that fits your circumstances:
diff --git a/files/core-functions.sh b/files/core-functions.sh
index d8756d3..76aebc0 100644
--- a/files/core-functions.sh
+++ b/files/core-functions.sh
@@ -476,7 +476,12 @@ slackpkg - version $VERSION\n\
in slackpkg's manpage. You can use partial package names (such as xorg
instead of xorg-server, xorg-docs, etc), or even Slackware series
(such as "n","ap","xap",etc) when searching for packages.
-"
+\nWhen blacklisting packages you can use extended regex on package names
+(such as xorg-.* instead of xorg-server, xorg-docs, etc), and a trailing
+slash for package series ("n/", "ap/", "xap/", etc).
+
+Note that special characters in blacklisted package names, such as '+', need
+escaping: gcc-g\\+\\+"
cleanup
}
@@ -585,7 +590,10 @@ function makelist() {
INPUTLIST=$@
grep -vE "(^#|^[[:blank:]]*$)" ${CONF}/blacklist | \
- sed -E "s,^, ,;s,$, ,;s,^\s(extra|pasture|patches|slackware(|64)|testing|txz)\s,\1," \
+ sed -E "s,^, ,
+ s,$, ,
+ s,^\s(extra|pasture|patches|slackware(|64)|testing|txz|.*/)\s$,\1,
+ s,/$,," \
> ${TMPDIR}/blacklist
if echo $CMD | grep -q install ; then