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

--repo not operational when its value is a Copr repository #1949

Open
Ricky-Tigg opened this issue Jun 24, 2023 · 4 comments
Open

--repo not operational when its value is a Copr repository #1949

Ricky-Tigg opened this issue Jun 24, 2023 · 4 comments
Labels

Comments

@Ricky-Tigg
Copy link

dnf .v: 4.16.1 | Hello. --repo not operational when its value is a Copr repository.

$ dnf rq --userinstalled --qf '%{from_repo} | %{vendor}' ssh-audit
copr:copr.fedorainfracloud.org:sunwire:ssh-audit | Fedora Copr - user sunwire
$ dnf rq --repo=copr:copr.fedorainfracloud.org:sunwire:ssh-audit --userinstalled --qf %{name}
$ 
@m-blaha
Copy link
Member

m-blaha commented Jun 24, 2023

This will not work and we should better document it.
The thing is that --userinstalled switch limits the resulting set to installed (user-installed more precisely) packages. These packages are loaded to a special repository named "@System" repo.
--repo=<copr_repo_id> does not filter by "from_repo", but limits packages available to dnf only to package contained in repo with given id.
Putting these two options in one command asks dnf to print packages that are simultaneously in "@System" and in "copr" repositories. But hese two repositories are disjunctive - for dnf each package is exactly in one repository and even though the installed package and repository package can have completely the same NEVRA, they are different entities.
Thus the output is empty (and will be empty for any other repository, not just copr ones).

@Ricky-Tigg
Copy link
Author

I misinterpreted the role of --repo by assuming it would interpret the value as meaning repository packages are installed from, hence querying accordingnly by listing packages that are installed from a such repository. Otherwise the following command would have been adequate to test the operability of --repo with a Copr repository.

$ dnf -q rq --repo=copr:copr.fedorainfracloud.org:sunwire:ssh-audit --available --qf %{name}
ssh-audit

That leads me to investigate the possibility to apply that --repo function in order to determine the presence of a package on Copr repository platform.

$ dnf -vq rq --repo=copr:copr.fedorainfracloud.org:* --available ssh-audit | sed '1,4d;$d'
repo: using cache for: copr:copr.fedorainfracloud.org:phracek:PyCharm
copr:copr.fedorainfracloud.org:phracek:PyCharm: using metadata from Tue May 23 15:23:04 2023.
repo: using cache for: copr:copr.fedorainfracloud.org:sunwire:ssh-audit
copr:copr.fedorainfracloud.org:sunwire:ssh-audit: using metadata from Wed Jun 21 17:56:29 2023

Note: the unexpected behavior resulting from the combination of -v and -q is out of scope here.

That appears not to be supported. Again with a traditional output:

$ dnf -q rq --repo=copr:copr.fedorainfracloud.org:* --available ssh-audit
$ 

@m-blaha
Copy link
Member

m-blaha commented Jun 26, 2023

Hm, this looks like a valid issue.

List packages from a given copr repo:

❯ dnf repoquery --repo=copr:copr.fedorainfracloud.org:atim:starship
Last metadata expiration check: 0:04:09 ago on Po 26. června 2023, 10:05:54.
starship-0:1.15.0-1.fc38.src
starship-0:1.15.0-1.fc38.x86_64

But if you replace the repoid with a glob (which is supposed to be supported according the documentation and works with some commands, e.g. repolist):

❯ dnf repoquery --repo=copr:copr.fedorainfracloud.org:atim:*
Last metadata expiration check: 0:04:11 ago on Po 26. června 2023, 10:05:54.

~ 

@Ricky-Tigg
Copy link
Author

As per the good practice one issue per report, i had had the intention to report soon about the behavior of --repo=<expression>* . Otherwise that would make two issues, related to the opportunities to improve the relevant part of documentation as you pertinently suggested and to address the inconsistent support of *.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

3 participants