| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
| |
And provide a Makefile to generate the test data from gentoo.git.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
| |
To facilitate unit testing.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
| |
Has been dead since commit c819d14 in 2009.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The man page clearly says that without --deep, users can expect eclean-dist
to be conservative in cleaning up, and not consider the VDB, just the repo
state.
Honour that promise by making VCS cleaning dependent on --deep, given it
involves VDB inspection to see what's installed.
Bug: https://bugs.gentoo.org/923369
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/915055
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/928951
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
| |
Zac pointed out that not all return paths had been updated.
Bug: https://bugs.gentoo.org/928138
Fixes: 87912b460c533f8b010617018fdad42246db85f0
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The DependPrinter class name and documentation indicated that it was
meant to be part of the gentoolkit.dependencies API, to print
Dependencies objects. This Printer class is used exclusively for
printering equery depends output and is not a public API outside of
the depends.py module
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The depends module can now iterate over the results of the
graph_reverse_depends function and print the items as they are
yielded.
Before, it passed in a callback printer function, and expected the
Dependencies class to call it correctly.
This setup is nicer because it does not tie together this module and
the Dependencies class, and the old setup most likely existed due to
performance and interactivity concerns which are now fixed by turning
graph_reverse_depends into an iterator.
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The graph_reverse_depends method was not able to pass the unit tests
introduced in the previous commits. It has been rewritten to pass them.
This also has adding types to the method, and yields the results as an
iterator rather than collecting them into a list in one shot.
The printer callback parameter has been removed. This callback most
likely existed so that results would be shown to the user as soon as
they were available instead of delaying printing until the method
completed, which could take seconds or minutes depending on the
parameters. By making this method an iterator, the same effect is
acheived by having the caller print every item as its yielded
from the method.
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new file with a basic unit test for the
graph_reverse_depends method on the Dependencies class.
Only 1 test exists right now, but various setup code and the general
pattern of the tests are valuable for creating more advanced tests,
and more tests for the Dependencies class in general.
Pytest is used to run all of the functions in the file that start with
test_, and a monkeypatch object is passed into test cases and allows
us to mock out methods on the Dependencies class, specifically the
"environment" method, which is used to query for packages variables
like DEPEND and RDEPEND. We are able to test against a small fake
denendency graph by patching the method!
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
StrEnum is only supported in Python versions 3.11 and
newer. Gentoolkit should not require >=3.11, so DependencyKind will
use the regular Enum feature instead.
The difference between StrEnum and Enum is that StrEnum members are
strings and can generally be used in place of strings in APIs
expecting string input. Non-StrEnum members are not strings, but you
can get members values by accessing their value field (DependencyKind.DEPEND.value).
Fixes: 78464ec40bad9a0f824b063506f58296cc3ed9f3
Signed-off-by: John Turner <jturner.usa@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/46
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
| |
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add try/except pair to _deps_equal() to output relavent details
causing the exception in order to aid the user to fix the issue.
Mark binpkg dep failures as a non match for possible deletion.
Make the ebuild dep failure a warning only, return True to save
the binpkg.
Add parameter docstring info
Bug: https://bugs.gentoo.org/923439
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
|
|
|
| |
pym/gentoolkit/dependencies.py:24:1: F401 'gentoolkit.helpers.uniqify' imported but unused
Fixes: c0300517671076db453204c796637e206bf977e5
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functools.cache caches the output of functions "automatically" without
requiring any manual management of a cache value. When used on class
methods, the cache is associated with each class instance and only
lives as long as the instance does.
The Dependencies.graph_reverse_depends method used a dict to cache
the output from pkg.get_all_depends. The get_all_depends method involves calling
portage's aux_get and parsing the DEPEND string that is returned by
it. This dict has been removed and replaced with functools.cache.
The graph_reverse_depends method did not cache the output of the
"raw=True" get_all_depends calls. This "raw" output is the literal string value for
the pkgdeps *DEPEND variables as returned by aux_get. Searching this for a
category/package sub-string allows quickly ruling out non-matching
pkgdeps, which allows skipping parsing the DEPEND string into a list
of Atoms.
Using functools cache the method that fetches the raw DEPEND string
massively improves performance for graph_reverse_depends when
searching for indirect reverse dependencies. "equery depends --indirect emacs"
runtime is ~2s with the raw value being cached, and ~60s
without. Searching for only direct reverse dependencies does not
utilize the cache and does not see any chance in runtime for me.
Signed-off-by: John Turner <jturner.usa@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/44
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of having separate functions for each DEPEND kind, the unified
method returns a dict with all of the packages *DEPEND values inside
of it. The dict can be indexed with a string or a field of the
DependencyKind enum.
This will be espeically useful for a future change that adds the
ability to filter out specific DEPEND kinds from the query.
The Dependencies class did not search IDEPEND dependencies, the
unified method searches all dependency kinds defined in the
DependencyKind enum, which includes IDEPEND!
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
The DependencyKind enum allows iterating over the different dependency
kinds and represents each dependency kind as a type. This could later
be used in APIs for selecting specific dependency kinds in queries.
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
Followup to c584d83705a2ca08961e4f0b541442fdf9a75947.
Bug: https://bugs.gentoo.org/922455
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/41
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/922455
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Closes: https://bugs.gentoo.org/921679
Closes: https://github.com/gentoo/gentoolkit/pull/38
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
A new feature for eclean-dist to clean git3-src.
Optionally, cleaning the vcs-src can be skipped with --skip-vcs.
Bug: https://bugs.gentoo.org/622938
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/33
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/909888
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Closes: https://github.com/gentoo/gentoolkit/pull/36
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
[sam: Note that this needs https://github.com/gentoo/portage/pull/1123 on
the Portage side.]
Bug: https://bugs.gentoo.org/900224
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/35
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
Last implemention was importing binhost module incorrectly:
calling Modules() from portage.module which sets binhost var to the BinhostHandler class
which would always fail as it needs name and namepath, leading to always call emaint
via a subprocess call.
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Portage recently enabled FEATURES=pkgdir-index-trusted by default which breaks
the eclean-invalids feature.
Force reindexing after cleaning up to fix this.
See-also: https://github.com/gentoo/portage/commit/3bc7bfef51d88fd716e882d3931f2873e3493e01
Bug: https://bugs.gentoo.org/889300
Bug: https://bugs.gentoo.org/900224
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/34
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/877519
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/32
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/900224
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/31
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/900224
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Rename --clean-invalids -> --clean-invalid
* Add --clean-invalid to help
* Make it default-off for now to match the option name (rather than
the help saying --no-clean-invalids).
(I could go either way on what the actual default should be, but this is more
conservative for now.)
* Fix typo in option name.
* Make it a package specific arg, not a global one.
Bug: https://bugs.gentoo.org/900224
Fixes: 204b1abca2c0cbbdad188c7fd4b84452c2f630a0
Fixes: a16d0d4fbfb4614832c4b682b41284a9050af29f
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/900224
Fixes: a16d0d4fbfb4614832c4b682b41284a9050af29f
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/30
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
| |
Changes required in portage -> https://github.com/gentoo/portage/pull/1016
Bug: https://bugs.gentoo.org/900224
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Fixes: 637bfbfb27d2104a81d80e5c67a7878d2e874966
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Closes: https://bugs.gentoo.org/369581
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Closes: https://bugs.gentoo.org/709816
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Signed-off-by: Diego Viola <diego.viola@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/27
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
|
|
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/902551
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Closes: https://github.com/gentoo/gentoolkit/pull/26
Signed-off-by: Sam James <sam@gentoo.org>
|