Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better -Qs with rpm (dnf/yum) #121

Open
sevu opened this issue Feb 3, 2019 · 1 comment
Open

better -Qs with rpm (dnf/yum) #121

sevu opened this issue Feb 3, 2019 · 1 comment

Comments

@sevu
Copy link

sevu commented Feb 3, 2019

On Arch, -Qs with multiple arguments gives results which contain both = it's an intersection
E.g. pacman -Qs maria java would match a package which has the words maria and java in any order in the pkgname or description.

rpm searches for each argument on it's own, but filters duplicates = it's an union
(it searches only package names, but let's be happy with that)

-Qs is for yum and dnf currently iplemented as rpm -qa "*${*}*"
We can follow how this is evaluated by using bahs's set -x, it evaluates to the single word '*maria java*'
As there are no packages containing a space ...

Changing it to rpm -qa *${*}* or rpm -qa "*${@}*" would evaluate to two words '*maria' 'java*'. This would match a few packages... but not mariadb-java-client-2.3.0-1.fc29.noarch

Now comes the part where I ask for help:
Transforming it to '*maria*' '*java*' will match it, though it will print all packages which are involved with either of them... a lot. (It's a union)
Transforming it to '*maria*java*' will be close. but now the order matters.

To get identical results as with archlinux, we need to transform it to '*maria*java*' '*java*maria*'

In other words, we need all permutations of $*, and could then connect them with spaces and *
How do we do that? And in bash? Some thoughts

  • In a loop. ${!n} would give the n'th argument
  • single quotes above are only for demonstration
@icy
Copy link
Owner

icy commented Feb 4, 2019

@sevu Thanks a lot for your input. I didn't notice there are some differences between pacman and yum/dnf. Supporting arch-liked feature sounds great however that requires a lot of effort in Bash: For the purpose I am not sure if Bash can help. Even if we implement the feature in any higher language, there is still some challenge: We implement the back-end feature (rpm/dnf) which is supposed to be done by the back-end instead.

Is that the union featureuseful from the point of view ofyum/dnfusers? Do they already have any option to switch fromuniontointersection`?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants