diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2021-04-29 10:42:59 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2021-04-29 10:42:59 +0200 |
commit | b60cda7992d316123b036a4a0eb5f472d21e9cdd (patch) | |
tree | e4f69fdd5479c0ef3990582c6d20502c195604ec | |
parent | c61d7915ee844569b798273bf268afd83bb97c46 (diff) |
Temporarily Revert "2.3-only: Warn that the 0.1 protocol is deprecated"
This reverts commit 64127478630b676838735b509fec5cdfa36874c8.
-rw-r--r-- | apt-private/private-json-hooks.cc | 1 | ||||
-rwxr-xr-x | test/integration/test-apt-cli-json-hooks | 18 |
2 files changed, 7 insertions, 12 deletions
diff --git a/apt-private/private-json-hooks.cc b/apt-private/private-json-hooks.cc index acb9a3bf0..957140525 100644 --- a/apt-private/private-json-hooks.cc +++ b/apt-private/private-json-hooks.cc @@ -474,7 +474,6 @@ bool RunJsonHook(std::string const &option, std::string const &method, const cha if (strstr(line, "\"0.1\"")) { - _error->Warning("Hook %s uses deprecated 0.1 protocol", Opts->Value.c_str()); hookVersion = 0x010; } else if (strstr(line, "\"0.2\"")) diff --git a/test/integration/test-apt-cli-json-hooks b/test/integration/test-apt-cli-json-hooks index a3bcf3fdb..17bd17814 100755 --- a/test/integration/test-apt-cli-json-hooks +++ b/test/integration/test-apt-cli-json-hooks @@ -200,7 +200,7 @@ HOOK: BYE' apt dist-upgrade -s ################## version 0.1 ######################### TEST_HOOK_VERSION=0.1 -testequal 'Reading package lists... +testsuccessequal 'Reading package lists... Building dependency tree... Calculating upgrade... HOOK: HELLO @@ -231,11 +231,7 @@ HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.hello","id":0,"par HOOK: empty HOOK: request {"jsonrpc":"2.0","method":"org.debian.apt.hooks.install.post","params":{"command":"dist-upgrade","search-terms":[],"unknown-packages":[],"packages":[{"id":1,"name":"upgrade","architecture":"i386","mode":"install","automatic":false,"versions":{"candidate":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"install":{"id":1,"version":"2.0","architecture":"i386","pin":500,"origins":[{"archive":"testing","codename":"testing","origin":"Oranges","label":"Lemons","site":""}]},"current":{"id":4,"version":"1.0","architecture":"i386","pin":100,"origins":[]}}}]}} HOOK: empty -HOOK: BYE -W: Hook '$HOOK' uses deprecated 0.1 protocol -W: Hook '$HOOK' uses deprecated 0.1 protocol -W: Hook '$HOOK' uses deprecated 0.1 protocol -W: Hook '$HOOK' uses deprecated 0.1 protocol' apt dist-upgrade -s +HOOK: BYE' apt dist-upgrade -s ################## Wrong version ######################### @@ -267,7 +263,7 @@ while true; do read empty <&\$APT_HOOK_SOCKET if echo "\$request" | grep -q ".hello"; then - printf '{"jsonrpc": "2.0", "error": {"version": "0.2"}, "id": 0}\n\n' >&\$APT_HOOK_SOCKET + printf '{"jsonrpc": "2.0", "error": {"version": "0.1"}, "id": 0}\n\n' >&\$APT_HOOK_SOCKET break fi done @@ -277,8 +273,8 @@ EOF testfailureequal 'Reading package lists... Building dependency tree... -E: Hook '$HOOK' reported an error during hello: {"jsonrpc": "2.0", "error": {"version": "0.2"}, "id": 0} -E: Hook '$HOOK' reported an error during hello: {"jsonrpc": "2.0", "error": {"version": "0.2"}, "id": 0}' apt install foo -s +E: Hook '$HOOK' reported an error during hello: {"jsonrpc": "2.0", "error": {"version": "0.1"}, "id": 0} +E: Hook '$HOOK' reported an error during hello: {"jsonrpc": "2.0", "error": {"version": "0.1"}, "id": 0}' apt install foo -s ################## Missing separator line ######################### cat > json-hook.sh << EOF @@ -290,7 +286,7 @@ while true; do read empty <&\$APT_HOOK_SOCKET if echo "\$request" | grep -q ".hello"; then - printf '{"jsonrpc": "2.0", "result": {"version": "0.2"}, "id": 0}\n' >&\$APT_HOOK_SOCKET + printf '{"jsonrpc": "2.0", "result": {"version": "0.1"}, "id": 0}\n' >&\$APT_HOOK_SOCKET break fi done @@ -313,7 +309,7 @@ while true; do read empty <&\$APT_HOOK_SOCKET if echo "\$request" | grep -q ".hello"; then - printf '{"jsonrpc": "2.0", "result": {"version": "0.2"}, "id": 0}\nXX' >&\$APT_HOOK_SOCKET + printf '{"jsonrpc": "2.0", "result": {"version": "0.1"}, "id": 0}\nXX' >&\$APT_HOOK_SOCKET break fi done |