You are not logged in.

#1 2022-09-18 11:28:08

zacariaz
Member
From: Denmark
Registered: 2012-01-18
Posts: 537

Query packages not depending on xyz

Say you want to explore that repositories, which are quite extensive, for something or rather, but have certainly requirements, like not depending on gtk, for example.

Presumably this can be done? I know you can do the opposite, query packages depending on specific package, or rather, which packages are depending on the package, but I cannot figure out how to do the reverse.


Thanks.


I am a philosopher, of sorts, not a troll or an imbecile.
My apologies that this is not always obvious, despite my best efforts.

Offline

#2 2022-09-18 15:10:22

ayekat
Member
Registered: 2011-01-17
Posts: 1,531
Website

Re: Query packages not depending on xyz

zacariaz wrote:

have certainly requirements, like not depending on gtk, for example.

Could you elaborate a bit on those "requirements"?

If you need a tool XYZ, you will likely just install it, alongside its dependencies.
If you disagree with the dependencies it pulls in (for whatever reason), you can always build your own variant of the package that doesn't have that dependency.

If you want to go full-blockade-mode and be extra "safe", you can additionally install a meta-package that conflicts with the packages you have declared "undesirable", and let pacman yell at you if you ever dare installing something that would pull that in as a dependency:

pkgname=i-dont-like-gtk
pkgver=0.1
pkgrel=1
arch=(any)
package() {
  conflicts=(gtk2 gtk3)
}

(not that I think it makes any sense or that this would be a good idea, but as a purely technical approach…)


{,META,RE}PKGBUILDSpacman-hacks (includes makemetapkg and remakepkg) │ dotfiles

Offline

#3 2022-09-18 18:00:36

zacariaz
Member
From: Denmark
Registered: 2012-01-18
Posts: 537

Re: Query packages not depending on xyz

I'm sorry, I really don't mean to be difficult, and I do appreciate the answer, but why does it always have to be so difficult?
Why is it always presumed that the actual question is something else?

It is not difficult to imagine a use case. I for one would actually like to explore the repositories for a number of tools/applications, and I'd much prefer it not be dependent on GTK. Of course that is not all, but it is a pretty good example, I'd say.

It really is that simple, so why make it difficult?
Either it is possible, and the answer is yes, here is how, or the answer is no, you'll have to do it the hard way, like generating a list of all packages in the repos, with their dependencies, and eliminate the unwanted packages some other way.


I am a philosopher, of sorts, not a troll or an imbecile.
My apologies that this is not always obvious, despite my best efforts.

Offline

#4 2022-09-18 18:17:56

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 27,272
Website

Re: Query packages not depending on xyz

zacariaz wrote:

... but why does it always have to be so difficult?

If your questions consistently result in difficulty, it would be wise to suspect that you should put a bit more effort into asking clear questions rather than assuming everyone else has an issue.  You do have a history of turning your own threads sour by being confrontational with anyone who takes the time to try to understand your goals to the point that I suspect quite a few forum members will just no longer bother.

zacariaz wrote:

Why is it always presumed that the actual question is something else?

It isn't.  Instead, you presume that we can read your mind and know exactly what question you wanted to ask even when then one you posted is vague.  In this case, would you be happy with packages that do not list gtk in their depends array?  Or do you only want packages that do not have gtk anywhere in their dependency tree?  These are very different questions.

In the case of the former, using `expac` to list packages and dependencies that match a query, then piping through `grep -v gtk` should work quite well.  In the latter case, you'd need to do much more, most likely looping through candidate packages and getting ouput for each one from `pactree` and checking for gtk in that list one by one.  (edit: or using comm as Schard has demonstrated below - though you may want a search term replacing `pacman -Slq` with `pacman -Ssq $search-term`).

If instead your question is "does pacman have a built in flag to do exactly what I'm looking for?" the answer would be "no" - but that would also not be a forum-appropriate question as you could just look at the man page.  So perhaps in digging into your question more, we are giving the benefit of the doubt that this last question is not really the one you meant to ask.

