On Mon, Sep 21, 2020 at 02:36:36PM +0100, Stuart Henderson wrote: > It seems silly to have two tools that do basically the same thing, does this > have something that show-reverse-deps doesn't? And if so, wouldn't it be > better to improve the existing tool? > > Send tars not cvs diffs for new ports please.
I believe this is something different, that looks at installed packages. I just looked at the shell script, didn't try to read it, but using pkg_info this way is wrong. If we are looking at transitive closure (one way or another) of dependencies of installed packages, OpenBSD::RequiredBy has all the code already there, all you would need is a thin wrapper of a few lines to do it. The +REQUIRING and +REQUIRED_BY are quick enough to read that I don't think you actually need any kind of caching. If you really insist on looking at @depend, grepping through it is wrong. again, we did write code with Antoine in sysmerge that does this kind of thing properly. Specifically, what you want is a visitor that would get the info you need and nothing more, definitely NOT grep in plists directly, that's brittle and bound to fail eventually