summaryrefslogtreecommitdiff
path: root/apt-pkg
Commit message (Collapse)AuthorAgeFilesLines
...
* solver3: Only hide ver->pkg clauses, not pkg->ver version selection onesJulian Andres Klode2025-03-131-4/+14
| | | | | | | | Particularly as Helmut pointed out we need to show which version we selected for install if there is only one but there is a versioned conflicts. Reported-By: Helmut Grohne <helmut@subdivi.de> on IRC
* solver3: Fix test-resolve-by-keep-new-recommendJulian Andres Klode2025-03-121-20/+22
| | | | | | | | | | | | | | | | | Reorder the if branches a bit to simplify the understanding of the promotions, and allow us to keep track of which dependency existed in the installed version. Change the rule for promoting new recommends to only promote new recommends to depends in *upgrade* and not *dist-upgrade* per the test-resolve-by-keep-new-recommends test case. This makes some sense: In a dist-upgrade, the solver could otherwise decide to remove an installed package if both the following hold: (1) something needs the upgraded version | something else (2) the upgraded version is not installable due to unsat recommends
* solver3: Fix Recommends/Suggests vs Enhances confusionJulian Andres Klode2025-03-122-1/+14
| | | | | | | | | | | | | | | | | | We accidentally considered an Enhances a reason to keep a package installed, which of course it is not, fix the determination of "existing soft dependency" to only include soft dependencies that should keep a package installed in the autoremover to solve the issue. This also fixes edsp/mantic-upgrade-rel-to-2024-05-29.edsp to not install llvm-13-dev for clang-13 which is an installed package with no upgrade. Also ensure we stop after the first match; the DependsList() is ordered by decreasing priority and we don't want to override Recommends by Suggests in case a package declares both... LP: #2101800
* solver3: Correctly determine 'same' or groupsJulian Andres Klode2025-03-101-9/+29
| | | | | | We incorrectly used the DependencyData of the first or group member, however that only checked that the first or group member was the same and that both either had a next member or not.
* solver3: Print correct reason when registering dependencyJulian Andres Klode2025-03-101-2/+1
| | | | This is relevant when debugging common dependencies.
* solver3: Fix detection of satisfied recommends for pkg variablesJulian Andres Klode2025-03-101-1/+1
| | | | This only worked for version literals lol
* edsp: Set Forbid-New-Install/Forbid-Remove: no if other is setJulian Andres Klode2025-03-101-0/+4
| | | | | | | | The upgrade code may also set Upgrade: yes, and this sets both to yes, so `apt upgrade` dumps behave like `apt-get upgrade` ones, which of course is not intentional. moo
* solver3: Do not prefer new installs over manually installed obsoletesJulian Andres Klode2025-03-092-7/+13
| | | | | | | | | | Only move obsolete packages last that are automatically installed, as we don't want to remove manually installed obsolete packages. Add some missing const annotations to the operator[] arguments as well that were needed. LP: #2100247
* depcache: Add a new UpgradeCount() memberJulian Andres Klode2025-03-092-0/+17
|
* Introduce pkgDepCache::Transaction for transactional depcache updatesJulian Andres Klode2025-03-092-0/+109
|
* solver3: Verbose error messagesJulian Andres Klode2025-03-082-21/+208
| | | | | | | | | | | | | | | | | | | | | | Introduce a new function, LongWhyStr() that returns a longer reason for why something is being installed (or not). This does the same path walk as the other function does, but it renders the clauses at each level, and one per line, so the whole output is a lot more informative. It is a separate function to keep the existing debug messages use the simple single line implication graph We remove the other special case in AddWork() for empty solutions to mke use of the general case in Solve() instead, and then adapt the case in Solve() to the same case as in Enqueue(). This also happens to fix the bug that when we encountered an empty clause we just printed the clause had no solution, but not how we got to install the package with the clause. Adapt the test suite for the changes which is an annoying amount of paperwork.
* solver3: bestReason: Only find actual assignmentsJulian Andres Klode2025-03-071-1/+5
| | | | | | | | | | I marked exim4-daemon-light for install, which marked exim4-daemon-heavy for not install, but now in postfix Conflicts: mail-transport-agent we saw "not exim4-daemon-heavy" as the reason for not installing postfix. Oh noes.
* solver3: Support pretty printing clausesJulian Andres Klode2025-03-062-6/+17
| | | | | This will print the underlying dependency which is nicer to read.
* solver3: cleanup operators for VarJulian Andres Klode2025-03-061-8/+3
| | | | Particularly, use single line and implement operator!=
* solver3: refactor: Return inserted Clause in AddWork()Julian Andres Klode2025-03-062-8/+9
| | | | | This avoids relying on the inserted clause being at the back of the clauses vector.
* solver3: Simplify Var pointer taggingJulian Andres Klode2025-03-061-15/+16
| | | | | | | | Use an integer and tag the lowest bit manually. This makes it much easier to next convert this into a literal. Add some constexpr and remove an unnecessary assertion on CastPkg().
* Replace "GPG error" with "OpenPGP signature verification failed"Julian Andres Klode2025-03-041-3/+3
| | | | Reported-by: cacin on irc
* edsp: Write 'Size' to the EDSP filesJulian Andres Klode2025-03-032-2/+7
| | | | | | This allows solvers to optimize by download size; and gives us a better means of interpreting "downloadable" debs (they must have a size > 0 after all).
* Consider 0-size debs not downloadable, set a size in EDSPJulian Andres Klode2025-03-032-0/+6
| | | | | | | | | | | | EDSP dumps all appear as a single file, so we cannot determine correctly if a package is obsolete. We can fix this by ensuring that only debs with a size are downloadable, and then by faking a size in EDSP: The size is 1 if APT-Release is set (there is a source to download it from) or 0 otherwise. This ensures that the obsolete logic in solver3 works correctly, as well as the obsolete patterns, if anyone could actually use it on the EDSP files.
* refactor obsolete checks to use VerFileIterator::Downloadable()Julian Andres Klode2025-03-032-11/+7
|
* Fix crash in VersionExtra using --with-source etcJulian Andres Klode2025-02-242-3/+5
| | | | | | | | | | | | | | | | | | | | VersionExtra holds, at runtime, the SHA256 of the packages being added to try to avoid deduplicating obviously different packages; the SHA256 itself is too large to store in the cache. When volatile sources are used, the VersionExtra array is not initialized, or rather it used to be initialized to 32*1024 zero elements as a performance optimization. This meant that specifying --with-source with a package that looks like a duplicate of a version with an ID >= 32*1024 triggered the assertion; so we could not reproduce it easily in the test suite. Remove the optimized initialization to make the behavior more uniform; and treat too large version IDs as having no SHA256. Closes: #1098702
* solver3: Fix error stack handlingJulian Andres Klode2025-02-181-7/+7
| | | | | | | | | | | | Pushing the stack in push and popping it in pop did not really work correctly and is more complex than needed. Instead, push the error stack at the start of the Solve() method and revert at the end, such that we leave exactly at the same error stack level we entered. To handle error clearing on backtracking, just discard any pending errors.
* solver3: Fix test-apt-move-and-forget-manual-sectionsJulian Andres Klode2025-02-181-2/+24
| | | | | Implement the moving of the auto bit. The whole auto-bit management is not entirely optimal yet, but this works.
* refactor: Deduplicate and Move SectionInSubTree to ConfigurationJulian Andres Klode2025-02-183-38/+40
| | | | | Deduplicate the copies in a central one, mark it unavailable to external users.
* strutl: Add missing #include <cstdint> [gcc 15]Julian Andres Klode2025-02-181-0/+1
| | | | Closes: #1096322
* edsp: Use buffered writes for EDSP dumpsJulian Andres Klode2025-02-171-1/+1
| | | | This makes the dump almost instant rather than take forever.
* Add more excludes to the versionscriptJulian Andres Klode2025-02-151-0/+6
|
* Add missing #include <string_view>Julian Andres Klode2025-02-1512-0/+12
|
* Add missing #include <memory>Julian Andres Klode2025-02-154-0/+4
|
* cache: Introduce partial SourceVersion supportJulian Andres Klode2025-02-157-15/+82
| | | | | | | | | | | | This is the first step that introduces a 1:1 mapping between version and source version. In a future version this can use the fields currently marked unavailable to deduplicate the SourceVersion objects across the group. The policy gains a member for storing pins for sourceversions. Together, in the future we should be able to determine candidates for source versions.
* cacheset: Drop APT_PUBLIC from templatesJulian Andres Klode2025-02-151-2/+2
| | | | | These templates are all inline and there is not much sense exposing their vtables and typeinfo publicly.
* fileutl: Convert FileFd::d to std::unique_ptrJulian Andres Klode2025-02-152-18/+14
|
* Remove some more unused functionsJulian Andres Klode2025-02-154-70/+0
| | | | Final ABI cleanup before unstable?!
* Run unifdef -DAPT_PKG_ABI=700 againJulian Andres Klode2025-02-157-73/+0
| | | | | main picked up a couple new ifdefs since the branch started; so clean them up again.
* StartsWithGPGClearTextSignature(): don't keep un-written-to pointer to ↵наб2025-02-141-1/+1
| | | | constant string in .data
* flAbsPath(): try to re-use storage of argumentнаб2025-02-141-2/+2
|
* Take const& in flNotFile()наб2025-02-142-2/+2
|
* Take const& in GetLock()наб2025-02-142-2/+2
|
* Take const& in Rename()наб2025-02-142-2/+2
|
* Take const& in {,Real}FileExists()наб2025-02-142-4/+4
|
* string{=> _view} flNotDir(string{=> _view}). Configuration::{Cnd,}Set(Value: ↵наб2025-02-149-30/+33
| | | | string{=> _view})
* Return string_view from Apt::String::Strip(). Take string_view in ↵наб2025-02-146-23/+23
| | | | VectorizeString(), StringSplit(), SubstVar()
* APT::String::* should take string_viewsнаб2025-02-142-26/+13
|
* string{=> _view} flExtension(string{=> _view})наб2025-02-145-11/+11
|
* Drop APT::StringViewнаб2025-02-146-202/+2
|
* APT::StringView -> std::string_view [textonly]наб2025-02-1411-115/+111
|
* apt-pkg: Avoid exporting any optional symbolsJulian Andres Klode2025-02-142-2/+18
|
* Bump ABI to 7.0Julian Andres Klode2025-02-141-1/+1
|
* BaseRegexMatcher: Use std::optional [ABI]Julian Andres Klode2025-02-142-11/+11
|
* algorithms: Use smart pointer for 2nd PListJulian Andres Klode2025-02-141-13/+8
| | | | | | This involves the use of goto to fix undefined behavior in the for-loop restart which temporarily generates a K pointing one element ahead of the start of the array (which is undefined).