LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackpkg+ blacklist - how to blacklist third party package set? (https://www.linuxquestions.org/questions/slackware-14/slackpkg-blacklist-how-to-blacklist-third-party-package-set-4175695900/)

zdolar 06-02-2021 05:03 AM

slackpkg+ blacklist - how to blacklist third party package set?
 
Slackware64-current updated (slackpkg+-1.7.6-noarch-5mt)

How to properly blacklist certain package set from a third party repo?

Case: blacklist perl-*-?alien packages?
I wish to blacklist ONLY perl* packages from alienbob repository, as they are old (not for latest current) and they are messed up my sistem in the past. The perl package from slackware repository (perl-5.xxx86_64-?) must be excluded from the blacklist and so on the list for upgrade and enabled.
I install current perl scripts packages I need with cpan2tgz.

chrisretusn 06-02-2021 05:23 AM

You shouldn't need to blacklist third party packages using slackpkg with slackpkg+

Here is my slackpkplus.conf (applicable sections) as a reference
Code:

PKGS_PRIORITY=( slackware64:id3lib ) # 2018-01-09, also in alienbob
PKGS_PRIORITY+=( slackware64:gcc ) # 2020-09-17 override multilib.
PKGS_PRIORITY+=( slackware64:mariadb ) # 2021-05-04 overide testing.
PKGS_PRIORITY+=( justpkgs )
PKGS_PRIORITY+=( nonslack )
PKGS_PRIORITY+=( slackpkgplus )
PKGS_PRIORITY+=( multilib restricted alienbob )

REPOPLUS+=( justpkgs )
REPOPLUS+=( nonslack )
REPOPLUS+=( slackpkgplus )
REPOPLUS+=( multilib restricted alienbob )

MIRRORPLUS['slackpkgplus']=http://slakfinder.org/slackpkg+dev/
MIRRORPLUS['nonslack']=file://home/non-slack/slackbuilds/
MIRRORPLUS['justpkgs']=dir://home/non-slack/justpkgs/
MIRRORPLUS['multilib']=file://home/non-slack/multilib/current/
MIRRORPLUS['alienbob']=file://home/non-slack/alienbob/current/x86_64/
MIRRORPLUS['restricted']=file://home/non-slack/alienbob_restricted/current/x86_64/

Note the first PKGS_PRIORITY which puts slackware first over a same named package in alienbob.

You can add this to greylist to keep those packages from being selected by default. This is useful with 'slackpkg install alienbob' and slackpkg upgrade-all' in that alienbob packages will not be selected by default. You will have to review the list and select them manually.
Code:

SLACKPKGPLUS_alienbob
Edit: Also note that nonslack is my third party local repository for my own SlackBuilds. This repository has priority over alienbob.

Edit2: justpkgs is a local directory that has only packages, no metadata required.

zdolar 06-04-2021 02:13 AM

Thank you "chrisretusn".

My question was not exact. I already have slackpkplus.conf configured that way and regarding packages are listed in update list but not marked.

My goal is to configure updates the way that packages, I do not want to upgrade are NOT even on the list, not only "not marked for update" I do not want to see those packages on a list. That list is sometimes huge, and can accidentally mark undesired package for upgrade - when I mark all multilib packages.

regex in blacklist do not work right.
For example perl-*-?alien do not hide those packages.

marav 06-04-2021 03:11 AM

According to :
Code:

man /etc/slackpkg/blacklist
The right syntax is :
<package>-.*

So if you want to blacklist alienbob's perl packages - which is not fair :-) - the syntax would be :
Code:

perl-.*?alien

zdolar 06-04-2021 03:37 AM

Quote:

Originally Posted by marav (Post 6256330)
According to :
Code:

man /etc/slackpkg/blacklist
The right syntax is :
<package>-.*

So if you want to blacklist alienbob's perl packages - which is not fair :-) - the syntax would be :
Code:

perl-.*?alien

:) :hattip: Thank you!

