From a14cc9c88821f9ff9016bb477bce50d02ee9cbf8 Mon Sep 17 00:00:00 2001 From: Dave Woodfall Date: Sun, 30 Dec 2018 09:29:42 +0000 Subject: 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 --- files/blacklist.new | 14 +++++++++----- files/core-functions.sh | 12 ++++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'files') 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 -- cgit v1.2.3