Sabayon / devkit

5 stars 8 forks source link

Cache results of package_deps and re-enable virtual dep stripping #6

Closed optiz0r closed 8 years ago

optiz0r commented 8 years ago

It's likely that some virtuals are dependencies of multiple package arguments to builder and the depgraph would be queried multiple times. This commit caches the results to avoid expensive duplicate shell execs and optimise for speed.

Additionally, when calls to equery depgraph match multiple packages (e.g. the query is for an unversioned atom, and multiple versions exist in the portage tree), the results for all versions are returned, resulting in duplicates. This change also strips out the duplicate entries so further work need only be done once.

This uses perl 5.10's state variables, so adds the appropriate use. Since Sabayon ships only perl 5.20, this should not be an issue.