aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* refactor(config): simplify render_prepends signature.Brian Harring2023-02-021-5/+4
| | | | | | | | | The flatten argument is purely type specific, and there are no users of this function beyond one internal site. Thus simplify the API (to make typing easier), and to make future refactoring easier. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(config): Remove ConfigHint/configurable positional arg supportBrian Harring2023-02-0224-42/+55
| | | | | | | | | This never made much sense in light of how args were handled, and it complicates the heck out of typing, thus require invokers to be explicit. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(config): adding typing to config hints along with immutability.Brian Harring2023-02-022-16/+29
| | | | | | | | | | | | | ConfigHint's should be treated as immutable; any manipulation of their data should be handled either via clone or via pre-processing. This system is complex enough we don't want mutability, and the allowance of that was an oversight from the good ole days of py2.4. Force immutability sincei t's the actual design contract and also to flush out anyone breaking said contract (no pkgcore code breaks that, to be clear). Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* domain: support `-*` in use as previous removalArthur Zamarin2023-01-203-26/+63
| | | | | | | | Add support for `-*` and `USE_EXPAND: -*` syntax. Allow this syntax, and update incremental computation of resulting use combination. Resolves: https://github.com/pkgcore/pkgcore/issues/393 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(sync): Remove unused variable assignment.Brian Harring2023-01-201-1/+2
| | | | | | | | | We're only trying to limit the retries, thus use islice instead. Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/394 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor: use f-stringsArthur Zamarin2023-01-1912-48/+40
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.12.20Arthur Zamarin2023-01-191-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new release 0.12.19v0.12.19Arthur Zamarin2023-01-191-0/+16
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(portage_conf): Use f'' syntax for GENTOO_MIRRORS listcompBrian Harring2023-01-171-1/+1
| | | | | Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix(authors): re-add myself since I still hold most of the copyright.Brian Harring2023-01-171-0/+1
| | | | | Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(portage_conf): Push fallback (and path awareness) logic of ↵Brian Harring2023-01-172-27/+31
| | | | | | | | | | | | | | | | | repos.conf into methods. The previous code had the exception + fallback handling in the init; this is already a long init, and there are changes needed for repos conf, thus introduce a method to do the fallback logic. Said method will be extended to essentially bury the complexity of repos.conf- that problem- into an encapsulated method to try and reduce the cognitive burden of dealing with it. Why this matters: this work is prep for extension of repos.conf to add in various syncing features portage grew over the last decade+. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix(config): add exception chaining for an internal error.Brian Harring2023-01-171-4/+3
| | | | | | | | This code was written before exception chaining, but it's esoteric enough we very much want the chain to be thrown. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix(sync): Add loggger.debug() of the sync command actually being invoked.Brian Harring2023-01-171-0/+8
| | | | | | | | | | | | | Additionally, since we know the sync subsystem was written before basic sanity of the frontend, and we know that it invokes processes that write to stdout/stderr, force a flush of those handles to ensure that we don't wind up with interlaced output from two processes. The need to bury a flush here is a sign that the abstraction needs redesign, but that's a problem for a later date. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* refactor(sync): hide FD passing as an internal thing.Brian Harring2023-01-175-24/+30
| | | | | | | | | | | | | | | | | Effectively, add '_spawn' and '_spawn_interactive' to the base class, and expect consumers to invoke the appropriate one. This addition doesn't fully fix the fundamental lack of an observer (or log) based approach to getting info out of syncers, but it at least hides some of the internals so the syncer classes can do things like knowing what the correct encoding is for stdout, thus being able to write their own messages to it. TL;DR: This subsystem's interaction w/ CLI (and used as a library) needs rewriting, this just reduces that problem when we visit it. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* portage_conf: add support for make.profile as directoryArthur Zamarin2023-01-021-9/+11
| | | | | | | | | | | Support /etc/portage/make.profile as a directory, and not as symbolic link. In this state, /etc/portage/profile takes precedence over, and this is taken as a "normal" profile. We need to make sure that `load_profile_base` is turned off, as profiles base is irrelevant now. Resolves: https://github.com/pkgcore/pkgcore/issues/305 Resolves: https://github.com/pkgcore/pkgcheck/issues/426 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* domain: fix parsing of multiple USE_EXAPNDsArthur Zamarin2023-01-022-7/+33
| | | | | | | | - add support for parsing of multiple USE_EXAPNDs - fix error reporting when not USE_EXPAND has parsing error - updates tests to catch warning thrown by parsing Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* properly close open file handlers during testsArthur Zamarin2022-12-316-25/+20
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* start work on 0.12.19Arthur Zamarin2022-12-291-1/+1
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* new release 0.12.18v0.12.18Arthur Zamarin2022-12-271-0/+51
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Ignore both empty and non-existant repos.conf files.Brian Harring2022-12-262-8/+7
| | | | | | | | | | | Whilst this should probably matter, all reporting pathways I know of involve "don't yell at the user" this it's probably not optimal to have pathways that "yell at the user". Closes: https://github.com/pkgcore/pkgcore/issues/365 Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/387 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Throw an exception (py side) for any EBD var starting with '_'Brian Harring2022-12-261-2/+4
| | | | | | Closes: https://github.com/pkgcore/pkgcore/pull/333 Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Add use flag validation for /etc/portage/package.use/* content.Brian Harring2022-12-262-8/+19
| | | | | | | Had this been in place, it would've detected pkgcore/pkgcore#384 long ago. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Expand EAPI object declarations of support, wire atom to use it.Brian Harring2022-12-262-15/+28
| | | | | | | | | | Specifically, this moves strong blockers, use deps, and slot deps to rely upon the EAPI context of the atom parse. EAPI ultimately has say on this, thus just remove the 15+ year old hardcoded constants and use eapi_obj instead. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Convert to eapi_obj usage for subslot/iuse defaults in atom parsing.Brian Harring2022-12-261-2/+8
| | | | | | | | We already paid the cost of looking up the eapi obj constants, thus use it, and remove the atom implementations awareness of magic eapi constants. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Move valid_use_flag parsing out of atom, rely upon eapi obj.Brian Harring2022-12-261-5/+7
| | | | | | | | | | | | EAPI objects are responsible for deciding the rules of how to parse atoms, and this extends to use flags. Thus just ask the EAPI obj to tell us "is it valid?". In moving this out of atom.py it allows us to lace that validation into other configuration loading aspects of the code. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Add a constant of the latest PMS version, and add use flag validation to EAPI.Brian Harring2022-12-261-0/+13
| | | | | | | | | | | | Currently no EAPI varies the use flag parsing rules, but if it ever comes up, this will address it. In the process, this also will be used to move some logic out of atom.py whilst introducing the concept of 'latest PMS' as the 'latest' rules to parse under in the absense of an explicit directive. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Add USE_EXPAND expansion awareness for /etc/portage/package.use/* files.Brian Harring2022-12-262-6/+66
| | | | | | | | | | | | Specifically, if you have: `*/* PYTHON_TARGETS: -python2_7 python3_9` Pkgcore was treating `PYTHON_TARGETS:` as a use flag. That's obviously wrong, and the parsing should be tightened there. Closes: https://github.com/pkgcore/pkgcore/issues/384 Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Force stable sorting of /etc/portage/* files loading.Brian Harring2022-12-262-1/+58
| | | | | | | | | | | | | Specifically, alphanumeric sorting; a '00' should always be parsed before an '01' or 'a'. The ordering must be stable so that globals- in a 00 file- can be overridden per package via other files. If there is no stable ordering forced on how the order of files read, then this isn't supported. Closes: https://github.com/pkgcore/pkgcore/issues/385 Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Simplify some class attribute building.Brian Harring2022-12-261-20/+20
| | | | | Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Rename domain.pkg_operations to domain.get_pkg_operationsBrian Harring2022-12-266-8/+13
| | | | | | | | | Operations isn't a verb on it's own, so this naming isn't explanatory on it's own. 'get_pkg_operations'- plus a docstring- is clearer, thus the rename. Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* ci: add black format checkArthur Zamarin2022-12-251-0/+7
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Makefile: add black format targetArthur Zamarin2022-12-251-0/+4
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Make EAPI 8 `--disable-static` logic libtool-specificDavid Seifert2022-12-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * The intention has always been to only target `configure` scripts that use libtool, not just any script with a `--disable-static*` option. * libtool has been using the same `configure` format for at least the past 15 years (going back to libtool 1.5.22): 1. shared and static libraries enabled (the main use case): --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] 2. shared libraries enabled and static libraries disabled: --enable-static[=PKGS] build static libraries [default=no] --enable-shared[=PKGS] build shared libraries [default=yes] 3. shared libraries disabled and static libraries enabled: --enable-shared[=PKGS] build shared libraries [default=no] --enable-static[=PKGS] build static libraries [default=yes] Bug: https://bugs.gentoo.org/814380 Signed-off-by: David Seifert <soap@gentoo.org> Closes: https://github.com/pkgcore/pkgcore/pull/386 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Suppress the black reformat commit from git blameBrian Harring2022-12-251-0/+2
| | | | | | | | | | This can be activated (per repo) via: git config blame.ignoreRevsFile .git-blame-ignore-revs Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/382 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Reformat w/ black-22.12.0Brian Harring2022-12-25218-10771/+17529
| | | | | Signed-off-by: Brian Harring <ferringb@gmail.com> Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Fix secondary exception from when an EBD fails to start.Brian Harring2022-12-251-18/+31
| | | | | | | | | | | | | | | | | | Further in this __init__, self.pid is initialized to the process that is started. If that fails- an exception is thrown- then self.pid doesn't exist, which in turn breaks the assumptions of `shutdown_processor()` and `.is_alive` (both of which are designed to work if an init partially failed). Finally, add protections to ensure a failed spawn doesn't leak file descriptors. Python won't reap raw FD's, so we need to handle this gracefully. This secondary exception is visible in pkgcore/pkgcore#296 Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/383 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Use os.access instead of snakeoil.osutils.accessArthur Zamarin2022-12-252-4/+4
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* Fix use default dep matching when working against IUSE defaults.Brian Harring2022-12-222-11/+32
| | | | | | | | | | | | | Tests are added to validate, but essentially an atom like `sys-libs/libxcrypt[abi_x86_32(-),abi_x86_64(-),system(-)]` would fail to match IUSE='+system' due to the restriction using the unstripped iuse for a set check. With that fixed, the resolver- at least on my system- now actually can generate solutions that are sane/correct. Signed-off-by: Brian Harring <ferringb@gmail.com> Closes: https://github.com/pkgcore/pkgcore/pull/381 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* pmerge: sort target processing to stabilize the graph.Brian Harring2022-12-211-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current resolver is effectively brute force graph exploration, iteratively adding results to the graph changing previously decisions based on new requests. This means that the resolver *can* produce different solutions if the order of constraints added to it differ. It's desirable the resolver behaviour be reproducible, thus change the default behaviour to sort the target list given to the resolver. As to why we don't force sorting within the resolver itself; for processing of package dependencies, those are already stably ordered. A future enhancement would be to modify the resolver to be explicit, but that's for when the resolver is rewritten. Currently the source of instability is the atoms fed to the resolver from pmerge, thus why I'm adding the sorting in pmerge. Finally: the resolver must always produce a solution, or must always not, irregardless of the argument ordering it's given. Thus '--disable-resolver-target-sorting' is added to allow disabling the sorting and doing something of a random entry/walk into the depgraph. This can produce differing solutions than what a sorted entry would produce; that is working as intended (there is no global optimizer of solutions, thus 'first solution' is what pmerge uses). Basically, these two invocations should agree that a solution exists, or doesn't. If they disagree this directly shows that the resolver is failing to explore solution space fully: * `pmerge <targets> --disable-resolver-target-sorting` * `pmerge <targets> Signed-off-by: Brian Harring <ferringb@gmail.com>
* add pmerge --pdb-intercept as a way to pdb.set_trace() into the resolver.Brian Harring2022-12-212-1/+25
| | | | | | | This is fairly hackish, but will be extended as a way to jump into the resolver decision making for debugging and development. Signed-off-by: Brian Harring <ferringb@gmail.com>
* Update __all__ for ebuild.restrictsBrian Harring2022-12-211-1/+3
| | | | Signed-off-by: Brian Harring <ferringb@gmail.com>
* Remove unused stack parameter from insert_choicesBrian Harring2022-12-211-2/+2
| | | | Signed-off-by: Brian Harring <ferringb@gmail.com>
* Reuse the existing regex match rather than running it twice.Brian Harring2022-12-211-1/+1
| | | | Signed-off-by: Brian Harring <ferringb@gmail.com>
* s/slot/subslot/; name the parameter correctlyBrian Harring2022-12-211-2/+2
| | | | Signed-off-by: Brian Harring <ferringb@gmail.com>
* ebd_ipc: filter unpack results when needed.Brian Harring2022-12-211-2/+1
| | | | | | | | The previous form was risky in that it assigned a generator to consume from; this form of pattern can bite folks in the ass; minimally, it makes tests trickier. Signed-off-by: Brian Harring <ferringb@gmail.com>
* Update code for modern python standardsBrian Harring2022-12-211-3/+1
| | | | Signed-off-by: Brian Harring <ferringb@gmail.com>
* Drop dead code commentBrian Harring2022-12-211-1/+0
| | | | Signed-off-by: Brian Harring <ferringb@gmail.com>
* Add REQUIRED_USE satisfaction solverArthur Zamarin2022-12-203-2/+241
| | | | | | | | Based on new `snakeoil.constraints`, this adds a solver which can build satisfying USE flag combinations for a given set of REQUIRED_USE restricts. This will be used by new tool `pkgdev tatt`. Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* fix build for newest pipArthur Zamarin2022-12-182-3/+3
| | | | Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
* remove dependence on plugincache generationArthur Zamarin2022-12-182-36/+6
| | | | | Resolves: https://github.com/pkgcore/pkgcore/issues/376 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>