Improvemen 10000 t: runnable if no wget; readable if no terminal or no Unicode; a bit more tips for users; clean code #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! I'm from your answer on unix.stackexchange.com 1 . The
pkgdownload
script is a very useful tool. Thanks for your effort!Summary
I read your code and try improving it for the following points:
apt update
beforeapt search <package>
if error occurs.docker build
or other non-terminal environment.Please read commit message of my commits for details.
Thank you!
Comparison
Test
No "wget" found and non-terminal environment
Dockerfile:
During
docker build
:After applying my patches:
non-Unicode-supported environment
After installing "wget" and "ca-certificates", we can download packages:
Please note these
[\u2714]
. To match the "x" char for errors, here I use the "o" char to replace✔
(Tic-tac-toe).Footnotes
answer 472562 § How to download package not install it with apt-get command? - Unix & Linux Stack Exchange ↩