Last edited by Trilby (2022-09-18 21:33:13)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#5 2022-09-18 20:13:52

ayekat
Member
Registered: 2011-01-17
Posts: 1,531
Website

Re: Query packages not depending on xyz

I do admit I did probably turn this into a "different question", as you put it. Apologies, let me try again:

zacariaz wrote:

Either it is possible, and the answer is yes, here is how, or the answer is no, you'll have to do it the hard way, […]

There is a logical issue with the way that question is phrased. The answer is "yes, and you'll have to do it the hard way".
There is no built-in functionality in any related tool, so presumably it will involve some scripting work by yourself. You could use expac, or just write your own package DB query tool.

Had I been more blunt in my initial message, I would have simply stopped after asking for clarification. Because this is typically the kind of questions that ends in an XY problem, and it makes sense to first ask for more information before thoughtlessly replying with a technically correct, but practically useless (or even dangerous) answer.

But it appears you do not appreciate that, and I respect that. No further comments and suggestions on your original question or your follow-up message (about exploring applications) from my side, then.


{,META,RE}PKGBUILDSpacman-hacks (includes makemetapkg and remakepkg) │ dotfiles

Offline

#6 2022-09-18 20:36:51

schard
Member
From: Hannover
Registered: 2016-05-06
Posts: 1,495
Website

Re: Query packages not depending on xyz

This might do what you're looking for:

comm -23 <(pacman -Slq | sort) <(sort <(pactree -lrs gtk2; pactree -lrs gtk3; pactree -lrs gtk4))

Солідарність з Україною

Offline

#7 2022-09-19 08:44:19

zacariaz
Member
From: Denmark
Registered: 2012-01-18
Posts: 537

Re: Query packages not depending on xyz

I would like to apologise, though I don't actually think I'm in the wrong, as such. Never the less, yesterday, my diplomacy cap did leave something to be desired.
My point still stands though. I see it all the time, it is not just me who experience it, I just point it out. Well, usually I don't actually, because I do understand where it comes from, but never the less, the phrase: "Why do you want to do this?", as in: "you really shouldn't", or: "this is just plain silly/stupid", even in cases of people, who shouldn't need that kind of hand holding, is used, I think, far to often.

Well, enough of that, I did mean the entire dependency tree, which I thought was obvious, or there would be little point in actually doing it. My mistake. I know that I am not always the best at phrasing questions, which is also why I tend to be long winded, because I actually do make a significant effort, one way or another. This time, the effort was to keep it short.

I always appreciate the effort, which is why I try to be as polite as possible, though it is rarely appreciated, probably because I don't employ the use of smileys or emojis. Frankly, I believe that if you need to to that, you've done a poor job of getting your message across, but then again, some people these days, actually assume that if you don't, you're angry or mad or something. Not easy for someone like me.

I will take a look at the very appreciated answers now (expac, of course m-) (That is supposed to be a facepalm emoji. You may consider this a feature request, and I promise to use it, if added. You may also consider this an attempt at humour, though the feature request is actually real) ), and spend the day considering all the other stuff, as have been my routine for more than a quarter of a century. Change is slow, but never ending, which I think you will appreciate, if you take a look at my posts from before I left, never to return, so long ago. I am far less perfect than most, which is also why, as opposed (and unbeknownst) to the vast majority of people, I spend an inordinate amount of time, looking myself in the mirror. This, many could and should learn from, and my way of helping that, is honestly, regardless of the consequences. Sometimes I'm just plain wrong, but mostly, or so I am arrogant enough to believe, there is, at the very least, a gist of truth in my rambling.


Thanks and best regards.

NB: This post took ~45 minutes to write, and was read through upwards of 20 times, if not more, including research in to emojis and the words unbeknownst and inordinate, not to mention a lot of soul searching. I am a philosopher, of sorts, not a troll, and I am sorry I cannot change the fact, that this is not always obvious.

Last edited by zacariaz (2022-09-19 08:47:28)


I am a philosopher, of sorts, not a troll or an imbecile.
My apologies that this is not always obvious, despite my best efforts.

Offline

Board footer

Powered by FluxBB