On 22/07/13 02:19PM, Ankur Sinha wrote:
> Hi folks,
> 
> I'm sure this exists somewhere but I couldn't find one, so with the help
> of folks on #fedora-devel, I hacked up this simple shell script to get
> the all the deps of a package. It's useful when your package update
> includes a soname bump, and you need to figure out what packages need to
> be rebuilt etc.
> 
> https://pagure.io/fedora-get-package-dependencies/blob/main/f/get_deps.sh
> 
> It lists all the capabilities of the package, and then asks dnf to list
> what packages require any of them. It should cover most cases.
> 
> If someone has a better script, please do share it, and please feel free
> to improve this one too. I'm more than happy to give everyone access to
> the repo and/or hand it over to a particular package maintainers related
> pagure group.

I don't think you need to do all of this. With

```
sudo dnf repoquery --repo=rawhide -q --whatrequires dcmtk | xargs sudo dnf 
repoquery --repo=rawhide -q --latest-limit 1 --source
```

AFAIK, dnf repoquery is smart enough to figure out the virtual provides
by itself. You can install fedora-repos-rawhide on a stable Fedora
release to get the rawhide repo definitions. (They're disabled by
default, so don't worry about your packages getting updated to rawhide
versions!) `--release rawhide` is not what you want. On my system, it
adds a few seconds to the script's execution, as it tries to load the
rawhide version for all of the enabled repositories. You only want to
query the rawhide repo itself.

A better version of the above would be

```
sudo dnf repoquery --repo=rawhide -q --whatrequires dcmtk | xargs sudo dnf 
repoquery --repo=rawhide -q --source | pkgname | sort | uniq
```

which just includes the *names* of the affected source packages. This is
most likely what you want for doing rebuilds.

If you're trying to find which source packages *Build*Require something,
you can use

```
sudo dnf repoquery --repo=rawhide{,-source} -q --whatrequires dcmtk-devel | 
grep '\.src' | pkgname | sort | uniq
```

You can add --recursive to either command if appropriate.

You can also add a .repo file for the koji buildroot repository and
query that

```
$ cat /etc/distro.repos.d/koji.repo
[koji]
name=koji
baseurl=http://kojipkgs.fedoraproject.org/repos/rawhide/latest/$basearch/
enabled=0


[koji-source]
name=koji-source
baseurl=http://kojipkgs.fedoraproject.org/repos/rawhide/latest/src/
enabled=0
```

I believe Miro uses this for the FTI bugs. It tends to be more accurate,
especially when there hasn't been a compose for a couple days. If this
is something people are interested in, I think it's worthwhile to
include this repo definition in fedora-packager.

-- 
Thanks,

Maxwell G (@gotmax23)
Pronouns: He/Him/His

Attachment: signature.asc
Description: PGP signature

_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to