And "- which is not fair" - agree 100% with you. Eric is one of the best and respectable contributors/developers. :hattip: :hattip: :hattip:
But his perl packages, the one I need, are all outdated and not for latest current (pre slackware-15).
I've broken my system with them and spent a lot of time to find out the reason.
I use >90 perl scripts - Zoneminder dependencies, and to find a sinner among them.. :banghead:

Petri Kaukasoina 06-04-2021 04:02 AM

Why is the question mark there? Maybe you are confusing regular expressions and shell globbing (wild cards)?

marav 06-04-2021 04:11 AM

Quote:

Originally Posted by Petri Kaukasoina (Post 6256341)
Why is the question mark there? Maybe you are confusing regular expressions to shell globbing (wild cards)?

slackpkgplus use a specific syntax for blacklisting packages
And since the 24/02/2021 the syntax has change
Code:

Wed Feb 24 22:07:25 CET 2021
pkg/slackpkg+-1.7.2-noarch-1mt.txz: Upgrade
[...]
Note:
  - slackpkg+ currently does not support $ROOT
  - slackpkg-15 uses a new blacklist syntax; this works fine with slackpkg+
    but just for blacklist; don't use it for greylist

So, it needs some adjustments

zdolar 06-04-2021 04:13 AM

Quote:

Originally Posted by Petri Kaukasoina (Post 6256341)
Why is the question mark there? Maybe you are confusing regular expressions to shell globbing (wild cards)?

Solved, as noted.
Tested working:
Quote:

perl-.*alien
As you see there is no "?" any more, as *? is the same as *

marav 06-04-2021 04:31 AM

Quote:

Originally Posted by zdolar (Post 6256346)
Solved, as noted.
Tested working:

As you see there is no "?" any more, as *? is the same as *

Right
the good one with ?:
Code:

perl-.*-?alien

Petri Kaukasoina 06-04-2021 06:49 AM

Quote:

Originally Posted by marav (Post 6256354)
Right
the good one with ?:
Code:

perl-.*-?alien

(A disclaimer: I don't use slackpkg+ and I don't know anything about it.)

I'm sure you know your regular expressions but for those who don't, a little recap:

a matches 'a'
a? matches '' and 'a'
a+ matches 'a', 'aa', 'aaa', 'aaaa',...
a* matches '', 'a', 'aa', 'aaa', 'aaaa',...

A dot matches any single character, so naturally:

. matches any character, e.g. 'b'
.? matches zero or one character, e.g. '', 'b'
.+ matches one or more characters, e.g. 'b', 'be', 'beg7z'
.* matches zero or more characters, e.g. '', 'b', 'be', 'beg7z'

(Literal dot, question mark etc need to be escaped by a backslash: \. \? \+ \* )

So, what does perl-.*-?alien match? It has 'perl-', then after that any characters, zero times or more, then a hyphen zero times or once, and then 'alien'. For example perl-anythingalien and perl-anything-alien. It seems -? is superfluous, as a hyphen is also an 'any character', and perl-.*alien would match even with a hyphen immediately before 'alien'. As a matter of fact, alien's package names don't even contain a substring '-alien'. Instead, they have a version number between the hyphen and 'alien'.

What if you wanted to check for the version number? [0-9] matches any single character between 0 and 9 (i.e. a digit), so [0-9]+ matches one or more digits. You could then use
Code:

perl-.*[0-9]+alien

marav 06-04-2021 07:09 AM

Thanks for the explanation ;-)

The right method is the one that works, anyway

macondo 06-05-2021 09:40 AM

what if (in current) I want to blacklist blackbox??

Is this correct?

blackbox/*

in /etc/slackpkg/blacklist?

marav 06-05-2021 09:44 AM

Quote:

Originally Posted by macondo (Post 6256613)
what if (in current) I want to blacklist blackbox??

Is this correct?

blackbox/*

in /etc/slackpkg/blacklist?

The syntax should be :
blackbox-.*

macondo 06-05-2021 09:47 AM

thank you very much!

Petri Kaukasoina 06-05-2021 10:46 AM

No, it would be:
Code:

blackbox


All times are GMT -5. The time now is 06:01 PM.