fix: the apt read ends on its own status echo, 4.59.1 (NetOrk/netork#3139)
driver / lint (pull_request) Successful in 12s
driver / standard (pull_request) Successful in 14s
driver / lowest (pull_request) Successful in 41s
driver / types (pull_request) Successful in 59s
driver / test (3.13) (pull_request) Successful in 1m11s
driver / test (3.12) (pull_request) Successful in 1m21s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Successful in 1m59s
driver / publish (pull_request) Skipped
driver / lint (pull_request) Successful in 12s
driver / standard (pull_request) Successful in 14s
driver / lowest (pull_request) Successful in 41s
driver / types (pull_request) Successful in 59s
driver / test (3.13) (pull_request) Successful in 1m11s
driver / test (3.12) (pull_request) Successful in 1m21s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m4s
CI / driver (pull_request) Successful in 1m59s
driver / publish (pull_request) Skipped
APT_UPGRADABLE_COMMAND printed __APT_PHASED (4.58.1) and __APT_E (4.57.0) after __APT_RC. A screen-scraping transport reads until the command's last status echo and the prompt after it, so on a host where apt defers a package for phasing, or reports an error, the read never ended and ran into its timeout. __APT_END is now echoed once everything else is written.
This commit is contained in:
1 parent
85119a770e
commit
9106871bfa
4 files changed
+53
-3
No files matched your search
@@ -38,12 +38,17 @@ from napalm_device_types.updates import PackageSourcesUnreadable
|
||||
#: After it, a simulated ``apt-get upgrade`` -- no root, no lock -- names what apt
|
||||
#: defers for phasing, each line of its list marked ``__APT_PHASED:``. Where the
|
||||
#: simulation fails it names nothing, and the listing stands as it is.
|
||||
#:
|
||||
#: Its last line is ``__APT_END=``, echoed once everything else is written. A
|
||||
#: screen-scraping transport reads until the command's last status echo and the
|
||||
#: prompt after it; ``__APT_PHASED`` and ``__APT_E`` came after ``__APT_RC``, and
|
||||
#: the read never ended (netOrk #3139). The parse does not read it.
|
||||
APT_UPGRADABLE_COMMAND = (
|
||||
"{ { LC_ALL=C apt list --upgradable 2>&1 1>&3 3>&-; echo __APT_RC=$? 1>&3; }"
|
||||
"{ { { LC_ALL=C apt list --upgradable 2>&1 1>&3 3>&-; echo __APT_RC=$? 1>&3; }"
|
||||
" | sed -n 's/^E: /__APT_E: /p';"
|
||||
" LC_ALL=C apt-get -s -o Debug::NoLocking=1 upgrade 2>/dev/null"
|
||||
" | sed -n '/deferred due to phasing:$/,/^[^ ]/{/^ /s/^ */__APT_PHASED: /p;}'; }"
|
||||
" 3>&1 | cat"
|
||||
" 3>&1; echo __APT_END=$?; } | cat"
|
||||
)
|
||||
|
||||
#: apt's last word when it cannot read its sources, in ``LC_ALL=C``.
|
||||
|
||||
Reference in new issue
Block a user