summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-cli-json-hooks
Commit message (Collapse)AuthorAgeFilesLines
* Avoid dealing with a fake dpkg stanza in the testsDavid Kalnischkies2022-09-021-8/+8
| | | | | | | | We needed a fake dpkg in our status file for dpkg --assert-multi-arch to work in the past, but recent dpkg versions do not require this anymore, so we can remove this somewhat surprising hackery in favour of better hidden hackery we only use if we work with an older dpkg (e.g. on current Debian stable).
* Temporarily Revert "2.3-only: Warn that the 0.1 protocol is deprecated"Julian Andres Klode2021-04-291-11/+7
| | | | This reverts commit 64127478630b676838735b509fec5cdfa36874c8.
* test/json: Make the test hook more reliableJulian Andres Klode2021-04-231-4/+11
| | | | | | Ugh, this was super flaky under -j 16 and -j 4, each behaving in slightly different ways. This seems to be stable now. No real bug though, all behaviors were OK.
* 2.3-only: Warn that the 0.1 protocol is deprecatedJulian Andres Klode2021-04-231-7/+11
|
* json: Hook protocol 0.2 (added upgrade,downgrade,reinstall modes)Julian Andres Klode2021-04-231-15/+73
| | | | | | | | | Hook protocol 0.2 makes the new fields we added mandatory, and replaces `install` mode with `upgrade`, `downgrade`, `reinstall` where appropriate. Hook negotiation is hacky, but it's the best we can do for now. Users are advised to upgrade to 0.2
* json: Add `package-list` and `statistics` install hooksJulian Andres Klode2021-04-231-0/+24
| | | | This enables hooks to output additional information.
* upgrade: Add JSON hook support (AptCli::Hooks::Upgrade)Julian Andres Klode2021-04-231-4/+41
|
* json: Add origins fields to versionJulian Andres Klode2021-04-231-6/+10
| | | | | | Provide access to the origins of a package, such that tools can display information about them; for example, you can write a hook counting security upgrades.
* test: Set -e in our test hookJulian Andres Klode2021-04-231-0/+1
| | | | Gbp-Dch: ignore
* Handle JSON hooks that just close the file/exit and fix some other errorsJulian Andres Klode2018-06-271-0/+87
| | | | | | | | | | | | | | JSON hooks might disappear and the common idiom to work around hooks disappearing is to check for the hook in the shell snippet that is in the apt.conf file and if it does not exist, do nothing. This caused APT to fail however, expecting it to acknowledge the handshake. Ignoring ECONNRESET on handshakes solves the problem. The error case, and the other error cases also did not stop execution of the hook, causing more errors to pile up. Fix this by directly going to the closing part of the code. LP: #1776218
* Introduce experimental new hooks for command-line toolsJulian Andres Klode2018-04-151-0/+122
This allows third-party package managers like snap or flatpak to hook in and suggest alternatives if packages could not be found, for example. This is still highly experimental and the protocol might change in future versions.